I am trying to create chrome extention, however my browser action click does not work! I've tried pretty much everything. Here is my setup:
manifest.json:
{
"name": "blah",
"version": "1.0",
"description": "blah",
"browser_action": {
"default_icon": "icon1.png",
"popup": "popup.html"
},
"permissions": [
"bookmarks",
"tabs",
"http://*/*",
"https://*/*"
],
"background_page": "background.html"
}
popup.html:
<html>
<head>
<script>
<!-- Try adding the listener in popup.html -->
chrome.browserAction.onClicked.addListener( function(tab){
console.log("Hello from popup"); // This does not show up either
} );
</script>
</head><body>
Hello
</body>
</html>
background.html:
<html>
<head>
<script>
console.log("Background.html"); // This gets displayed. O.K.
function hello() {
console.log("HELLO"); // THIS NEVER GETS DISPLAYED
}
// Supposed to Called when the user clicks on the browser action icon.
chrome.browserAction.onClicked.addListener(hello);
</script>
</head>
</html>
But no matter how hard i click on the Icon nothing happens and "HELLO" is not printed out in the console! I am using Chrome 4.0.249.43. I installed the Beta version BUT it is exactly the same as the released version (same verion number). Could that be a problem?
Any help appreciated.