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

Usage in Private Browsing mode #170

Open
jonscottclark opened this issue Jul 19, 2016 · 1 comment
Open

Usage in Private Browsing mode #170

jonscottclark opened this issue Jul 19, 2016 · 1 comment

Comments

@jonscottclark
Copy link

jonscottclark commented Jul 19, 2016

While debugging a site in iOS I saw that my home-baked localStorage caching script was failing in private mode:

QuotaExceededError: DOM exception 22: An attempt was made to add something to storage that exceeded the quota

I see that you check for this error here: https://github.com/addyosmani/basket.js/blob/gh-pages/lib/basket.js#L15 — could you explain for the layman what's happening here and how basket.js handles caching of resources during private browsing (if at all)?

@hermansje
Copy link

The referenced code sorts all localStarage items managed by basket.js and removes the oldest entry (recursively, until no error is thrown).
Private mode in Safari hower, throws the QuotaExceededError when accessing localStorage, so it can't store anything. MDN gives an example how to handle this.

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