LocalForage – An asynchronous data store with a simple, localStorage-like API
mozilla.github.io
mozilla.github.io
My question then, as now: why not standardize an API like this? Mozilla obviously spends a great deal of time thinking about and advocating for the future of the web, so I imagine they've thought about it.
A polyfill for a new API implementation + feedback + people using it is probably the right path to take towards standardising.
eg. If no one uses this much, dont bother. If lots of people do, push for it as a standard.
IOS8 brings indexeddb to ipads; at that point it pretty much runs everywhere, just use indexeddb.
Its a pretty decent async API which supports reasonably complex queries (better than get-by-key like this), and has a (basic but working) node implementation to run unit tests against. (see http://caniuse.com/indexeddb)
Why would you use this primitive api?
Supporting older browsers is great and all, but if you dont get anything over it except giant cookies, why bother?
So if you want to actually reach the majority of mobile users at this point, IndexedDB is not yet the way to go.
I have no idea how many people use "Android browser" versus Chrome; Google is certainly pushing for higher mobile Chrome adoption. -- Okay, http://www.netmarketshare.com/ seems to indicate that Android browser market is pretty much split two-thirds Android browser, one-thirds Chrome. No idea how reliable their dataset is.
Even with iOS 8's support for IndexedDB, there are edge cases in different browsers localForage handles, and it handles storage of Blob data and TypedArrays transparently too, which is handy.
Edit: it would be nice if the documentation mentioned the promise support.
I had a few folks mention this in the early stages of library development but it hasn't come up since.