Skip to content

Instantly share code, notes, and snippets.

@at1as
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save at1as/11f72dad884b3f94e616 to your computer and use it in GitHub Desktop.
Save at1as/11f72dad884b3f94e616 to your computer and use it in GitHub Desktop.
Federal Election Deobfuscater
/* Paste into your browser console to replace all instances in FaceBook of big 3 Canadian political parties
with "Big Government Party" and their leaders with "Big Government Politician" */
function traverseDOM(node, func) {
func(node);
node = node.firstChild;
while (node) {
traverseDOM(node, func);
node = node.nextSibling;
}
}
traverseDOM(document.body, function(node) {
if (node.tagName == "P" || node.tagName == "SPAN") {
node.innerHTML = node.innerHTML.replace(/NDP/gi, "Big Government Party").replace(/Liberals?/gi, "Big Government Party").replace(/Conservatives?/gi, "Big Government Party").replace(/Trudeau/gi, "Big Government Politician").replace(/Mulcair/gi, "Big Government Politician").replace(/Harper/gi, "Big Government Politician");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment