Manifest version 2 Content Security Policy do not let extension to run inline script. That mean I can’t use
<script>Code Here</script>
<button onclick="And here">
When I used manifest version 1 my popup.html executed some code on it’s load ether this way:
<body onload='init()'>
or like this
<script>init()</script>
Now I can see the only way – to put a button inside popup.html and press it manually to do the initialisation. What am I getting wrong ?
Creat a popup.js file, and extract your scripts into this file, and add listener like this:
Then include the popup.js file into the popup.html file.