fix(browser-extension): child nodes issue
This commit is contained in:
parent
dcc9dfef21
commit
2ef1b02383
@ -118,7 +118,7 @@ function isInViewport(node) {
|
||||
*/
|
||||
|
||||
function match(node, skipMatch) {
|
||||
if (!node instanceof HTMLElement) {
|
||||
if (!node instanceof HTMLElement || !node.tagName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ function match(node, skipMatch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (flatNode(node).every((x) => x === Node.TEXT_NODE)) {
|
||||
if (node.childNodes.length && flatNode(node).every((x) => x === Node.TEXT_NODE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user