Skip to content

Commit

Permalink
Replace innerHTML method with the ugly code because of security requi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishanth Vijayan committed Mar 2, 2016
1 parent a49ec3d commit a6a0ea9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion data/replacer.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
document.body.innerHTML = document.body.innerHTML.replace(/trump/g, 'drumpf').replace(/Trump/g, 'Drumpf');
var textNode, walk=document.createTreeWalker(document,NodeFilter.SHOW_TEXT,null,false);
while(textNode=walk.nextNode()) {
textNode.nodeValue = textNode.nodeValue.replace(/trump/g, 'drumpf').replace(/Trump/g, 'Drumpf');
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Drumpfinator",
"name": "Drumpfinator",
"version": "0.0.1",
"title": "Drumpfinator Make Trump Drumpf Again",
"name": "drumpfinator_trump",
"version": "0.0.2",
"description": "Add this to your browser and replace all instances of Trump with Drumpf.",
"main": "index.js",
"author": "Nishanth Vijayan",
Expand Down

0 comments on commit a6a0ea9

Please sign in to comment.