问题
I am working on a Chrome extension that needs to inject scripts into data:-URI pages.
When trying to execute the javascript I get an exception:
Error during tabs.executeScript: Cannot access contents of url "data:text/html;charset=utf-8, … ". Extension manifest must request permission to access this host.
But which permission would work for me? I tried data:*
, <all_urls>
, *://*/*
- none of these worked. Also the activeTab
permission did not do the trick. Any ideas?
回答1:
It's currently a chromium bug that extensions cannot work on data URIs. A fix is going in that will rectify this, hopefully landing in Chrome 66.
来源:https://stackoverflow.com/questions/15461142/chrome-extension-permissions-to-manipulate-content-of-data-uris