My Chrome extension has a content script that uses the following to inject HTML into the page:
var optionsUrl = chrome.extension.getURL("src/options/options.html");
var content = '<a href="' + optionsUrl + '" target="_blank">Options</a>';
This produces:
<a href="chrome-extension://gdocgfhmbfbbbmhnhmmejncjdcbjkhfc/src/options/options.html" target="_blank">Options</a>
When I click the link, it opens a new browser tab and nothing more.
If I paste the href attribute chrome-extension://gdocgfhmbfbbbmhnhmmejncjdcbjkhfc/src/options/options.html
into the address bar, I see the options page for my Chrome extension displayed correctly.
In the manifest file insert:
"web_accessible_resources": ["src/options/options.html"],
more info see documentation.
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