Skip to content

Add EventArgs to BrowserWindow.OnClose event to prevent closing the window #768

Open
@niklasstich

Description

@niklasstich

Currently, the OnClose event on BrowserWindow does not provide any event args to callees of the event. This makes it impossible to prevent closing the window from C# code directly without involving Javascript that catches the 'onbeforeunload' event.

This fact was mentioned in several previous issues:
#391 (comment)
#567

I would therefore request that EventArgs be added to this event that allow preventing the window from being closed, analogous to the Electron BrowserWindow close event: https://www.electronjs.org/docs/latest/api/browser-window#event-close

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions