mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-03 17:49:39 +02:00
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' ) {
|
||||
addIFrame(node);
|
||||
}
|
||||
if ( node.childElementCount === 0 ) { continue; }
|
||||
if ( node.firstElementChild === null ) { continue; }
|
||||
const iframes = node.getElementsByTagName('iframe');
|
||||
if ( iframes.length !== 0 ) {
|
||||
addIFrames(iframes);
|
||||
@ -1175,7 +1175,7 @@ vAPI.DOMFilterer = class {
|
||||
while ( i-- ) {
|
||||
const node = addedNodes[i];
|
||||
pendingNodes.add([ node ]);
|
||||
if ( node.childElementCount === 0 ) { continue; }
|
||||
if ( node.firstElementChild === null ) { continue; }
|
||||
pendingNodes.add(node.querySelectorAll('[id],[class]'));
|
||||
}
|
||||
if ( pendingNodes.hasNodes() ) {
|
||||
|
Loading…
Reference in New Issue
Block a user