RESOLVED FIXED 153783
Modern IDB: Make sure IndexedDB works from file:// url documents by default
https://bugs.webkit.org/show_bug.cgi?id=153783
Summary Modern IDB: Make sure IndexedDB works from file:// url documents by default
Darryl Pogue
Reported 2016-02-01 20:26:44 PST
Created attachment 270465 [details] Test Case to be served from file:/// Calling indexedDB.open from a file:/// URL results in an InvalidAccessError being thrown. With the removal of WebSQL, this means that local applications served via file:/// URLs have no access to data storage beyond localStorage. The attached test file should print "Success". In Webkit, it prints "Error: InvalidAccessError".
Attachments
Test Case to be served from file:/// (567 bytes, text/html)
2016-02-01 20:26 PST, Darryl Pogue
no flags
Patch (7.22 KB, patch)
2016-07-25 14:13 PDT, Brady Eidson
no flags
Brady Eidson
Comment 1 2016-02-01 22:08:02 PST
(In reply to comment #0) > Created attachment 270465 [details] > Test Case to be served from file:/// > > Calling indexedDB.open from a file:/// URL results in an InvalidAccessError > being thrown. Yup, WebIDBFactoryBackend::open fails to make a database identifier for the file: opening origin and top origin. This is because Safari ramps up the (don't)AllowFileAccessFromFileURLs restriction on file: url documents. > With the removal of WebSQL, this means that local applications > served via file:/// URLs have no access to data storage beyond localStorage. WebSQL has most certainly not been removed... works great in my testing, both http and file URLs. Why do you think WebSQL has been removed?
Brady Eidson
Comment 2 2016-02-01 22:17:07 PST
(In reply to comment #1) > (In reply to comment #0) > > Created attachment 270465 [details] > > Test Case to be served from file:/// > > > > Calling indexedDB.open from a file:/// URL results in an InvalidAccessError > > being thrown. > > Yup, WebIDBFactoryBackend::open fails to make a database identifier for the > file: opening origin and top origin. > > This is because Safari ramps up the (don't)AllowFileAccessFromFileURLs > restriction on file: url documents. It's actually the default in WebKit. NM!
Brady Eidson
Comment 3 2016-02-01 22:17:50 PST
This should work in Safari for devs. Once Modern IDB gets its WK2 support (soon!), we'll make sure it works there by default.
Darryl Pogue
Comment 4 2016-02-01 23:00:03 PST
(In reply to comment #1) > (In reply to comment #0) > > With the removal of WebSQL, this means that local applications > > served via file:/// URLs have no access to data storage beyond localStorage. > > WebSQL has most certainly not been removed... works great in my testing, > both http and file URLs. > > Why do you think WebSQL has been removed? I believe WebSQL is not available in WKWebView on iOS (regardless of origin)
Brady Eidson
Comment 5 2016-02-02 09:02:56 PST
(In reply to comment #4) > (In reply to comment #1) > > (In reply to comment #0) > > > With the removal of WebSQL, this means that local applications > > > served via file:/// URLs have no access to data storage beyond localStorage. > > > > WebSQL has most certainly not been removed... works great in my testing, > > both http and file URLs. > > > > Why do you think WebSQL has been removed? > > I believe WebSQL is not available in WKWebView on iOS (regardless of origin) Aha, nothing in the bug report suggested you were talking iOS! WebSQL not working in WKWebView on iOS is a completely separate issue and will be resolved separately. Could you file a separate bug for that? I know we have a radar but piling on the dupe count from bugzilla will help.
Brady Eidson
Comment 6 2016-07-25 14:09:37 PDT
As of https://trac.webkit.org/changeset/203695 this works. I'll be making API test changes to make sure it continues working.
Brady Eidson
Comment 7 2016-07-25 14:13:09 PDT
WebKit Commit Bot
Comment 8 2016-07-25 14:39:47 PDT
Comment on attachment 284523 [details] Patch Clearing flags on attachment: 284523 Committed r203700: <http://trac.webkit.org/changeset/203700>
WebKit Commit Bot
Comment 9 2016-07-25 14:39:50 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.