Skip to content

Commit

Permalink
version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ey Pacha! committed Oct 20, 2016
1 parent ce6d359 commit 97bd018
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
Binary file added icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions inject.js
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 added macri-gato.zip
Binary file not shown.
16 changes: 16 additions & 0 deletions manifest.json
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"
} ]
}

0 comments on commit 97bd018

Please sign in to comment.