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':
|
||||
return elem.error !== null;
|
||||
case 'img':
|
||||
if ( elem.naturalWidth === 0 && elem.naturalHeight === 0 ) {
|
||||
return window.getComputedStyle(elem)
|
||||
.getPropertyValue('display') !== 'none';
|
||||
}
|
||||
if ( elem.naturalWidth !== 0 || elem.naturalHeight !== 0 ) {
|
||||
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:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue