Created
April 27, 2016 07:55
-
-
Save iissnan/7c37bc1a9e2fda3aa97b28b2cd61ecc7 to your computer and use it in GitHub Desktop.
Extension that Injects scripts into pages on Google Chrome
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 characters
'use strict'; | |
var s = document.createElement('script'); | |
s.src = chrome.extension.getURL('injection.js'); | |
s.onload = function() { | |
this.parentNode.removeChild(this); | |
}; | |
(document.head || document.documentElement).appendChild(s); |
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 characters
'use strict'; | |
// Do something like modifying pages. |
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 characters
{ | |
"name": "Injector", | |
"manifest_version": 2, | |
"version": "0.0.1", | |
"description": "Inject custom script into pages.", | |
"permissions": ["tabs", "http://*/*"], | |
"content_scripts" : [{ | |
"matches" : ["https://pagetoinject.com/*"], | |
"js" : ["content-script.js"] | |
}], | |
"web_accessible_resources": ["injection.js"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment