Skip to content

gkucmierz/Test-of-localStorage-limits-quota

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Test-of-localStorage-limits-quota

Test of localStorage limits/quota using bisection algorithm

I wrote this simple code that is testing localStorage size in bytes.

const check = words => {
  try {
    localStorage.clear();
    localStorage.setItem('a', '0'.repeat(words));
    localStorage.clear();
    return true;
  } catch(e) {
    localStorage.clear();
    return false;
  }
};

Github pages:

https://gkucmierz.github.io/Test-of-localStorage-limits-quota/

I have the same results on desktop chrome, opera, firefox, brave and mobile chrome which is ~5Mbytes

enter image description here

And half smaller result in safari ~2Mbytes

enter image description here

About

Test of localStorage limits/quota using bisection algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published