aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-08-28 10:44:33 -0400
committergorhill <rhill@raymondhill.net>2015-08-28 10:44:33 -0400
commit94a1d72fc8ee3d73347b9eaea30ce0ca396bbb3e (patch)
treed600c4aa51ce93c8daad1ef23b153165f1c03233 /src
parent1a380f09599cfb327e9cbe1321dc5add8fb38144 (diff)
downloaduBlock-94a1d72fc8ee3d73347b9eaea30ce0ca396bbb3e.zip
uBlock-94a1d72fc8ee3d73347b9eaea30ce0ca396bbb3e.tar.gz
uBlock-94a1d72fc8ee3d73347b9eaea30ce0ca396bbb3e.tar.bz2
https://github.com/chrisaljoudi/uBlock/issues/1528: apply fix to scriptlets too
Diffstat (limited to 'src')
-rw-r--r--src/js/contentscript-end.js3
-rw-r--r--src/js/contentscript-start.js3
-rw-r--r--src/js/scriptlets/cosmetic-logger.js11
-rw-r--r--src/js/scriptlets/cosmetic-off.js12
-rw-r--r--src/js/scriptlets/cosmetic-on.js12
-rw-r--r--src/js/scriptlets/cosmetic-survey.js12
-rw-r--r--src/js/scriptlets/dom-inspector.js11
7 files changed, 49 insertions, 15 deletions
diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js
index 9e3e1a2..bceb856 100644
--- a/src/js/contentscript-end.js
+++ b/src/js/contentscript-end.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
@@ -34,6 +34,7 @@
// https://github.com/chrisaljoudi/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
// https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
if (
document instanceof XMLDocument === false ||
document.createElement('div') instanceof HTMLDivElement === false
diff --git a/src/js/contentscript-start.js b/src/js/contentscript-start.js
index 21931a3..ac7d924 100644
--- a/src/js/contentscript-start.js
+++ b/src/js/contentscript-start.js
@@ -20,7 +20,7 @@
*/
/* jshint multistr: true */
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
@@ -37,6 +37,7 @@
// https://github.com/chrisaljoudi/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
// https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
if (
document instanceof XMLDocument === false ||
document.createElement('div') instanceof HTMLDivElement === false
diff --git a/src/js/scriptlets/cosmetic-logger.js b/src/js/scriptlets/cosmetic-logger.js
index bd32376..0b7c673 100644
--- a/src/js/scriptlets/cosmetic-logger.js
+++ b/src/js/scriptlets/cosmetic-logger.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
@@ -31,7 +31,14 @@
// https://github.com/gorhill/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
- return;
+ // https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
+ if (
+ document instanceof XMLDocument === false ||
+ document.createElement('div') instanceof HTMLDivElement === false
+ ) {
+ return;
+ }
}
// This can happen
diff --git a/src/js/scriptlets/cosmetic-off.js b/src/js/scriptlets/cosmetic-off.js
index e8d46eb..4079269 100644
--- a/src/js/scriptlets/cosmetic-off.js
+++ b/src/js/scriptlets/cosmetic-off.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
@@ -31,8 +31,14 @@
// https://github.com/gorhill/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
- //console.debug('cosmetic-off.js > not a HTLMDocument');
- return;
+ // https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
+ if (
+ document instanceof XMLDocument === false ||
+ document.createElement('div') instanceof HTMLDivElement === false
+ ) {
+ return;
+ }
}
// This can happen
diff --git a/src/js/scriptlets/cosmetic-on.js b/src/js/scriptlets/cosmetic-on.js
index e53397f..2c94721 100644
--- a/src/js/scriptlets/cosmetic-on.js
+++ b/src/js/scriptlets/cosmetic-on.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
@@ -31,8 +31,14 @@
// https://github.com/gorhill/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
- //console.debug('cosmetic-on.js > not a HTLMDocument');
- return;
+ // https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
+ if (
+ document instanceof XMLDocument === false ||
+ document.createElement('div') instanceof HTMLDivElement === false
+ ) {
+ return;
+ }
}
// This can happen
diff --git a/src/js/scriptlets/cosmetic-survey.js b/src/js/scriptlets/cosmetic-survey.js
index f3e0890..39e7105 100644
--- a/src/js/scriptlets/cosmetic-survey.js
+++ b/src/js/scriptlets/cosmetic-survey.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
@@ -31,8 +31,14 @@
// https://github.com/gorhill/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
- //console.debug('cosmetic-survey.js > not a HTLMDocument');
- return;
+ // https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
+ if (
+ document instanceof XMLDocument === false ||
+ document.createElement('div') instanceof HTMLDivElement === false
+ ) {
+ return;
+ }
}
// This can happen
diff --git a/src/js/scriptlets/dom-inspector.js b/src/js/scriptlets/dom-inspector.js
index 203ba0d..5a42a0e 100644
--- a/src/js/scriptlets/dom-inspector.js
+++ b/src/js/scriptlets/dom-inspector.js
@@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
-/* global vAPI, HTMLDocument */
+/* global vAPI, HTMLDocument, XMLDocument */
/******************************************************************************/
/******************************************************************************/
@@ -32,7 +32,14 @@
// https://github.com/gorhill/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) {
- return;
+ // https://github.com/chrisaljoudi/uBlock/issues/1528
+ // A XMLDocument can be a valid HTML document.
+ if (
+ document instanceof XMLDocument === false ||
+ document.createElement('div') instanceof HTMLDivElement === false
+ ) {
+ return;
+ }
}
// This can happen