Skip to content

Commit

Permalink
Use firstElementChild instead of childElementCount
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jun 17, 2021
1 parent 6291168 commit 090614d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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() ) {
Expand Down

0 comments on commit 090614d

Please sign in to comment.