[Webkit-unassigned] [Bug 226440] New: Blob url downloads fail when triggered from webextension
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun May 30 16:59:22 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=226440
Bug ID: 226440
Summary: Blob url downloads fail when triggered from
webextension
Product: WebKit
Version: Safari 14
Hardware: Mac (Apple Silicon)
OS: macOS 11
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit Misc.
Assignee: webkit-unassigned at lists.webkit.org
Reporter: victorhlin at gmail.com
Blob url downloads fail when triggered from a webextension tab. The tab is created with `chrome.tabs.create({ url: /wordlist.html })`. wordlist.html embeds a script with the following code to trigger downloads when clicking on a button:
```
let saveBlob = new Blob(['content'], { "type": "text/plain" });
let a = document.getElementById('savelink'); // tab html contains "<a id="savelink" download="download.txt"></a>"
const blobLink = URL.createObjectURL(saveBlob);
a.href = blobLink;
a.click();
```
This opens in the existing tab (replacing its content) and fails with the following safari error:
```
Safari can’t open the page “blob:safari-web-extension://20101d16-cc55-4a3f-a307-a03b6e2df273/07f5a98e-8fbd-409e-9113-58afe3c748c8”.
The error is: “The operation couldn’t be completed. (WebKitBlobResource error 1.)” (WebKitBlobResource:1)
```
I found some related bugs on non-extension pages, e.g https://bugs.webkit.org/show_bug.cgi?id=190351 (usage of target="_blank"), https://bugs.webkit.org/show_bug.cgi?id=211234 (bugs with immediately revoked object urls) , The presence of the `target` attribute doesn't seem to matter, and it seems like whatever was fixed in the latter bug doesn't apply to this extension tab case.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210530/63349b2a/attachment-0001.htm>
More information about the webkit-unassigned
mailing list