Monday, May 20, 2024
174
rated 0 times [  179] [ 5]  / answers: 1 / hits: 36969  / 11 Years ago, wed, march 27, 2013, 12:00:00

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


More From » google-chrome-extension

 Answers
204

If this wasn't a Chrome extension, you could add 'unsafe-inline' to the list of acceptable places to load scripts from, but you should avoid using inline event handlers at all.



Replace (in the HTML):



onload = loadHandler()


with (in the script):



window.addEventListener('load', loadHandler);

[#79313] Tuesday, March 26, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dequant

Total Points: 88
Total Questions: 99
Total Answers: 95

Location: Ukraine
Member since Sun, Dec 13, 2020
4 Years ago
dequant questions
;