Skip to content

ElectronApp.on('second-instance') method

ElectronApp › on(‘second-instance’)

Unofficial

Registers a listener for the second-instance event.

Emitted inside the primary instance when a second instance is executed and calls requestSingleInstanceLock.

Signature:

on(event: "second-instance", listener: (event: ElectronEvent, argv: string[], workingDirectory: string, additionalData: unknown, ackCallback: unknown) => void): this

Parameters:

Parameter Type Description
event "second-instance" The event name.
listener (event: ElectronEvent, argv: string[], workingDirectory: string, additionalData: unknown, ackCallback: unknown) => void The event handler.

Returns: thisThis ElectronApp instance.