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

Should use pop-up to warn when closing tab #24

Open
pdg137 opened this issue Feb 17, 2022 · 2 comments
Open

Should use pop-up to warn when closing tab #24

pdg137 opened this issue Feb 17, 2022 · 2 comments

Comments

@pdg137
Copy link

pdg137 commented Feb 17, 2022

There's a feature that many sites use to avoid accidental tab closing; I think it's JavaScript's beforeunload event. BesoGo should use this to generate a pop-up and give the user one last chance to avoid lost work.

@yewang
Copy link
Owner

yewang commented Feb 17, 2022

I think another way to handle the underlying issue (of avoiding lost work) would be to cache the game tree state (maybe just dumped into SGF format) into local storage.

@ParmuzinAlexander
Copy link

It's easy to do it yourself. Add

window.onbeforeunload = function() {
	return true;
};

to besogo.js
But I noticed that it only disturb because I never accidentally click on close.

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

No branches or pull requests

3 participants