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

Add close tab confirmation, Ctrl + W, close button #52

Closed
Arcanorum opened this issue Nov 24, 2020 · 2 comments
Closed

Add close tab confirmation, Ctrl + W, close button #52

Arcanorum opened this issue Nov 24, 2020 · 2 comments
Assignees
Labels
code Requires code (logic/configuration) to be created or modified. good first issue Good for newcomers request New feature or request

Comments

@Arcanorum
Copy link
Owner

Arcanorum commented Nov 24, 2020

A prompt when the user goes to close the tab that will confirm if they meant to do that, to avoid accidental misclick closing the game, and should inform them that they can create an account if they haven't done so already.

AC: If the user is not playing with an account, the "Create account" panel should be shown when a user event tries to close the page (x button, ctrl + W)

@Arcanorum Arcanorum added request New feature or request good first issue Good for newcomers code Requires code (logic/configuration) to be created or modified. labels Nov 24, 2020
@coder-tim coder-tim self-assigned this Dec 6, 2020
@coder-tim
Copy link
Collaborator

I did some investigation and found that this can be resolved by using the onbeforeunload event to display a pop up message when the player attempts to refresh the page or close the tab.

However, it seems like most modern browsers have disabled custom pop up messages in order to prevent spoofing attacks:

@Arcanorum
Copy link
Owner Author

If possible, it might be an alternative to just show the create account panel on the onbeforeunload event, as if they had pressed on the top right button directly. The message content doesn't necessarily need to be within the browser's own close confirmation box.

image

ACs updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Requires code (logic/configuration) to be created or modified. good first issue Good for newcomers request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants