WebFrame

external interface WebFrame : EventEmitter(source)

Properties

Link copied to clipboard
abstract external val firstChild: WebFrame?

A WebFrame | null representing the first child frame of webFrame, the property would be null if webFrame has no children or if first child is not in the current renderer process.

Link copied to clipboard
abstract external val frameToken: String

A string representing the unique frame token in the current renderer process. Distinct WebFrame instances that refer to the same underlying frame will have the same frameToken.

Link copied to clipboard
Link copied to clipboard
abstract external val nextSibling: WebFrame?

A WebFrame | null representing next sibling frame, the property would be null if webFrame is the last frame in its parent or if the next sibling is not in the current renderer process.

Link copied to clipboard
abstract external val opener: WebFrame?

A WebFrame | null representing the frame which opened webFrame, the property would be null if there's no opener or opener is not in the current renderer process.

Link copied to clipboard
abstract external val parent: WebFrame?

A WebFrame | null representing parent frame of webFrame, the property would be null if webFrame is top or parent is not in the current renderer process.

Link copied to clipboard
abstract external val top: WebFrame?

A WebFrame | null representing top frame in frame hierarchy to which webFrame belongs, the property would be null if top frame is not in the current renderer process.

Functions

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

Attempts to free memory that is no longer being used (like images from a previous navigation).

Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
abstract external fun executeJavaScript(code: String, userGesture: Boolean = definedExternally, callback: (result: Any?, JsError) -> Unit = 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
abstract external fun executeJavaScriptInIsolatedWorld(worldId: Double, scripts: ReadonlyArray<WebSource>, userGesture: Boolean = definedExternally, callback: (result: Any?, JsError) -> Unit = definedExternally): Promise<Any?>

A promise that resolves with the result of the executed code or is rejected if execution could not start.

Link copied to clipboard
abstract external fun findFrameByName(name: String): WebFrame?

A child of webFrame with the supplied name, null would be returned if there's no such frame or if the frame is not in the current renderer process.

Link copied to clipboard
abstract external fun findFrameByToken(frameToken: String): WebFrame?

that has the supplied frameToken, null if not found.

Link copied to clipboard
abstract external fun getFrameForSelector(selector: String): WebFrame?

The frame element in webFrame's document selected by selector, null would be returned if selector does not select a frame or if the frame is not in the current renderer process.

Link copied to clipboard
abstract external fun getIsolatedWorlds(): ReadonlyArray<Double>

The IDs of isolated worlds that currently exist for this frame. This does not include the main world (ID 0) or Electron's preload world (ID 999).

Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
abstract external fun getResourceUsage(): ResourceUsage

Returns an object describing usage information of Blink's internal memory caches.

Link copied to clipboard
abstract external fun getWordSuggestions(word: String): ReadonlyArray<String>

A list of suggested words for a given word. If the word is spelled correctly, the result will be empty.

Link copied to clipboard
abstract external fun getZoomFactor(): Double

The current zoom factor.

Link copied to clipboard
abstract external fun getZoomLevel(): Double

The current zoom level.

Link copied to clipboard
abstract external fun insertCSS(css: String, options: InsertCSSOptions = definedExternally): String

A key for the inserted CSS that can later be used to remove the CSS via webFrame.removeInsertedCSS(key).

Link copied to clipboard
abstract external fun insertText(text: String)

Inserts text to the focused element.

Link copied to clipboard
abstract external fun isWordMisspelled(word: String): Boolean

True if the word is misspelled according to the built in spellchecker, false otherwise. If no dictionary is loaded, always return false.

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 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 removeAllListeners(type: EventType)
Link copied to clipboard
abstract external fun removeInsertedCSS(key: String)

Removes the inserted CSS from the current web page. The stylesheet is identified by its key, which is returned from webFrame.insertCSS(css).

Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
abstract external fun setIsolatedWorldInfo(worldId: Double, info: Info)

Set the security origin, content security policy and name of the isolated world.

Link copied to clipboard
external fun setMaxListeners(n: Number)
Link copied to clipboard
abstract external fun setSpellCheckProvider(language: String, provider: Provider)

Sets a provider for spell checking in input fields and text areas.

Link copied to clipboard
abstract external fun setVisualZoomLevelLimits(minimumLevel: Double, maximumLevel: Double)

Sets the maximum and minimum pinch-to-zoom level.

Link copied to clipboard
abstract external fun setZoomFactor(factor: Double)

Changes the zoom factor to the specified factor. Zoom factor is zoom percent divided by 100, so 300% = 3.0.

Link copied to clipboard
abstract external fun setZoomLevel(level: Double)

Changes the zoom level to the specified level. The original size is 0 and each increment above or below represents zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively.