Created
March 2, 2016 14:55
-
-
Save amullins83/3ef001e24aaada887db4 to your computer and use it in GitHub Desktop.
Simple Chrome Mangler Extension transform script
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 drumpfinate(text) { | |
return text.replace(/\bTrump\b/g, "Drumpf"); | |
} | |
(function transformTree(transform) { | |
var walker = document.createTreeWalker( | |
document.body, | |
NodeFilter.SHOW_TEXT, | |
null, | |
false | |
); | |
var node; | |
while (node = walker.nextNode()) { | |
node.nodeValue = transform(node.nodeValue); | |
} | |
})(drumpfinate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment