WebviewTag

external interface WebviewTag : HTMLElement(source)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var allowpopups: Boolean

A boolean. When this attribute is present the guest page will be allowed to open new windows. Popups are disabled by default.

Link copied to clipboard
open var ariaAtomic: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var ariaBusy: String?
Link copied to clipboard
open var ariaChecked: String?
Link copied to clipboard
open var ariaColCount: String?
Link copied to clipboard
open var ariaColIndex: String?
Link copied to clipboard
Link copied to clipboard
open var ariaColSpan: String?
Link copied to clipboard
open var ariaCurrent: String?
Link copied to clipboard
Link copied to clipboard
open var ariaDisabled: String?
Link copied to clipboard
open var ariaExpanded: String?
Link copied to clipboard
open var ariaHasPopup: String?
Link copied to clipboard
open var ariaHidden: String?
Link copied to clipboard
open var ariaInvalid: String?
Link copied to clipboard
Link copied to clipboard
open var ariaLabel: String?
Link copied to clipboard
open var ariaLevel: String?
Link copied to clipboard
open var ariaLive: String?
Link copied to clipboard
open var ariaModal: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var ariaPosInSet: String?
Link copied to clipboard
open var ariaPressed: String?
Link copied to clipboard
open var ariaReadOnly: String?
Link copied to clipboard
open var ariaRequired: String?
Link copied to clipboard
Link copied to clipboard
open var ariaRowCount: String?
Link copied to clipboard
open var ariaRowIndex: String?
Link copied to clipboard
Link copied to clipboard
open var ariaRowSpan: String?
Link copied to clipboard
open var ariaSelected: String?
Link copied to clipboard
open var ariaSetSize: String?
Link copied to clipboard
open var ariaSort: String?
Link copied to clipboard
open var ariaValueMax: String?
Link copied to clipboard
open var ariaValueMin: String?
Link copied to clipboard
open var ariaValueNow: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var autofocus: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var dir: String
Link copied to clipboard

A string which is a list of strings which specifies the blink features to be disabled separated by ,. The full list of supported feature strings can be found in the RuntimeEnabledFeatures.json5 file.

Link copied to clipboard

A boolean. When this attribute is present the guest page will have web security disabled. Web security is enabled by default.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A string which is a list of strings which specifies the blink features to be enabled separated by ,. The full list of supported feature strings can be found in the RuntimeEnabledFeatures.json5 file.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var httpreferrer: String

A string that sets the referrer URL for the guest page.

Link copied to clipboard
var id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var nodeintegration: Boolean

A boolean. When this attribute is present the guest page in webview will have node integration and can use node APIs like require and process to access low level system resources. Node integration is disabled by default in the guest page.

Link copied to clipboard

A boolean for the experimental option for enabling NodeJS support in sub-frames such as iframes inside the webview. All your preloads will load for every iframe, you can use process.isMainFrame to determine if you are in the main frame or not. This option is disabled by default in the guest page.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var nonce: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var onerror: Function<Unit>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val ownerDocument: Document
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var partition: String

A string that sets the session used by the page. If partition starts with persist:, the page will use a persistent session available to all pages in the app with the same partition. if there is no persist: prefix, the page will use an in-memory session. By assigning the same partition, multiple pages can share the same session. If the partition is unset then default session of the app will be used.

Link copied to clipboard
abstract var plugins: Boolean

A boolean. When this attribute is present the guest page in webview will be able to use browser plugins. Plugins are disabled by default.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var preload: String

A string that specifies a script that will be loaded before other scripts run in the guest page. The protocol of script's URL must be file: (even when using asar: archives) because it will be loaded by Node's require under the hood, which treats asar: archives as virtual directories.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var role: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var src: String

A string representing the visible URL. Writing to this attribute initiates top-level navigation.

Link copied to clipboard
Link copied to clipboard
open var tabIndex: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var useragent: String

A string that sets the user agent for the guest page before the page is navigated to. Once the page is loaded, use the setUserAgent method to change the user agent.

Link copied to clipboard
abstract var webpreferences: String

A string which is a comma separated list of strings which specifies the web preferences to be set on the webview. The full list of supported preference strings can be found in BrowserWindow.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Adjusts the current text selection starting and ending points in the focused frame by the given amounts. A negative amount moves the selection towards the beginning of the document, and a positive amount moves the selection towards the end of the document.

Link copied to clipboard
open fun after(vararg nodes: Any)
Link copied to clipboard
open fun animate(keyframes: ReadonlyArray<Keyframe>?, options: Double): Animation
open fun animate(keyframes: PropertyIndexedKeyframes?, options: Double): Animation
Link copied to clipboard
open fun append(vararg nodes: Any)
Link copied to clipboard
fun <T : Node> appendChild(node: T): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun before(vararg nodes: Any)
Link copied to clipboard
open fun blur()
Link copied to clipboard
abstract fun canGoBack(): Boolean

Whether the guest page can go back.

Link copied to clipboard
abstract fun canGoForward(): Boolean

Whether the guest page can go forward.

Link copied to clipboard
abstract fun canGoToOffset(offset: Double): Boolean

