Skip to content

Instantly share code, notes, and snippets.

@MikeRogers0
Created January 10, 2014 19:36
Show Gist options
  • Save MikeRogers0/8361072 to your computer and use it in GitHub Desktop.
Save MikeRogers0/8361072 to your computer and use it in GitHub Desktop.
chrome.browserAction.onClicked.addListener(function(tab) {
alert('Oh hey there! You checky clicker!');
chrome.tabs.executeScript(tab.id, {code: 'alert("I just came from the page!")'});
chrome.tabs.executeScript(tab.id, {file: 'some_file.js'});
})
{
"name": "Clicker MoBob",
"version": "1",
"manifest_version": 2,
"description": "Calls you mean thinks when you click the button",
"background": {
"scripts": ["js/objects.js","js/background.js"]
},
"default_locale": "en",
"content_security_policy": "script-src 'self'; object-src 'self';",
"permissions": [
"tabs"
],
"browser_action": {
"default_title": "Click me",
"default_icon": "imgs/icon.png"
},
"icons": {
"16": "imgs/icon.png",
"48": "imgs/icon.png",
"128": "imgs/icon.png"
},
"minimum_chrome_version": "18",
"offline_enabled": false
}
alert("I'm the file you injected.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment