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

Guard use of local/session Storage with a check of its availability #782

Closed
priyajeet opened this issue Apr 24, 2018 · 0 comments
Closed

Comments

@priyajeet
Copy link
Contributor

Using localStorage directly can fail in private/incognito mode or when cookies are disabled. As such before using localStorage, it needs to be guarded. Cache.js has a check for it.

eg usage without guards: https://github.com/box/box-content-preview/blob/master/src/lib/DownloadReachability.js#L99

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

1 participant