chrome.tabs.executeScript into dataURI tab

563 Views Asked by At

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....

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

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.