Skip to content

ElectronApp.on('open-file') method

ElectronApp › on(‘open-file’)

Unofficial

Registers a listener for the open-file event.

Emitted when the user wants to open a file with the application. macOS only.

Signature:

on(event: "open-file", listener: (event: ElectronEvent, path: string) => void): this

Parameters:

Parameter Type Description
event "open-file" The event name.
listener (event: ElectronEvent, path: string) => void The event handler.

Returns: thisThis ElectronApp instance.