Due to recent changes in the Chrome API, my plugin issues this error:
Error during tabs.executeScript: Cannot access contents of url "chrome-extension://ecfgljdfndkhhbmhcnelbpnhkflgiokp/cm_signature_editor.html". Extension manifest must request permission to access this host.
This never used to be the case. Now I wonder how I get the URL of the chrome extension into it's manifest file:
I know I can get the url or a resource within my extension like so:
chrome.extension.getURL('/manifest.json')
But I don't know how that can work in the manifest file.
Is there another way to get this code working?
chrome.tabs.executeScript(null, {code:function_to_execute}, function() {
// callback
});
What's interesting is that even when I hardcode the chrome URL it doesn't work (I get the same error)
"permissions" : [
"tabs",
"contextMenus",
"chrome-extension://ecfgljdfndkhhbmhcnelbpnhkflgiokp/*"
],
I think you cant inject a script in a extension page in that way. You should incorporate the script in the page just by writing it in you extension HTML file. And make comunications between extension pages using chrome.extension.sendRequest and chrome.extension.onRequest
Using chrome.extension.getViews()
may be helpful.
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