Raymond Hill 2021-10-15 16:55:40 -04:00
parent d508d34c0a
commit c7f1af9547
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -232,7 +232,7 @@ const domLayout = (function() {
}; };
const domNodeFactory = function(level, node) { const domNodeFactory = function(level, node) {
var localName = node.localName; const localName = node.localName;
if ( skipTagNames.has(localName) ) { return null; } if ( skipTagNames.has(localName) ) { return null; }
// skip uBlock's own nodes // skip uBlock's own nodes
if ( node.classList.contains(sessionId) ) { return null; } if ( node.classList.contains(sessionId) ) { return null; }
@ -245,14 +245,14 @@ const domLayout = (function() {
// Collect layout data. // Collect layout data.
const getLayoutData = function() { const getLayoutData = function() {
var layout = []; const layout = [];
var stack = []; const stack = [];
var node = document; let lvl = 0;
var domNode; let node = document.documentElement;
var lvl = 0; if ( node === null ) { return layout; }
for (;;) { for (;;) {
domNode = domNodeFactory(lvl, node); const domNode = domNodeFactory(lvl, node);
if ( domNode !== null ) { if ( domNode !== null ) {
layout.push(domNode); layout.push(domNode);
} }