I just realized that the `download` attribute doesn't work with blob: URLs in WKWebView. In contrast, data: URLs work there. Is this on purpose? Both methods work correctly in Safari itself. Here's a small demo: https://wkwebview-download.glitch.me/.
<rdar://problem/69496802>
*** Bug 220461 has been marked as a duplicate of this bug. ***
Hello i have similar problem (IPad,Mac) on Chrome mac working ipad not. When i store files in indexDB(for offline) as blob. Then i want to open them in browser as new tab.Its not working shows only info WebKitBlobResource error 1. I try window.open(blob), also in js create and click and its not works in any browser. Any solution for this problem ?
This issue creates webcompat issues for Firefox on iOS. * https://github.com/webcompat/web-bugs/issues/75388 * https://github.com/webcompat/web-bugs/issues/75965 That would be great to fix it.
We really miss this feature. It's a shame that Safari is always a step behind other browsers.
The same bug is now in the main Safari.
Any plans to fix this? The issue is getting worse as there are not really good scripts for saving files across different browsers, like https://github.com/eligrey/FileSaver.js/blob/master/src/FileSaver.js#L146-L147
When I try <a download=test>test</a><script> document.querySelector("a").href = URL.createObjectURL(new Blob()); </script> on macOS and iOS Safari it downloads as expected. https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Ca%20download%3Dtest%3Etest%3C%2Fa%3E%3Cscript%3E%0Adocument.querySelector(%22a%22).href%20%3D%20URL.createObjectURL(new%20Blob())%3B%0A%3C%2Fscript%3E What are the steps to reproduce?
The problem occurred in `WKWebView`-based browsers like Chrome on iOS. I just tested on 17.3 beta, and it worked just fine. I'm marking this as RESOLVED. Not sure when this started working, but it does… :-)
CONFIGURATION CHANGED is used when it's unclear where the fix happened. And note that comment 6 implied the problem was universal, though maybe it was at the time.
Created attachment 469545 [details] screenshot
The file is detected as Unknown and is not saved correctly.
(In reply to Anne van Kesteren from comment #8) > When I try > > <a download=test>test</a><script> > document.querySelector("a").href = URL.createObjectURL(new Blob()); > </script> > > on macOS and iOS Safari it downloads as expected. > > https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C! > DOCTYPE%20html%3E%0A... > %3Ca%20download%3Dtest%3Etest%3C%2Fa%3E%3Cscript%3E%0Adocument. > querySelector(%22a%22).href%20%3D%20URL. > createObjectURL(new%20Blob())%3B%0A%3C%2Fscript%3E > > What are the steps to reproduce? Unfortunately, the problem is still relevant. You can reproduce the problem in the Firefox browser on iOS with your example. When I click on the link, a save file dialog box appears, but the file is detected as Unknown and is not saved correctly. https://prnt.sc/pusMQfiLEgWz I set the Download attribute in the tag and in the code, but it doesn't work. The file is still defined as Annone. However, the problem is not observed in Safari and Chrome.
Chrome on iOS and Firefox on iOS are basically using the same thing. So if there is a difference something is happening elsewhere. It would be interesting to understand why there is a difference. Note that Firefox iOS has a specific repo for their own issue. https://github.com/mozilla-mobile/firefox-ios/issues