Skip to content

ElectronWebContents.on('will-prevent-unload') method

ElectronWebContents › on(‘will-prevent-unload’)

Unofficial

Registers a listener for the will-prevent-unload event.

Signature:

on(event: "will-prevent-unload", listener: (event: ElectronEvent) => void): this

Parameters:

Parameter Type Description
event "will-prevent-unload" The event name.
listener (event: ElectronEvent) => void Called when the will-prevent-unload event is emitted.

Returns: thisThis web contents instance.