preventDefault

external fun preventDefault()(source)

Prevents the window from being closed.

Must be called before the handler returns (await anything you need first), otherwise the window is destroyed as usual.