-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ey Pacha!
committed
Oct 20, 2016
1 parent
ce6d359
commit 97bd018
Showing
6 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// this is the code which will be injected into a given page... | ||
var elements = document.getElementsByTagName('*'); | ||
|
||
for (var i = 0; i < elements.length; i++) { | ||
var element = elements[i]; | ||
|
||
for (var j = 0; j < element.childNodes.length; j++) { | ||
var node = element.childNodes[j]; | ||
|
||
if (node.nodeType === 3) { | ||
var text = node.nodeValue; | ||
var replacedText = text.replace(/(Mauri(cio)? )?Macri(?! Gato)/g,'Macri Gato'); | ||
|
||
if (replacedText !== text) { | ||
element.replaceChild(document.createTextNode(replacedText), node); | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "Macri Gato", | ||
"version": "1.0", | ||
"manifest_version": 2, | ||
"description": "Cambia “Mauricio Macri” por “Macri Gato” cada vez que aparece.", | ||
"homepage_url": "http://eypacha.com.ar", | ||
"icons": { | ||
"16": "icon16.png", | ||
"48": "icon48.png", | ||
"128": "icon128.png" }, | ||
"content_scripts": [ { | ||
"js": [ "inject.js" ], | ||
"matches": [ "*://*/*" ], | ||
"run_at": "document_end" | ||
} ] | ||
} |