mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
https://github.com/chrisaljoudi/uBlock/issues/1528: apply fix to scriptlets too
This commit is contained in:
parent
1a380f0959
commit
94a1d72fc8
7 changed files with 49 additions and 15 deletions
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/464
|
// https://github.com/chrisaljoudi/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
|
// A XMLDocument can be a valid HTML document.
|
||||||
if (
|
if (
|
||||||
document instanceof XMLDocument === false ||
|
document instanceof XMLDocument === false ||
|
||||||
document.createElement('div') instanceof HTMLDivElement === false
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* jshint multistr: true */
|
/* jshint multistr: true */
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/464
|
// https://github.com/chrisaljoudi/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
|
// A XMLDocument can be a valid HTML document.
|
||||||
if (
|
if (
|
||||||
document instanceof XMLDocument === false ||
|
document instanceof XMLDocument === false ||
|
||||||
document.createElement('div') instanceof HTMLDivElement === false
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -31,7 +31,14 @@
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/464
|
// https://github.com/gorhill/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
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
|
// This can happen
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -31,8 +31,14 @@
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/464
|
// https://github.com/gorhill/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
//console.debug('cosmetic-off.js > not a HTLMDocument');
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
return;
|
// A XMLDocument can be a valid HTML document.
|
||||||
|
if (
|
||||||
|
document instanceof XMLDocument === false ||
|
||||||
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This can happen
|
// This can happen
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -31,8 +31,14 @@
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/464
|
// https://github.com/gorhill/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
//console.debug('cosmetic-on.js > not a HTLMDocument');
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
return;
|
// A XMLDocument can be a valid HTML document.
|
||||||
|
if (
|
||||||
|
document instanceof XMLDocument === false ||
|
||||||
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This can happen
|
// This can happen
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -31,8 +31,14 @@
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/464
|
// https://github.com/gorhill/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
//console.debug('cosmetic-survey.js > not a HTLMDocument');
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
return;
|
// A XMLDocument can be a valid HTML document.
|
||||||
|
if (
|
||||||
|
document instanceof XMLDocument === false ||
|
||||||
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This can happen
|
// This can happen
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global vAPI, HTMLDocument */
|
/* global vAPI, HTMLDocument, XMLDocument */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
@ -32,7 +32,14 @@
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/464
|
// https://github.com/gorhill/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
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
|
// This can happen
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue