Skip to content

ElectronWebContentsModule

Unofficial

The webContents module accessor exposed by Electron, providing static factory and lookup methods for WebContents instances.

Import:

import type { ElectronWebContentsModule } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronWebContentsModule

Methods

MethodReturnsDescription
fromDevToolsTargetId(targetId)ElectronWebContents | undefinedLooks up a WebContents instance based on its assigned Chrome DevTools Protocol TargetID.
fromFrame(frame)ElectronWebContents | undefinedLooks up a WebContents instance based on a WebFrameMain.
fromId(id)ElectronWebContents | undefinedLooks up a WebContents instance based on its ID.
getAllWebContents()ElectronWebContents[]Returns an array of all WebContents instances. This will contain web contents for all windows, webviews, opened devtools, and devtools extension background pages.
getFocusedWebContents()ElectronWebContents | nullReturns the web contents that is focused in this application, otherwise returns null.

Links to this page: