Chrome Extension: Permissions to manipulate content of data URIs

南楼画角 提交于 2019-12-21 09:15:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!