Reputation: 1078
im trying to make a chrome extension and i cant get my code to run. this is the manifest
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png"
},
"background_page": "background.html",
"permissions": [
"*://*",
"tabs"
]
}
and this is my background.html
<body>
<script>
chrome.tabs.OnCreated.addListener(function(tab){
alert("fooooooo");
});
</script>
</body>
and in the chrome debugger i get Uncaught TypeError: Cannot call method 'addListener' of undefined.
ive set the permissions correctly i think, but now i really dont know how to fix this. can anyone help?
Upvotes: 2
Views: 1859
Reputation: 111265
Instead of OnCreated
it should be onCreated
. JavaScript is case sensitive.
Upvotes: 3