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 10: SecurityError (DOM Exception 18): The operation is insecure. #132

Closed
medialwerk opened this issue Oct 11, 2016 · 3 comments
Closed

Comments

@medialwerk
Copy link

medialwerk commented Oct 11, 2016

If Safari 10 does not allow access to the local storage this error is thrown: "SecurityError (DOM Exception 18): The operation is insecure".

This happens because of these lines:

https://github.com/i18next/i18next-browser-languageDetector/blob/master/src/browserLookups/localStorage.js#L29

https://github.com/i18next/i18next-browser-languageDetector/blob/master/src/browserLookups/localStorage.js#L38

Safari already throws this error if you access "window.localStorage".

Thanks! :-)

@jamuhl
Copy link
Member

jamuhl commented Oct 11, 2016

hm seems same as: angular-translate/angular-translate#629

means only solution is putting all in a try-catch block and have a silent failure...means no cookie and no localStorage -> changeLanguage won't be persisted on session refresh - which might be ok in this cases...who turns off cookies anyway.

If you like you might provide a PR to speed it up...else i will try to make the change when i'm back from holiday.

@medialwerk
Copy link
Author

Hey jamuhl,

i am a little bit busy these days too. If i find some spare time to provide a pull request, i let you know. Thanks for your proposal to fix it after your holiday! :-).

@jamuhl
Copy link
Member

jamuhl commented Oct 17, 2016

@medialwerk can you try [email protected] that should avoid triggering this exception using the try-catch block

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

2 participants