WebFrameMain

external class WebFrameMain : EventEmitter(source)

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
external object Companion

Properties

Link copied to clipboard
external val detached: Boolean

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.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
external val frameToken: String

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

Link copied to clipboard
external val frameTreeNodeId: Double

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.

Link copied to clipboard
external val ipc: IpcMain

An IpcMain instance scoped to the frame.

Link copied to clipboard
external val name: String

A string representing the frame name.

Link copied to clipboard
external val origin: 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).

Link copied to clipboard
external val osProcessId: Double

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

Link copied to clipboard
external val parent: WebFrameMain?

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

Link copied to clipboard
external val processId: Double

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.

Link copied to clipboard
external val routingId: Double

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.

Link copied to clipboard
external val top: WebFrameMain?

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

Link copied to clipboard
external val url: String

A string representing the current URL of the frame.

Link copied to clipboard
external val visibilityState: String

A string representing the visibility state of the frame.

Functions

Link copied to clipboard
external fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard

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.

Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
external fun executeJavaScript(code: String, userGesture: Boolean = definedExternally): Promise<Any?>

A promise that resolves with the result of the executed code or is rejected if execution throws or results in a rejected promise.

Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
external fun isDestroyed(): Boolean

Whether the frame is destroyed.

Link copied to clipboard
external fun listenerCount(type: EventType, listener: EventListener): Double
Link copied to clipboard
Link copied to clipboard
external fun off(type: EventType, listener: EventListener)
Link copied to clipboard
external fun on(type: EventType, listener: EventListener)
Link copied to clipboard
external fun once(type: EventType, listener: EventListener)
Link copied to clipboard
external fun postMessage(channel: String, message: Any?, transfer: ReadonlyArray<MessagePortMain> = definedExternally)

Send a message to the renderer process, optionally transferring ownership of zero or more MessagePortMain objects.

Link copied to clipboard
external fun prependListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependOnceListener(type: EventType, listener: EventListener)
Link copied to clipboard
Link copied to clipboard
external fun reload(): Boolean

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

Link copied to clipboard
external fun removeAllListeners(type: EventType)
Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun send(channel: String, vararg args: Any?)

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.

Link copied to clipboard
external fun setMaxListeners(n: Number)