gsklee / ngStorage

localStorage and sessionStorage done right for AngularJS.
MIT License
2.33k stars 461 forks source link

If cookies are disabled in Firefox - it breaks the app #207

Closed abachuk closed 8 years ago

abachuk commented 8 years ago

If user has cookies disabled in Firefox, nothing will work. I'm creating PR to patch this problem. It's also fixing console error in Safari (OS X or iOS) is in private browsing mode QUOTA_EXCEEDED_ERR.

abachuk commented 8 years ago

I created PR https://github.com/gsklee/ngStorage/pull/208 The problem is Firefox still returns empty object even if webStorage is disabled.

egilkh commented 8 years ago

Thanks for this.

When ngStorage fails to be supported we still provide the dummy storage type. giving angular.noop as getItem and setItem. But this will not actually be saved. This could be replaced (in cases there webStorage is not allowed/supported) to Angular's CacheFactory and provide at least some storage features. Not sure if that is a smart idea tho.

I'll get this merged asap.

egilkh commented 8 years ago

Lines 40 and down (the if) should do the same as this. Since #208 has no tests it fails very badly. Closing this please re-open / new PR with tests if the problem persists.