Skip to content

ElectronWebContents.on('will-attach-webview') method

ElectronWebContents › on(‘will-attach-webview’)

Unofficial

Registers a listener for the will-attach-webview event.

Signature:

on(event: "will-attach-webview", listener: (event: ElectronEvent, webPreferences: WebPreferences, params: Record<string, string>) => void): this

Parameters:

ParameterTypeDescription
event"will-attach-webview"The event name.
listener(event: ElectronEvent, webPreferences: WebPreferences, params: Record<string, string>) => voidCalled when the will-attach-webview event is emitted.

Returns: thisThis web contents instance.