问题
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