Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make persistent data optional #115

Open
btzr-io opened this issue Apr 2, 2018 · 2 comments
Open

Make persistent data optional #115

btzr-io opened this issue Apr 2, 2018 · 2 comments

Comments

@btzr-io
Copy link
Contributor

btzr-io commented Apr 2, 2018

If I disable cookies on chrome ( android ) I just see a blank page, but there are no errors / warnings.
We could add a fall back to make store data optional.
http://crocodillon.com/blog/always-catch-localstorage-security-and-quota-exceeded-errors

@btzr-io
Copy link
Contributor Author

btzr-io commented Apr 2, 2018

Access denied

try {
  localStorage = window.localStorage;
} catch(e) {
  // Access denied :-(
}

Full storage

try {
  localStorage.setItem(key, value);
} catch(e) {
  if (e.code == 22) {
    // Storage full, maybe notify user or do some clean-up
  }
}

@workhorsy
Copy link
Owner

This is a good idea. At a minimum we should show a warning that it wont work if cookies are disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants