Skip to content

ElectronBrowserWindow.fromWebContents method

ElectronBrowserWindow › fromWebContents

Unofficial

Returns the window that owns the given webContents.

Signature:

fromWebContents(webContents: ElectronWebContents): ElectronBrowserWindow | null

Parameters:

ParameterTypeDescription
webContentsElectronWebContentsThe web contents to look up.

Returns: ElectronBrowserWindow | nullThe owning BrowserWindow or null if the contents are not owned by a window.