Skip to content

ElectronWebContents.on('focus') method

ElectronWebContents › on(‘focus’)

Unofficial

Registers a listener for the focus event.

Signature:

on(event: "focus", listener: (...args: unknown[]) => void): this

Parameters:

ParameterTypeDescription
event"focus"The event name.
listener(...args: unknown[]) => voidCalled when the focus event is emitted.

Returns: thisThis web contents instance.