mirror of https://github.com/gorhill/uBlock.git
An XML document can be a valid HTML document. Try to instanciate a HTMLDivElement to find out whether we are dealing with an actual HTML document or not.
This commit is contained in:
parent
3dd19b7708
commit
1a380f0959
|
@ -33,8 +33,13 @@
|
||||||
|
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/464
|
// https://github.com/chrisaljoudi/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
//console.debug('contentscript-end.js > not a HTLMDocument');
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
|
if (
|
||||||
|
document instanceof XMLDocument === false ||
|
||||||
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// I've seen this happens on Firefox
|
// I've seen this happens on Firefox
|
||||||
|
|
|
@ -36,8 +36,13 @@
|
||||||
|
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/464
|
// https://github.com/chrisaljoudi/uBlock/issues/464
|
||||||
if ( document instanceof HTMLDocument === false ) {
|
if ( document instanceof HTMLDocument === false ) {
|
||||||
//console.debug('contentscript-start.js > not a HTLMDocument');
|
// https://github.com/chrisaljoudi/uBlock/issues/1528
|
||||||
|
if (
|
||||||
|
document instanceof XMLDocument === false ||
|
||||||
|
document.createElement('div') instanceof HTMLDivElement === false
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This can happen
|
// This can happen
|
||||||
|
|
Loading…
Reference in New Issue