mirror of https://github.com/gorhill/uBlock.git
Use `firstElementChild` instead of `childElementCount`
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1620 Related bugzilla issue: - https://bugzilla.mozilla.org/show_bug.cgi?id=1715841
This commit is contained in:
parent
6291168e9a
commit
090614dd18
|
@ -935,7 +935,7 @@ vAPI.DOMFilterer = class {
|
||||||
if ( node.localName === 'iframe' ) {
|
if ( node.localName === 'iframe' ) {
|
||||||
addIFrame(node);
|
addIFrame(node);
|
||||||
}
|
}
|
||||||
if ( node.childElementCount === 0 ) { continue; }
|
if ( node.firstElementChild === null ) { continue; }
|
||||||
const iframes = node.getElementsByTagName('iframe');
|
const iframes = node.getElementsByTagName('iframe');
|
||||||
if ( iframes.length !== 0 ) {
|
if ( iframes.length !== 0 ) {
|
||||||
addIFrames(iframes);
|
addIFrames(iframes);
|
||||||
|
@ -1175,7 +1175,7 @@ vAPI.DOMFilterer = class {
|
||||||
while ( i-- ) {
|
while ( i-- ) {
|
||||||
const node = addedNodes[i];
|
const node = addedNodes[i];
|
||||||
pendingNodes.add([ node ]);
|
pendingNodes.add([ node ]);
|
||||||
if ( node.childElementCount === 0 ) { continue; }
|
if ( node.firstElementChild === null ) { continue; }
|
||||||
pendingNodes.add(node.querySelectorAll('[id],[class]'));
|
pendingNodes.add(node.querySelectorAll('[id],[class]'));
|
||||||
}
|
}
|
||||||
if ( pendingNodes.hasNodes() ) {
|
if ( pendingNodes.hasNodes() ) {
|
||||||
|
|
Loading…
Reference in New Issue