Safari in private browsing mode throws error
i8ramin opened this issue · 10 comments
Hey guys, it seems like Safari disables local/session storage when in private browsing mode. This causes angular apps to fail when trying to use the store methods. The error thrown:
Error: QuotaExceededError: DOM Exception 22
It would be nice to fall back to cookies in this instance or at least catch the error and do something with it.
Keep in mind that you will need to include angular-cookies and ngCookies in your app for this to work.
+1 for the problem
please add this check for localStorage to resolve problem.
this work both Safari private mode and ios cordova.
function isLocalStorageSupported() {
var storage = window. localStorage,
key = 'test';
try {
storage.setItem(key, '1');
storage.removeItem(key);
return true;
} catch (error) {
return false;
}
}
Thanks for the report.
We'll implement it. I'll try to get it done this week, otherwise, next for sure :).
Thanks!
perfect! thanks.
i pushed a pull request, many time ago... since now...no merging... project dead?
if anyone is interested for a solution i made my trunk with fix https://github.com/gimox/angular-storage
Fixed!
thanks
And released as 0.0.10 :).
No prob!