share
Stack OverflowWhich browsers support html5 offline storage?
[+63] [12] Marcin
[2009-07-28 15:08:53]
[ javascript html5 localstorage offline ]
[ http://stackoverflow.com/questions/1194784] [DELETED]

Essentially, I wanted to run a piece of demo code from W3c Offline Webapps [1] page. It looks like that:

 var db = window.openDatabase("notes", "", "The Example Notes App!", 1048576);

Firefox 3.5, IE8 and Chrome do not seem to get it. Is there anybody out there that actually wrote support for that? Or is this wishful thinking about 'the standard of the future'?

(2) Voting to close this question as it is now almost 2.5 years old, and that means it is incredibly out of date in regards to HTML5 features. - slugster
(1) FOr a more up-to-date (and more ontopic) place to see the answer to this question, please see: caniuse.com - jjnguy
[+172] [2009-07-28 17:43:35] brianng [ACCEPTED]

Wikipedia has a table comparing the various browser engines and what portions of HTML5 they support [1].

A reposted internal Yahoo! article [2] also details some differences between localstorage support, to quote:

Firefox 3.5, Safari 4, IE8, Chrome 4+: HTML5 localStorage [3]; these modern browsers all support the core localStorage functionality defined in the HTML5 draft.

Firefox 2.x and 3.0: Gecko globalStorage [4], a very early implementation similar to HTML5’s localStorage.

Safari 3.1 & 3.2: HTML5 Database Storage [5], because Safari 3.1 and 3.2 don’t support HTML5 localStorage.

IE6, IE7: userData persistence [6], a rarely used IE feature for associating string data with an element on a web page and persisting it between pageviews.

Google Chrome Pre 4: Gears Database API [7], which is built into earlier versions of Chrome and thus doesn’t require a separate install.

[1] http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML_5%29#APIs
[2] http://wonko.com/post/search-pad-browser-storage
[3] http://dev.w3.org/html5/webstorage/
[4] https://developer.mozilla.org/en/DOM/Storage
[5] http://developer.apple.com/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introduction.html
[6] http://msdn.microsoft.com/en-us/library/ms531424%28VS.85%29.aspx
[7] http://code.google.com/apis/gears/upcoming/api_database.html

(2) +1 for a good answer with many sources. - statenjason
(1) Thanks for very extensive answer! - Marcin
There's another answer below but I wanted to add that Chrome 4 and 5 support local HTML5 local storage. The Developer Tools also allow you to inspect locally stored objects. - pnewhook
1
[+20] [2009-07-28 17:39:45] Ambirex

I believe Safari 3.1 supports openDatabase.

You should check out the PersistJS [1] library, which provides in interface to all the different offline storage capabilities of the different browsers and plugins. It currently supports:

  • flash: Flash 8 persistent storage.
  • gears: Google Gears-based persistent storage.
  • localstorage: HTML5 draft storage.
  • whatwg_db: HTML5 draft database storage.
  • globalstorage: HTML5 draft storage (old spec).
  • ie: Internet Explorer userdata behaviors.
  • cookie: Cookie-based persistent storage.
[1] http://pablotron.org/?cid=1557

2
[+5] [2010-02-16 09:42:54] Sebastien Lorber

Chrome 4 & 5 support localStorage :)


3
[+4] [2010-06-16 11:17:36] Lloyd

Opera 10.53 supports it.


4
[+3] [2011-03-11 13:10:20] dimitrisp

Check out the caniuse [1] guide which provides information for future versions as well. It also includes mobile browsers.

[1] http://caniuse.com/

5
[+1] [2011-02-21 15:46:43] Michael Muryn

There is also YUI Storage Lite: http://yuilibrary.com/gallery/show/storage-lite It has a good compatibility (IE6+, Firefox 2+, Chrome 4+, Opera 10.5+, Safari 3.1+, etc.) and no browser plugins are required.


6
[0] [2011-04-30 13:48:44] Geo

You can always check if a browser support this feature with window['openDatabase'] !== null;

More info on:

http://geoffrey.vandiest.biz/post/2011/04/30/HTML5-Local-Storage.aspx


7
[0] [2009-07-28 15:13:36] thedz

AFAIK, WebKit supports it.


(3) Some references would be nice. - Ionuț G. Stan
8
[0] [2009-07-28 18:59:45] olliej

WebKit (as used by Safari and WebKit/gtk at least) supports localStorage, sessionStorage, client-side databases and the application cache. Other WebKit ports (WebKit/qt, WebKit/wx, Chrome, etc) haven't yet turned on support :-(


(1) Is that true of both the mainline and beta line of Chrome? - Nosredna
9
[0] [2009-08-07 15:48:51] aehlke

The iPhone version of Safari has rather good support for HTML5, including offline storage.


10
[0] [2011-11-28 20:41:00] Pete Brumm

lawnchair is a newer and more actively supported library.

It provides adapters to enable older browsers and stores json objects

http://westcoastlogic.com/lawnchair/

It even has a nice test suite so you can verify support in your browser easily

http://westcoastlogic.com/lawnchair/tests/


11
[-1] [2011-07-16 06:42:21] Bhavesh

Below list gives information on supporting browsers for offline functionality:

  1. IE: Not supported
  2. FF: 3.5+
  3. Safari: 4.0+
  4. Chrome: 5.0+
  5. Opera: 10.6+

Consider adding some references to this answer. - NullUserException
12