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,9 +33,14 @@
|
||||||
|
|
||||||
// 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
|
||||||
if ( window.location === null ) {
|
if ( window.location === null ) {
|
||||||
|
|
|
@ -36,9 +36,14 @@
|
||||||
|
|
||||||
// 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
|
||||||
if ( typeof vAPI !== 'object' ) {
|
if ( typeof vAPI !== 'object' ) {
|
||||||
|
|
Loading…
Reference in New Issue