Created
January 2, 2018 23:06
-
-
Save moklick/a7ad3a6caeb6d01fb0fa7da375f26eb2 to your computer and use it in GitHub Desktop.
was ist das fuer 1 extension
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
// via http://stackoverflow.com/questions/10730309/find-all-text-nodes-in-html-page#answer-10730777 | |
function findTextNodes(el) { | |
var node; | |
var textNodes = []; | |
var walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false); | |
while (node = walk.nextNode()) { | |
textNodes.push(node); | |
} | |
return textNodes; | |
} | |
findTextNodes(document.body).forEach(function(e) { | |
e.textContent = e.textContent.replace(/\be(in|ine|inen|iner|inem)\b/gi, '1'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment