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

Safari and iOS Private browsing #16

Open
mkraynov opened this issue Feb 27, 2015 · 2 comments
Open

Safari and iOS Private browsing #16

mkraynov opened this issue Feb 27, 2015 · 2 comments

Comments

@mkraynov
Copy link

When I'm using Safari in Private Browsing, I got error: "An attempt was made to add something to storage that exceeded the quota."
Stackoverflow says it is by design of Private Browsing.
http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-safari-quota-exceeded-err-dom-exception-22-an

@monsur
Copy link
Owner

monsur commented Mar 2, 2015

Can you set the cache to BasicCacheStorage instead of LocalStorageCacheStorage in this case? For example, borrowing the isLocalStorageNameSupported method from that StackOverlow link, you could do something like this:

var store;
if (isLocalStorageNameSupported()) {
  store = new Cache.LocalStorageCacheStorage();
} else {
  store = new Cache.BasicCacheStorage();
}
var cache = new Cache(-1, false, store);

@mazong1123
Copy link

@monsur can this detecting logic be absorbed into Cache's constructor so that the user won't worry about choosing storage?

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

3 participants