How to link to options page from content script?
From API:
Referring to extension files
Get the URL of an extension's file using chrome.extension.getURL(). You can use the result just like you would any other URL.
So chrome.extension.getURL("options.html");
should do the trick.
just add to manifest.json
"web_accessible_resources": ["options.html"]
and this will work from contentscript.js
window.open(chrome.extension.getURL("options.html"));
This worked for me, for opening the options as a new tab:
chrome.tabs.create({
url: "options/index.html"
})
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