Skip to content

Implement Action to set a window.onbeforeunload callback #24

@marcoroth

Description

@marcoroth

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions