Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is anyone else receiving a QUOTA_EXCEEDED_ERR on their iPad when accessing localStorage?

I have a web application written in JavaScript that runs successfully on the desktop via Safari as well as on the iPhone.

We are looking at porting this application to the iPad and we are running into a problem where we are seeing QUOTA_EXCEEDED_ERR when storing a relatively small amount of data within the localStorage on the device. I know what this error means, but I just don't think I'm storing all that much data.

Is anyone else doing something similar? And seeing/not seeing this problem?

Kevin...

like image 733
Kevin Avatar asked Apr 08 '10 21:04

Kevin


3 Answers

I had the same problem and it seems like removing the key before setting it solved it.

function setkey(key, val){
  sessionStorage.removeItem(key);
  sessionStorage.setItem(key, val);
}
like image 130
kioopi Avatar answered Oct 25 '22 10:10

kioopi


it's not a bug, the user can go to the settings of there iphone and then choose safari. there is a option to set private brouwsing. default is on so storage works but some disable it. so you should create a message in your app telling theme to enable it.

like image 35
mike Avatar answered Oct 25 '22 10:10

mike


If you use the way removing storage data before set it - it would be very slow in some browsers. Removing data is 1.5 times slower than set it (strings about 50 signs). Tried on FF 3.6 (Ubuntu) - browser works very slow with SqlLite. So, do this hack only for iPad devices.

like image 3
SAHbKA Avatar answered Oct 25 '22 11:10

SAHbKA