Last active
April 30, 2024 13:19
-
-
Save canalun/64ba801617a17700ee18667c7a967c15 to your computer and use it in GitHub Desktop.
replace texts on web page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function overwriteTextNodes(root, yourText) { | |
const extendedChildNode = (node) => | |
node.firstChild || node.shadowRoot || node.contentDocument | |
for (let node = extendedChildNode(root); node; node = node.nextSibling) { | |
node.nodeType === 3 && (node.nodeValue = yourText) | |
overwriteTextNodes(node, yourText) | |
} | |
})(document.body, "👶") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment