Revisions
-
jmeyo revised this gist
Mar 2, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ { "name": "Victor", "version": "0.0.1", "manifest_version": 2, "description": "Injecting stuff", "homepage_url": "http://www.houseofagile.com", "background": { "scripts": [ "background.js" -
jmeyo revised this gist
Mar 1, 2016 . 1 changed file with 42 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,49 @@ // this is the code which will be injected into a given page... (function() { walk(document.body); function walk(node) { // I stole this function from here: // http://is.gd/mwZp7E var child, next; if (node.tagName.toLowerCase() == 'input' || node.tagName.toLowerCase() == 'textarea' || node.classList.indexOf('ace_editor') > -1) { return; } switch ( node.nodeType ) { case 1: // Element case 9: // Document case 11: // Document fragment child = node.firstChild; while ( child ) { next = child.nextSibling; walk(child); child = next; } break; case 3: // Text node handleText(node); break; } } function handleText(textNode) { var v = textNode.nodeValue; v = v.replace(/\bTrump\b/g, "Drumpf"); textNode.nodeValue = v; } })(); -
danharper revised this gist
Jan 10, 2014 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ // listen for our browerAction to be clicked chrome.browserAction.onClicked.addListener(function (tab) { // for the current tab, inject the "inject.js" file & execute it chrome.tabs.executeScript(tab.ib, { file: 'inject.js' }); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ (function() { // just place a div at top right var div = document.createElement('div'); div.style.position = 'fixed'; div.style.top = 0; -
danharper created this gist
Jan 10, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ // this is the background code... // listen for our browerAction to be clicked chrome.browserAction.onClicked.addListener(function (tab) { // for the current tab, inject the "inject.js" file & execute it chrome.tabs.executeScript(tab.ib, { file: 'inject.js' }); }); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // this is the code which will be injected into a given page... (function() { // just place a div at top right var div = document.createElement('div'); div.style.position = 'fixed'; div.style.top = 0; div.style.right = 0; div.textContent = 'Injected!'; document.body.appendChild(div); alert('inserted self... giggity'); })(); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ { "name": "Injecta", "version": "0.0.1", "manifest_version": 2, "description": "Injecting stuff", "homepage_url": "http://danharper.me", "background": { "scripts": [ "background.js" ], "persistent": true }, "browser_action": { "default_title": "Inject!" }, "permissions": [ "https://*/*", "http://*/*", "tabs" ] }