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

localStorage sometimes null after Window close event #3607

Closed
Z3TA opened this issue Jun 24, 2015 · 3 comments
Closed

localStorage sometimes null after Window close event #3607

Z3TA opened this issue Jun 24, 2015 · 3 comments
Labels

Comments

@Z3TA
Copy link

Z3TA commented Jun 24, 2015

I'm using this code:
https://github.com/nwjs/nw.js/wiki/Preserve-window-state-between-sessions

But sometimes the localStorage is null!

localStorage works fine until hitting the close button in windows (to close the app).
Then sometimes the localStorage works and sometimes it's null.

Test code:
if(!localStorage) throw new Error("localStorage not available!");

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Z3TA
Copy link
Author

Z3TA commented Jun 24, 2015

Might be the same as:
#2087

@Christywl
Copy link
Contributor

Is this issue still reproduced for you? Due to #4487, I can't run the code normally on the latest nwjs build.

@Z3TA
Copy link
Author

Z3TA commented Jun 5, 2017

I've not been able to reproduce this.

I have not seen this for a very long time. I've refactored the code to make a more "soft" close, by running everything and then calling this.close(true);
I'm also trying to use as little nw.js code as possible an rely only on native web API's, so that I can run my app entirely in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants