ElectronWebContents.on('new-window') method
ElectronWebContents › on(‘new-window’)
Unofficial
Registers a listener for thenew-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): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| $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 | Called when the new-window event is emitted. |
Returns: this — This web contents instance.