Header menu logo fable-electron-docs-api

WebFrameMain Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ❌

Instance members

Instance member Description

this.collectJavaScriptCallStack ()

Full Usage: this.collectJavaScriptCallStack ()

Returns: Promise<Option<string>>
Modifiers: inline

A promise that resolves with the currently running JavaScript call stack. If no JavaScript runs in the frame, the promise will never resolve. In cases where the call stack is otherwise unable to be collected, it will return undefined.This can be useful to determine why the frame is unresponsive in cases where there's long-running JavaScript. For more information, see the proposed Crash Reporting API.

Returns: Promise<Option<string>>

this.detached

Full Usage: this.detached

Returns: bool

A Boolean representing whether the frame is detached from the frame tree. If a frame is accessed while the corresponding page is running any unload listeners, it may become detached as the newly navigated page replaced it in the frame tree.

Returns: bool

this.executeJavaScript (code, ?userGesture)

Full Usage: this.executeJavaScript (code, ?userGesture)

Parameters:
    code : string
    ?userGesture : bool

Returns: Promise<obj>
Modifiers: inline

A promise that resolves with the result of the executed code or is rejected if execution throws or results in a rejected promise.Evaluates code in page.In the browser window some HTML APIs like requestFullScreen can only be invoked by a gesture from the user. Setting userGesture to true will remove this limitation.

code : string
?userGesture : bool
Returns: Promise<obj>

this.frameToken

Full Usage: this.frameToken

Returns: string

A string which uniquely identifies the frame within its associated renderer process. This is equivalent to webFrame.frameToken.

Returns: string

this.frameTreeNodeId

Full Usage: this.frameTreeNodeId

Returns: int

An Integer representing the id of the frame's internal FrameTreeNode instance. This id is browser-global and uniquely identifies a frame that hosts content. The identifier is fixed at the creation of the frame and stays constant for the lifetime of the frame. When the frame is removed, the id is not used again.

Returns: int

this.frames

Full Usage: this.frames

Returns: WebFrameMain[]

A WebFrameMain[] collection containing the direct descendents of frame.

Returns: WebFrameMain[]

this.framesInSubtree

Full Usage: this.framesInSubtree

Returns: WebFrameMain[]

A WebFrameMain[] collection containing every frame in the subtree of frame, including itself. This can be useful when traversing through all frames.

Returns: WebFrameMain[]

this.ipc

Full Usage: this.ipc

Returns: ipcMain

An IpcMain instance scoped to the frame.IPC messages sent with ipcRenderer.send, ipcRenderer.sendSync or ipcRenderer.postMessage will be delivered in the following order:* contents.on('ipc-message')* contents.mainFrame.on(channel)* contents.ipc.on(channel)* ipcMain.on(channel)Handlers registered with invoke will be checked in the following order. The first one that is defined will be called, the rest will be ignored.* contents.mainFrame.handle(channel)* contents.handle(channel)* ipcMain.handle(channel)In most cases, only the main frame of a WebContents can send or receive IPC messages. However, if the nodeIntegrationInSubFrames option is enabled, it is possible for child frames to send and receive IPC messages also. The WebContents.ipc interface may be more convenient when nodeIntegrationInSubFrames is not enabled.

Returns: ipcMain

this.isDestroyed ()

Full Usage: this.isDestroyed ()

Returns: bool
Modifiers: inline

Whether the frame is destroyed.

Returns: bool

this.name

Full Usage: this.name

Returns: string

A string representing the frame name.

Returns: string

this.offDomReady handler

Full Usage: this.offDomReady handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the document is loaded.

handler : unit -> unit

this.onDomReady handler

Full Usage: this.onDomReady handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the document is loaded.

handler : unit -> unit

this.onceDomReady handler

Full Usage: this.onceDomReady handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the document is loaded.

handler : unit -> unit

this.origin

Full Usage: this.origin

Returns: string

A string representing the current origin of the frame, serialized according to RFC 6454. This may be different from the URL. For instance, if the frame is a child window opened to about:blank, then frame.origin will return the parent frame's origin, while frame.url will return the empty string. Pages without a scheme/host/port triple origin will have the serialized origin of "null" (that is, the string containing the letters n, u, l, l).

Returns: string

this.osProcessId

Full Usage: this.osProcessId

Returns: int

An Integer representing the operating system pid of the process which owns this frame.

Returns: int

this.parent

Full Usage: this.parent

Returns: Option<WebFrameMain>

A WebFrameMain | null representing parent frame of frame, the property would be null if frame is the top frame in the frame hierarchy.

Returns: Option<WebFrameMain>

this.postMessage (channel, message, ?transfer)

Full Usage: this.postMessage (channel, message, ?transfer)

Parameters:
Modifiers: inline

Send a message to the renderer process, optionally transferring ownership of zero or more MessagePortMain objects.The transferred MessagePortMain objects will be available in the renderer process by accessing the ports property of the emitted event. When they arrive in the renderer, they will be native DOM MessagePort objects.For example:

channel : string
message : obj
?transfer : MessagePortMain[]

this.processId

Full Usage: this.processId

Returns: int

An Integer representing the Chromium internal pid of the process which owns this frame. This is not the same as the OS process ID; to read that use frame.osProcessId.

Returns: int

this.reload ()

Full Usage: this.reload ()

Returns: bool
Modifiers: inline

Whether the reload was initiated successfully. Only results in false when the frame has no history.

Returns: bool

this.routingId

Full Usage: this.routingId

Returns: int

An Integer representing the unique frame id in the current renderer process. Distinct WebFrameMain instances that refer to the same underlying frame will have the same routingId.

Returns: int

this.send (channel, ...args)

Full Usage: this.send (channel, ...args)

Parameters:
    channel : string
    ...args : obj[]

Modifiers: inline

Send an asynchronous message to the renderer process via channel, along with arguments. Arguments will be serialized with the Structured Clone Algorithm, just like postMessage, so prototype chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.The renderer process can handle the message by listening to channel with the ipcRenderer module.

channel : string
...args : obj[]

this.top

Full Usage: this.top

Returns: Option<WebFrameMain>

A WebFrameMain | null representing top frame in the frame hierarchy to which frame belongs.

Returns: Option<WebFrameMain>

this.url

Full Usage: this.url

Returns: string

A string representing the current URL of the frame.

Returns: string

this.visibilityState

Full Usage: this.visibilityState

Returns: string

A string representing the visibility state of the frame.See also how the Page Visibility API is affected by other Electron APIs.

Returns: string

Type something to start searching.