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

SecurityError when storage is disabled #158

Closed
joaofernandes opened this issue Dec 9, 2015 · 8 comments
Closed

SecurityError when storage is disabled #158

joaofernandes opened this issue Dec 9, 2015 · 8 comments

Comments

@joaofernandes
Copy link

If a user disables cache (privacy settings > prevent all sites to set data), Dexie throws this error

Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

Line

localStorage: ((typeof chrome !== "undefined" && chrome !== null ? chrome.storage : void 0) != null ? null : global.localStorage)

@dfahlander
Copy link
Collaborator

Thanks. localStorage we should then do a try/catch around localStorage because we don't really need it. It is only used for making Dexie.getDatabaseNames() work. Ill look into it later.

@joaofernandes
Copy link
Author

Thanks!

@tdelmas
Copy link

tdelmas commented Mar 14, 2016

Any update on that issue ?

@dfahlander
Copy link
Collaborator

No. Thanks for reminder

@dfahlander
Copy link
Collaborator

I hope the last checkin helps. However, if you forbid the browser from storing any any data locally, indexedDB would also be disabled, so expect another error, I suppose.

@tdelmas
Copy link

tdelmas commented Mar 14, 2016

If I remember correctly, it happens in Safari in private mode (not sure if database is disabled too). But I think the lib can fail more gracefully than dying during initialization ;)

@dfahlander
Copy link
Collaborator

So true ;)

@dfahlander
Copy link
Collaborator

Solved in v1.3.4

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