Setting the value of 'dataURL' exceeded the quota
When your browser reaches to maximum limit it will throw this errorFailed to execute 'setItem' on 'Storage': Setting the value of '' exceeded the quota.
- You can handle it like this
try { var count = 100; var message = "LocalStorageIsNOTFull"; for (var i = 0; i <= count; count + 250) { message += message; localStorage.setItem("stringData", message); console.log(localStorage); console.log(count); } } catch (e) { console.log("Local Storage is full, Please empty data"); // fires When localstorage gets full // you can handle error here or empty the local storage }
the chrome local storage default is 25M, so clear your chrome's local storage will be work it. good luck!
Clearing the local storage with localStorage.clear();
worked for me.
If you're on Firefox you may need to use window.localStorage.clear();