How to download a file generated using a Safari Web Extension

My team is developing a web extension and we were also trying to port it to support Safari. The conversion using xcrun was pretty smooth.

However, we are not able to download a file to our disk drive, and this is only broken in Safari extension (It works across other browsers and in Safari tab too). I think the issue is that the Download Permission Popup is not appearing for the user, which I got when running the extension in a tab.

Here's a gist to help you understand more:
Code Block javascript
domtoimage
.toBlob(element)
.then(function (blob) {
const url = window.URL.createObjectURL(blob);
saveAs(url, "data.png");
});


The above code works across browsers, nothing happens when running as a Safari Web Extension

Let me know what you think!



Thanks for trying your extension in Safari. This sounds like a bug. If you have a sample extension, can you send us feedback via Feedback Assistant and attach it so we can debug? Thanks!
How to download a file generated using a Safari Web Extension
 
 
Q