A way to know if localStorage is full or not

'Cause they are variations about the capacity of localStorage, but, i think is easier to create a method to know if localStorage.isFull() or something like

1 Like

You can already get an estimate of the storage usage & quota: https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate

I’m not sure if that applies to localStorage, but it definitely covers modern APIs like IndexedDB.

On a related matter, there doesn’t seem to be any good way to test the kinds of failures you get when storage is full. I filed a Chrome bug for that: https://bugs.chromium.org/p/chromium/issues/detail?id=706806

1 Like

Thank you! :slight_smile: