diff --git a/chrome-extension/src/content.js b/chrome-extension/src/content.js index ba6c7ab..94a618d 100644 --- a/chrome-extension/src/content.js +++ b/chrome-extension/src/content.js @@ -42,10 +42,13 @@ function getTextContent(root) { NodeFilter.SHOW_TEXT, null ); - let node; let textContent = "" while (node = walker.nextNode()) { + try { + let tagName = node.parentElement.tagName; + if (tagName == "SCRIPT" || tagName == "STYLE") { continue; } + } catch (error) { } textContent += node.nodeValue + " "; } return textContent;