ioshtmlweb-sqloffline-cachingiphone-standalone-web-app

Do iOS offline "web apps" support javascript database / websql?


I am making a simple web application with HTML5 that uses "Javascript database" (websql as Apple now calls it) to store some HTML form entries.

When I access this app on Safari (in the iOS simulator), and use the Safari web inspector to debug it, the database is shown in the web inspector under "Resources". But when I add the app to the home screen, and then try to debug it using the Safari web inspector, the database isn't shown at all (but the others - the application cache, local storage, session storage etc. all show as usual).

Can someone tell me if there is any such limitations that iOS offline web apps (that can be added to the iPhone / iPad home screen) do not support javascript database / websql? Or if this is some kind of known bug with web inspector?

(No, I haven't coded it completely - so it would help me save some coding time if anyone can chime in and share your experience, especially if there are any other limitations with iOS web apps that developers in general should be aware of.)

(Mods P.S: Consider creating a "javascript-database" tag).


Solution

  • No, it appears that when an html page is "saved" to the home screen it is then rendered in a UIWebView - which does not support indexedDB (and I believe SQL DBs). When the page is rendered in Safari it's a WKWebView which does support indexedDB... So this is not even considered a bug.

    I've been using localStorage to get around this, but performance is a little weak, and the size is severely limited (about 2.5mb in my tests)