Whether the guest page can go to offset.

Link copied to clipboard
abstract fun capturePage(rect: Rectangle = definedExternally): Promise<NativeImage>

Resolves with a NativeImage

Link copied to clipboard
abstract fun centerSelection()

Centers the current text selection in page.

Link copied to clipboard
Link copied to clipboard
abstract fun clearHistory()

Clears the navigation history.

Link copied to clipboard
fun click()
Link copied to clipboard
fun cloneNode(deep: Boolean): Node
Link copied to clipboard
abstract fun closeDevTools()

Closes the DevTools window of guest page.

Link copied to clipboard
fun closest(selector: String): Element?
fun <T : HTMLElement> closest(selector: HtmlTagName<T>): T?
fun <T : MathMLElement> closest(selector: MathMLTagName<T>): T?
fun <T : SVGElement> closest(selector: SvgTagName<T>): T?
Link copied to clipboard
Link copied to clipboard
fun contains(other: Node?): Boolean
Link copied to clipboard
abstract fun copy()

Executes editing command copy in page.

Link copied to clipboard
abstract fun cut()

Executes editing command cut in page.

Link copied to clipboard
abstract fun delete()

Executes editing command delete in page.

Link copied to clipboard
Link copied to clipboard
abstract fun downloadURL(url: String, options: DownloadURLOptions = definedExternally)

Initiates a download of the resource at url without navigating.

Link copied to clipboard
abstract fun executeJavaScript(code: String, userGesture: Boolean = definedExternally): Promise<Any?>

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

Link copied to clipboard
abstract fun findInPage(text: String, options: FindInPageOptions = definedExternally): Double

The request id used for the request.

Link copied to clipboard
open fun focus(options: FocusOptions)
Link copied to clipboard
Link copied to clipboard
fun getAttribute(qualifiedName: String): String?
Link copied to clipboard
Link copied to clipboard
fun getAttributeNode(qualifiedName: String): Attr?
Link copied to clipboard
fun getAttributeNodeNS(namespace: String?, localName: String): Attr?
Link copied to clipboard
fun getAttributeNS(namespace: String?, localName: String): String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getTitle(): String

The title of guest page.

Link copied to clipboard
abstract fun getURL(): String

The URL of guest page.

Link copied to clipboard
abstract fun getUserAgent(): String

The user agent for guest page.

Link copied to clipboard
abstract fun getWebContentsId(): Double

The WebContents ID of this webview.

Link copied to clipboard
abstract fun getZoomFactor(): Double

the current zoom factor.

Link copied to clipboard
abstract fun getZoomLevel(): Double

the current zoom level.

Link copied to clipboard
abstract fun goBack()

Makes the guest page go back.

Link copied to clipboard
abstract fun goForward()

Makes the guest page go forward.

Link copied to clipboard
abstract fun goToIndex(index: Double)

Navigates to the specified absolute index.

Link copied to clipboard
abstract fun goToOffset(offset: Double)

Navigates to the specified offset from the "current entry".

Link copied to clipboard
fun hasAttribute(qualifiedName: String): Boolean
Link copied to clipboard
fun hasAttributeNS(namespace: String?, localName: String): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun hasPointerCapture(pointerId: Int): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun insertAdjacentHTML(position: InsertPosition, string: String)
Link copied to clipboard
Link copied to clipboard
fun <T : Node> insertBefore(node: T, child: Node?): T
Link copied to clipboard
abstract fun insertCSS(css: String): Promise<String>

A promise that resolves with a key for the inserted CSS that can later be used to remove the CSS via <webview>.removeInsertedCSS(key).

Link copied to clipboard
abstract fun insertText(text: String): Promise<Void>

Inserts text to the focused element.

Link copied to clipboard
abstract fun inspectElement(x: Double, y: Double)

Starts inspecting element at position (x, y) of guest page.

Link copied to clipboard
abstract fun inspectServiceWorker()

Opens the DevTools for the service worker context present in the guest page.

Link copied to clipboard
abstract fun inspectSharedWorker()

Opens the DevTools for the shared worker context present in the guest page.

Link copied to clipboard
abstract fun isAudioMuted(): Boolean

Whether guest page has been muted.

Link copied to clipboard
abstract fun isCrashed(): Boolean

Whether the renderer process has crashed.

Link copied to clipboard
abstract fun isCurrentlyAudible(): Boolean

Whether audio is currently playing.

Link copied to clipboard
Link copied to clipboard
abstract fun isDevToolsFocused(): Boolean

Whether DevTools window of guest page is focused.

Link copied to clipboard
abstract fun isDevToolsOpened(): Boolean

Whether guest page has a DevTools window attached.

Link copied to clipboard
fun isEqualNode(otherNode: Node?): Boolean
Link copied to clipboard
abstract fun isLoading(): Boolean

Whether guest page is still loading resources.

Link copied to clipboard
abstract fun isLoadingMainFrame(): Boolean

Whether the main frame (and not just iframes or frames within it) is still loading.

Link copied to clipboard
fun isSameNode(otherNode: Node?): Boolean
Link copied to clipboard

Whether the guest page is waiting for a first-response for the main resource of the page.

