0

While running HTML5 app I have ran into QUOTA_EXCEEDED_ERR exception. After some investigation it has become clear that

(errors were discovered from debug console)

1) every site which tries to use localStorage.setItem experiences same problem (I tested some sites like gmail etc)

2) another proof that Safari has some problems with localStorage/QUOTA is seen when browser tries to load JS file which size is 81Kb (little bigger than average). This causes "Parser error" exception and it feels like Safari doesn't fully load it

iOS version is 5.0.1 (iPad2 hardware)

What can cause this localStorage problem?

duganets
  • 1,853
  • 5
  • 20
  • 31
  • 1
    possible duplicate of [html5 localStorage error with Safari: "QUOTA\_EXCEEDED\_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota."](http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-safari-quota-exceeded-err-dom-exception-22-an) – KingKongFrog Jan 09 '14 at 17:57

1 Answers1

4

I have found out the reason of such a strange Safari's behavior: private browsing mode. Every app that uses localStorage should check window['localStorage'].setItem for rising exception before using it.

duganets
  • 1,853
  • 5
  • 20
  • 31
  • 1
    +1 I have also found this. It appears private browsing blocks any site from storing data. – Mike Mar 04 '12 at 10:42