Skip to content

ElectronWebContents.on('will-redirect') method

ElectronWebContents › on(‘will-redirect’)

Unofficial

Registers a listener for the will-redirect event.

Signature:

on(event: "will-redirect", listener: (event: ElectronEvent, url: string, isInPlace: boolean, isMainFrame: boolean, frameProcessId: number, frameRoutingId: number) => void): this

Parameters:

ParameterTypeDescription
event"will-redirect"The event name.
listener(event: ElectronEvent, url: string, isInPlace: boolean, isMainFrame: boolean, frameProcessId: number, frameRoutingId: number) => voidCalled when the will-redirect event is emitted.

Returns: thisThis web contents instance.