Monday 8 April 2019

javascript - LocalStorage quota exceeded (dom error 22) on iOS, but private mode not set

I'm trying to store a .json file in iOS localStorage. The file is 3.4mb uncompressed.




When I try to store it, mobile Sarari rejects it with a DOM error 22: "An attempt was made to add something to storage that exceeded the quota".



This doesn't happen when I test my app in Chrome, but it does happen in desktop Safari. It seems Chrome automatically ups the quota to 10mb, whereas mobile Safari and desktop Safari do not and just fail.



Why does storing a 3.4mb json file cause this error when the storage quota for iOS / Safari is 5mb?



Should also note that I have checked to see if private mode is enabled, and made sure it is not.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...