Reputation: 1924
The main idea is to put a website inside the extension, this website has scripts, but they are not running. All of the links are relative, even the options page scripts are not working.
<script>
alert("a");
</script>
Am I missing something in the manifest.json
file?
{
"manifest_version": 2,
"name": "Extension",
"description": "This is an extension.",
"version": "1.0",
"background": {
"scripts": ["background.js"]
},
"permissions": ["tabs" , "contextMenus"],
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["./website/scripts/JvScripts.js"]
}
],
"options_page": "options.html"
}
Upvotes: 1
Views: 1808
Reputation: 176
Endeavor to remove the script tag from your javascript file. I do believe that would help
Upvotes: 0
Reputation: 66500
Your script should run fine. I have just set up a similar one on github.
On the option_page
you have to link to the script you want to run in the html, it does not get injected. This is due to security.
In your options.html
you will have to add:
<script src="relative/path/to/your/options.js"></script>
Do not forget to reload your extension every time you make a change to your script.
For simple changes you might find extension reloader useful, only bear in mind that you have to reload manually from the extension setting page when your manifest.json
changes.
Upvotes: 1