Skip to content

ElectronWebContents.on('new-window') method

ElectronWebContents › on(‘new-window’)

Unofficial

Registers a listener for the new-window event.

Signature:

on(event: "new-window", listener: (event: ElectronNewWindowWebContentsEvent, url: string, frameName: string, disposition: "new-window" | "background-tab" | "default" | "foreground-tab" | "other" | "save-to-disk", options: BrowserWindowConstructorOptions, additionalFeatures: string[], referrer: ElectronReferrer, postBody: ElectronPostBody) => void): this

Parameters:

Parameter Type Description
event "new-window" The event name.
listener (event: ElectronNewWindowWebContentsEvent, url: string, frameName: string, disposition: "new-window" | "background-tab" | "default" | "foreground-tab" | "other" | "save-to-disk", options: BrowserWindowConstructorOptions, additionalFeatures: string[], referrer: ElectronReferrer, postBody: ElectronPostBody) => void Called when the new-window event is emitted.

Returns: thisThis web contents instance.