diff options
author | gorhill <rhill@raymondhill.net> | 2015-08-28 10:44:33 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-08-28 10:44:33 -0400 |
commit | 94a1d72fc8ee3d73347b9eaea30ce0ca396bbb3e (patch) | |
tree | d600c4aa51ce93c8daad1ef23b153165f1c03233 /src | |
parent | 1a380f09599cfb327e9cbe1321dc5add8fb38144 (diff) | |
download | uBlock-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.js | 3 | ||||
-rw-r--r-- | src/js/contentscript-start.js | 3 | ||||
-rw-r--r-- | src/js/scriptlets/cosmetic-logger.js | 11 | ||||
-rw-r--r-- | src/js/scriptlets/cosmetic-off.js | 12 | ||||
-rw-r--r-- | src/js/scriptlets/cosmetic-on.js | 12 | ||||
-rw-r--r-- | src/js/scriptlets/cosmetic-survey.js | 12 | ||||
-rw-r--r-- | src/js/scriptlets/dom-inspector.js | 11 |
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 |