PillowPillow / ng2-webstorage

Localstorage and sessionstorage manager - Angular service
MIT License
428 stars 91 forks source link

Fix disabled localstorage #41

Closed RichieRock closed 7 years ago

RichieRock commented 7 years ago

The function getWStorage()will crash if localstorage is disabled in browser. In Chrome, you can do it by setting "Block sites from setting any data" to true in your Content settings.

The fix will move this function inside try-catch block so that the storage will return as unavailable if user has disabled localstorage in browser's settings.

PillowPillow commented 7 years ago

Hi, thanks for the pr. I didn't know about this feature. This little fix will be available in the next version.

RichieRock commented 7 years ago

Thanks @PillowPillow!