Not allowed to load local resource: blob:chrome-extension://...

1,516 views
Skip to first unread message

Juraj M.

unread,
Oct 25, 2022, 11:40:30 AM10/25/22
to Chromium Extensions
Inside a page, I've injected iframe and I'm using `URL.createObjectURL(blob)` to create link for a blob and then send it to the parent page, but the page refuses to load it:

Not allowed to load local resource: blob:chrome-extension://cinghknmlglhejjkhiofgojmfdcihfnb/adbf449f-0bbc-4bc3-afa7-dc46414e4b8c

I guess I need to add some wild card into the `web_accessible_resources` list but how?
I've tried these, but it won't work:
```
  "web_accessible_resources": [
    {
      "resources": [
        "*://*/*",
        "blob:*",
        "/blob:*",
        "/blob*",
        "*",
        "image_fetcher/image_fetcher.html",
        "image_fetcher/image_fetcher.js"
      ],
      "matches": [ "*://*/*" ],
      "use_dynamic_url": true
    }
  ],
```

Juraj M.

unread,
Oct 25, 2022, 2:59:22 PM10/25/22
to Chromium Extensions, Juraj M.
Never mind, I'm gonna route the images through the service worker and send it as string and display it as base64 string.
From what I can see it's lightning fast for my small images.

wOxxOm

unread,
Oct 26, 2022, 10:10:28 AM10/26/22
to Chromium Extensions, juraj....@gmail.com
If you created the blob in a chrome-extension:// script like the background script then only your content script in the parent page can load it.

Juraj M.

unread,
Oct 26, 2022, 4:29:24 PM10/26/22
to Chromium Extensions, wOxxOm
Thanks!
It's crazy what workarounds one have to do to implement such a simple thing.

Also, where is the structured clone for sending blobs? I see they were getting it ready for MV3 a year ago... and ... nothing??? :(
https://bugs.chromium.org/p/chromium/issues/detail?id=248548
Reply all
Reply to author
Forward
0 new messages