I'm newbie in google chrome extention delveopment. I'm trying to develop a simple extension and i keep getting the error above.
my manifest:
{
"name": "set my favourties",
"description" : "just another super awesome plugin",
"version" : "0.1",
"background": {
"page": "backround.html"
},
"manifest_version": 2,
"content_security_policy": "script-src 'self' https://www.google.com; object-src 'self'",
"browser_action" :{
"popup" : "popup.html",
"default_icon" : "icon.gif"
},
"permissions" : ["notifications"]
}
the html code:
<html>
<head>
<script src = "backround.js">
</script>
</head>
<body onload = "loadHandler()">
</body>
</html>
and the js:
function loadHandler(){
window.webkitNotifications.createNotification("icon.gif","Plugin Loaded","it was loaded").show();
}
thanks in advance
Nir
If this wasn't a Chrome extension, you could add but you should avoid using inline event handlers at all.'unsafe-inline'
to the list of acceptable places to load scripts from,
Replace (in the HTML):
onload = "loadHandler()"
with (in the script):
window.addEventListener('load', loadHandler);
Correct. This is documented here: http://developer.chrome.com/extensions/tut_migration_to_manifest_v2.html#inline_scripts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With