Link copied to clipboard
abstract fun loadURL(url: String, options: LoadURLOptions = definedExternally): Promise<Void>

The promise will resolve when the page has finished loading (see did-finish-load), and rejects if the page fails to load (see did-fail-load).

Link copied to clipboard
Link copied to clipboard
fun lookupPrefix(namespace: String?): String?
Link copied to clipboard
fun matches(selectors: String): Boolean
Link copied to clipboard
fun normalize()
Link copied to clipboard
abstract fun openDevTools()

Opens a DevTools window for guest page.

Link copied to clipboard
abstract fun paste()

Executes editing command paste in page.

Link copied to clipboard
abstract fun pasteAndMatchStyle()

Executes editing command pasteAndMatchStyle in page.

Link copied to clipboard
open fun prepend(vararg nodes: Any)
Link copied to clipboard
abstract fun print(options: WebviewTagPrintOptions = definedExternally): Promise<Void>

Prints webview's web page. Same as webContents.print([options]).

Link copied to clipboard
abstract fun printToPDF(options: PrintToPDFOptions): Promise<Uint8Array<*>>

Resolves with the generated PDF data.

Link copied to clipboard
open fun querySelector(selectors: String): Element?
open fun <T : HTMLElement> querySelector(selectors: HtmlTagName<T>): T?
open fun <T : MathMLElement> querySelector(selectors: MathMLTagName<T>): T?
open fun <T : SVGElement> querySelector(selectors: SvgTagName<T>): T?
Link copied to clipboard
Link copied to clipboard
abstract fun redo()

Executes editing command redo in page.

Link copied to clipboard
fun releasePointerCapture(pointerId: Int)
Link copied to clipboard
abstract fun reload()

Reloads the guest page.

Link copied to clipboard
abstract fun reloadIgnoringCache()

Reloads the guest page and ignores cache.

Link copied to clipboard
open fun remove()
Link copied to clipboard
fun removeAttribute(qualifiedName: String)
Link copied to clipboard
Link copied to clipboard
fun removeAttributeNS(namespace: String?, localName: String)
Link copied to clipboard
fun <T : Node> removeChild(child: T): T
Link copied to clipboard
abstract fun removeInsertedCSS(key: String): Promise<Void>

Resolves if the removal was successful.

Link copied to clipboard
abstract fun replace(text: String)

Executes editing command replace in page.

Link copied to clipboard
fun <T : Node> replaceChild(node: Node, child: T): T
Link copied to clipboard
open fun replaceChildren(vararg nodes: Any)
Link copied to clipboard
abstract fun replaceMisspelling(text: String)

Executes editing command replaceMisspelling in page.

Link copied to clipboard
open fun replaceWith(vararg nodes: Any)
Link copied to clipboard
suspend fun requestFullscreen(options: FullscreenOptions)
Link copied to clipboard
Link copied to clipboard
fun scroll(options: ScrollToOptions)
fun scroll(x: Double, y: Double)
Link copied to clipboard
fun scrollBy(x: Double, y: Double)
Link copied to clipboard
Link copied to clipboard
fun scrollTo(x: Double, y: Double)
Link copied to clipboard
abstract fun scrollToBottom()

Scrolls to the bottom of the current <webview>.

Link copied to clipboard
abstract fun scrollToTop()

Scrolls to the top of the current <webview>.

Link copied to clipboard
abstract fun selectAll()

Executes editing command selectAll in page.

Link copied to clipboard
abstract fun send(channel: String, vararg args: Any?): Promise<Void>

Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. The renderer process can handle the message by listening to the channel event with the ipcRenderer module.

Link copied to clipboard

Sends an input event to the page.

Link copied to clipboard
abstract fun sendToFrame(frameId: JsTuple2<Double, Double>, channel: String, vararg args: Any?): Promise<Void>

Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. The renderer process can handle the message by listening to the channel event with the ipcRenderer module.

Link copied to clipboard
fun setAttribute(qualifiedName: String, value: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setAttributeNS(namespace: String?, qualifiedName: String, value: String)
Link copied to clipboard
abstract fun setAudioMuted(muted: Boolean)

Set guest page muted.

Link copied to clipboard
Link copied to clipboard
fun setPointerCapture(pointerId: Int)
Link copied to clipboard
abstract fun setUserAgent(userAgent: String)

Overrides the user agent for the guest page.

Link copied to clipboard
abstract fun setVisualZoomLevelLimits(minimumLevel: Double, maximumLevel: Double): Promise<Void>

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

Link copied to clipboard
abstract 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 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. The formula for this is scale := 1.2 ^ level.

Link copied to clipboard

Shows pop-up dictionary that searches the selected word on the page.

Link copied to clipboard
Link copied to clipboard
abstract fun stop()

Stops any pending navigation.

Link copied to clipboard

Stops any findInPage request for the webview with the provided action.

Link copied to clipboard
fun toggleAttribute(qualifiedName: String, force: Boolean): Boolean
Link copied to clipboard
Link copied to clipboard
abstract fun undo()

Executes editing command undo in page.

Link copied to clipboard
abstract fun unselect()

Executes editing command unselect in page.