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

Implement Action to set a window.onbeforeunload callback #24

Open
marcoroth opened this issue Nov 29, 2022 · 0 comments
Open

Implement Action to set a window.onbeforeunload callback #24

marcoroth opened this issue Nov 29, 2022 · 0 comments
Labels
enhancement New feature or request new custom action

Comments

@marcoroth
Copy link
Owner

marcoroth commented Nov 29, 2022

Not sure how useful this is, but it might be interesting to have an action to set a window.onbeforeunload callback. This can be handy to set from the server-side when you are sending down some data which is not persisted yet. And with this you would get a warning when you attempt to close the window/tab. Like:

Screenshot 2022-11-29 at 02 49 30

The example above can be achieved with this snippet:

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

Obviously we would also need an action to clear the event-listener again.

@marcoroth marcoroth added enhancement New feature or request new custom action labels Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new custom action
Projects
None yet
Development

No branches or pull requests

1 participant