I’ve searched through stackoverflow and google’s extension FAQ but could not seem to find the answer. Browser actions for my chrome extension refuse to work… Here is my code. Note: i’ve tried using background.html instead of .js – no go. It never calls linker.js.
Manifest.json
{
"name": "name",
"version": "1.0",
"background": "background.js",
"description": "test",
"permissions": ["tabs", "http://*/*", "https://*/*"],
"browser_action": {
"default_title": "Test",
"default_icon": "raindrop.png"
}
}
background.js
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(null, {file: "linker.js"});
});
linker.js
alert("linker is running");
plus more code here
Does anyone have any ideas?
Your manifest needs to be
"background_page": "background.html". Withinbackground.htmlyou need to include<script src="background.js"></script>. This will add theonClickedlistener and it looks likelinker.jsshould trigger an alert.