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:

ParameterTypeDescription
event"open-file"The event name.
listener(event: ElectronEvent, path: string) => voidThe event handler.

Returns: thisThis ElectronApp instance.