mirror of https://github.com/gorhill/uBlock.git
blocked-image-by-size: getComputedStyle() on Pale Moon can return null
This commit is contained in:
parent
7a0b4356ad
commit
58838ce4c5
|
@ -52,11 +52,14 @@ var mediaNotLoaded = function(elem) {
|
||||||
case 'video':
|
case 'video':
|
||||||
return elem.error !== null;
|
return elem.error !== null;
|
||||||
case 'img':
|
case 'img':
|
||||||
if ( elem.naturalWidth === 0 && elem.naturalHeight === 0 ) {
|
if ( elem.naturalWidth !== 0 || elem.naturalHeight !== 0 ) {
|
||||||
return window.getComputedStyle(elem)
|
|
||||||
.getPropertyValue('display') !== 'none';
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
var style = window.getComputedStyle(elem);
|
||||||
|
// For some reason, style can be null with Pale Moon.
|
||||||
|
return style !== null ?
|
||||||
|
style.getPropertyValue('display') !== 'none' :
|
||||||
|
elem.offsetHeight !== 0 && elem.offsetWidth !== 0;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue