Bug 198278
| Summary: | Cannot store blobs in IndexedDB on iOS in Private Browsing mode | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | jordan.michael.last |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ap, beidson, cdumez, ggaren, sihui_liu, youennf |
| Priority: | P2 | ||
| Version: | Safari 12 | ||
| Hardware: | iPhone / iPad | ||
| OS: | Unspecified | ||
jordan.michael.last
As far as I know you cannot store blobs in IndexedDB on iOS. It would be nice to have this feature. One good thing about blobs is that they store their mime type with them, and require fewer steps from database to use after being stored.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Chris Dumez
Do you have a test page that reproduces this issue? What sort of error are you getting?
jordan.michael.last
Here is the live test page: https://lastmjs.github.io/safari-blob-indexed-db-test
The code is found here: https://github.com/lastmjs/safari-blob-indexed-db-test
All the test page does is fetch an mp3 file and try to store the blob in IndexedDB. I've set a console.log and an alert for the error. All the alert says is "null". I'm not sure how to see what the console.log says. I have limited access to iOS devices.
jordan.michael.last
Sorry, the test page fetches the audio file, tries to store the blob in IndexedDB, then tries to retrieve the file and set the src of the audio element to the object url created from window.URL.createObjectURL. If the example is successful, you should be able to click play on the audio element and hear Alexander Graham Bell's voice.
jordan.michael.last
It looks like the iOS device I was testing on is on iOS version 12.0.1. I tested it on another phone with version 12.2, and the test page works. I'll do some more testing and report back. It would be nice if someone could independently reproduce my results.
Chris Dumez
The bug does not reproduce for me on iOS 12.4 beta. This likely has been fixed already?
jordan.michael.last
Seems likely, I've tested it on two 12.2 devices now and it works.
jordan.michael.last
I've done some more testing:
12.2 works fine
12.3 works fine
12.3.1 does not work with an explicit error: DataCloneError: Failed to store record in an IDBObjectStore: BlobURLs are not yet supported.
The behavior seems inconsistent across versions, and Chris you say it's working on 12.4 beta? Is there any way to get a confirmation that it is indeed fixed in 12.4 and will continue to be supported thereafter, officially?
Chris Dumez
I have just confirmed that the test page (https://lastmjs.github.io/safari-blob-indexed-db-test) works as expected on iOS 13 beta 1.
jordan.michael.last
Thanks for everything!
jordan.michael.last
So I'm not so sure this is fixed. I went to an Apple store to test downloads on https://podcrypt.app, and I started getting the same exact error again. This was yesterday. I tested on multiple devices and all were on iOS 12.4 (16G77), and all failed with the "DataCloneError: Failed to store record in an IDBObjectStore: BlobURLs are not yet supported."
I have access to another device at home with iOS 12.4 (16G77), and the error does not throw. What's going on here? I'm not confident iOS 13 has this fixed since some versions seem to work, some don't, and even the same version on different devices are not consistent in their behavior.
jordan.michael.last
I think I know my issue...the devices at the Apple store are set to private mode by default, and private mode does not have support for IndexedDB blobs. So, non-private mode definitely works in 12.4