chrome.tabs.executeScript into dataURI tab

*爱你&永不变心* 提交于 2019-11-28 08:56:32

问题


Question is very simple (to ask)
Is there any way to inject script into tab containing only image
and have URL in form of:
data:image/png;base64,iVBORw0K....

console gives me error:
Cannot access contents of url "data:image/png;base64,iVBORw0K....


回答1:


Looks like the answer is "no". data: URIs are not supported by permissions.

Even "activeTab" or "<all_urls>" permission does not grant the required rights.

A glance on the Chromium bug tracker did not find an existing feature request for that - you may try your luck.




回答2:


Agreeing with Xan, it's 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/31051387/chrome-tabs-executescript-into-datauri-tab

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