WebContents

external class WebContents : EventEmitter(source)

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

A boolean property that determines whether this page is muted.

Link copied to clipboard

A boolean property that determines whether or not this WebContents will throttle animations and timers when the page becomes backgrounded. This also affects the Page Visibility API.

Link copied to clipboard

A Debugger instance for this webContents.

Link copied to clipboard

A WebContents | null property that represents the of DevTools WebContents associated with a given WebContents.

Link copied to clipboard

An Integer property that sets the frame rate of the web contents to the specified number. Only values between 1 and 240 are accepted.

Link copied to clipboard

A WebContents instance that might own this WebContents.

Link copied to clipboard
val id: Double

A Integer representing the unique ID of this WebContents. Each ID is unique among all WebContents instances of the entire Electron application.

Link copied to clipboard

An IpcMain scoped to just IPC messages sent from this WebContents.

Link copied to clipboard

A WebFrameMain property that represents the top frame of the page's frame hierarchy.

Link copied to clipboard

A NavigationHistory used by this webContents.

Link copied to clipboard

A WebFrameMain property that represents the frame that opened this WebContents, either with open(), or by navigating a link with a target attribute.

Link copied to clipboard

A Session used by this webContents.

Link copied to clipboard

A string property that determines the user agent for this web page.

Link copied to clipboard

A number property that determines the zoom factor for this web contents.

Link copied to clipboard

A number property that determines the zoom level for this web contents.

Functions

Link copied to clipboard
fun addListener(event: WebContentsEvent.BEFORE_INPUT_EVENT, listener: (event: Event<*>, input: Input) -> Unit)
fun addListener(event: WebContentsEvent.CERTIFICATE_ERROR, listener: (event: Event<*>, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit, isMainFrame: Boolean) -> Unit)
fun addListener(event: WebContentsEvent.CONSOLE_MESSAGE, listener: (event: Event<*>, level: Double, message: String, line: Double, sourceId: String) -> Unit)
fun addListener(event: WebContentsEvent.CONTENT_BOUNDS_UPDATED, listener: (event: Event<*>, bounds: Rectangle) -> Unit)
fun addListener(event: WebContentsEvent.CONTEXT_MENU, listener: (event: Event<*>, params: ContextMenuParams) -> Unit)
fun addListener(event: WebContentsEvent.CURSOR_CHANGED, listener: (event: Event<*>, type: String, image: NativeImage, scale: Double, size: Size, hotspot: Point) -> Unit)
fun addListener(event: WebContentsEvent.DEVTOOLS_OPEN_URL, listener: (event: Event<*>, url: String) -> Unit)
fun addListener(event: WebContentsEvent.DID_ATTACH_WEBVIEW, listener: (event: Event<*>, webContents: WebContents) -> Unit)
fun addListener(event: WebContentsEvent.DID_CHANGE_THEME_COLOR, listener: (event: Event<*>, color: String?) -> Unit)
fun addListener(event: WebContentsEvent.DID_FAIL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.DID_FAIL_PROVISIONAL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.DID_FRAME_FINISH_LOAD, listener: (event: Event<*>, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.DID_FRAME_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.DID_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String) -> Unit)
fun addListener(event: WebContentsEvent.DID_NAVIGATE_IN_PAGE, listener: (event: Event<*>, url: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.DID_REDIRECT_NAVIGATION, listener: (details: Event<WebContentsDidRedirectNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.DID_START_NAVIGATION, listener: (details: Event<WebContentsDidStartNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.FOUND_IN_PAGE, listener: (event: Event<*>, result: Result) -> Unit)
fun addListener(event: WebContentsEvent.FRAME_CREATED, listener: (event: Event<*>, details: FrameCreatedDetails) -> Unit)
fun addListener(event: WebContentsEvent.INPUT_EVENT, listener: (event: Event<*>, inputEvent: InputEvent) -> Unit)
fun addListener(event: WebContentsEvent.LOGIN, listener: (event: Event<*>, authenticationResponseDetails: AuthenticationResponseDetails, authInfo: AuthInfo, callback: (username: String?, password: String?) -> Unit) -> Unit)
fun addListener(event: WebContentsEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun addListener(event: WebContentsEvent.PAINT, listener: (event: Event<*>, dirtyRect: Rectangle, image: NativeImage) -> Unit)
fun addListener(event: WebContentsEvent.PLUGIN_CRASHED, listener: (event: Event<*>, name: String, version: String) -> Unit)
fun addListener(event: WebContentsEvent.PREFERRED_SIZE_CHANGED, listener: (event: Event<*>, preferredSize: Size) -> Unit)
fun addListener(event: WebContentsEvent.PRELOAD_ERROR, listener: (event: Event<*>, preloadPath: String, JsError) -> Unit)
fun addListener(event: WebContentsEvent.SELECT_BLUETOOTH_DEVICE, listener: (event: Event<*>, ReadonlyArray<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit)
fun addListener(event: WebContentsEvent.SELECT_CLIENT_CERTIFICATE, listener: (event: Event<*>, url: String, ReadonlyArray<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit)
fun addListener(event: WebContentsEvent.UPDATE_TARGET_URL, listener: (event: Event<*>, url: String) -> Unit)
fun addListener(event: WebContentsEvent.WILL_ATTACH_WEBVIEW, listener: (event: Event<*>, webPreferences: WebPreferences, params: ReadonlyRecord<String, String>) -> Unit)
fun addListener(event: WebContentsEvent.WILL_NAVIGATE, listener: (details: Event<WebContentsWillNavigateEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun addListener(event: WebContentsEvent.WILL_PREVENT_UNLOAD, listener: (event: Event<*>) -> Unit)
fun addListener(event: WebContentsEvent.WILL_REDIRECT, listener: (details: Event<WebContentsWillRedirectEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
Link copied to clipboard
fun addWorkSpace(path: String)

Adds the specified path to DevTools workspace. Must be used after DevTools creation:

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
fun beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) -> Unit)
fun beginFrameSubscription(onlyDirty: Boolean, callback: (image: NativeImage, dirtyRect: Rectangle) -> Unit)

Begin subscribing for presentation events and captured frames, the callback will be called with callback(image, dirtyRect) when there is a presentation event.

Link copied to clipboard

Whether the browser can go back to previous web page.

Link copied to clipboard

Whether the browser can go forward to next web page.

Link copied to clipboard

Whether the web page can go to offset.

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

Resolves with a NativeImage

Link copied to clipboard

Centers the current text selection in web page.

Link copied to clipboard

Clears the navigation history.

Link copied to clipboard
fun close(opts: CloseOpts = definedExternally)

Closes the page, as if the web content had called window.close().

Link copied to clipboard

Closes the devtools.

Link copied to clipboard
fun copy()

Executes the editing command copy in web page.

Link copied to clipboard

Copy the image at the given position to the clipboard.

Link copied to clipboard
fun cut()

Executes the editing command cut in web page.

Link copied to clipboard
fun delete()

Executes the editing command delete in web page.

Link copied to clipboard

Disable device emulation enabled by webContents.enableDeviceEmulation.

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

Initiates a download of the resource at url without navigating. The will-download event of session will be triggered.

Link copied to clipboard

Enable device emulation with the given parameters.

Link copied to clipboard

End subscribing for frame presentation events.

Link copied to clipboard
Link copied to clipboard
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
fun executeJavaScriptInIsolatedWorld(worldId: Double, scripts: ReadonlyArray<WebSource>, 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
fun findInPage(text: String, options: FindInPageOptions = definedExternally): Double

The request id used for the request.

Link copied to clipboard
fun focus()

Focuses the web page.

Link copied to clipboard

Forcefully terminates the renderer process that is currently hosting this webContents. This will cause the render-process-gone event to be emitted with the reason=killed || reason=crashed. Please note that some webContents share renderer processes and therefore calling this method may also crash the host process for other webContents as well.

Link copied to clipboard

Information about all Shared Workers.

Link copied to clipboard

whether or not this WebContents will throttle animations and timers when the page becomes backgrounded. This also affects the Page Visibility API.

Link copied to clipboard

the current title of the DevTools window. This will only be visible if DevTools is opened in undocked or detach mode.

Link copied to clipboard

If offscreen rendering is enabled returns the current frame rate.

Link copied to clipboard
Link copied to clipboard
fun getMediaSourceId(requestWebContents: WebContents): String

The identifier of a WebContents stream. This identifier can be used with navigator.mediaDevices.getUserMedia using a chromeMediaSource of tab. The identifier is restricted to the web contents that it is registered to and is only valid for 10 seconds.

Link copied to clipboard

The operating system pid of the associated renderer process.

Link copied to clipboard

Get the system printer list.

Link copied to clipboard

The Chromium internal pid of the associated renderer. Can be compared to the frameProcessId passed by frame specific navigation events (e.g. did-frame-navigate)

Link copied to clipboard

The title of the current web page.

Link copied to clipboard

the type of the webContent. Can be backgroundPage, window, browserView, remote, webview or offscreen.

Link copied to clipboard
fun getURL(): String

The URL of the current web page.

Link copied to clipboard

The user agent for this web page.

Link copied to clipboard

Returns the WebRTC IP Handling Policy.

Link copied to clipboard

By default this value is { min: 0, max: 0 } , which would apply no restriction on the udp port range.

Link copied to clipboard

the current zoom factor.

Link copied to clipboard

the current zoom level.

Link copied to clipboard
fun goBack()

Makes the browser go back a web page.

Link copied to clipboard
fun goForward()

Makes the browser go forward a web page.

Link copied to clipboard
fun goToIndex(index: Double)

Navigates browser to the specified absolute web page index.

Link copied to clipboard
fun goToOffset(offset: Double)

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

Link copied to clipboard
fun insertCSS(css: String, options: InsertCSSOptions = definedExternally): Promise<String>

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

Link copied to clipboard

Inserts text to the focused element.

Link copied to clipboard

Starts inspecting element at position (x, y).

Link copied to clipboard

Opens the developer tools for the service worker context.

Link copied to clipboard

Opens the developer tools for the shared worker context.

Link copied to clipboard

Inspects the shared worker based on its ID.

Link copied to clipboard

Schedules a full repaint of the window this web contents is in.

Link copied to clipboard

Whether this page has been muted.

Link copied to clipboard

Whether this page is being captured. It returns true when the capturer count is large then 0.

Link copied to clipboard

Whether the renderer process has crashed.

Link copied to clipboard

Whether audio is currently playing.

Link copied to clipboard

Whether the web page is destroyed.

Link copied to clipboard

Whether the devtools view is focused .

Link copied to clipboard

Whether the devtools is opened.

Link copied to clipboard

Whether the web page is focused.

Link copied to clipboard

Whether web page is still loading resources.

Link copied to clipboard

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

Link copied to clipboard

Indicates whether offscreen rendering is enabled.

Link copied to clipboard

If offscreen rendering is enabled returns whether it is currently painting.

Link copied to clipboard

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

Link copied to clipboard
fun loadFile(filePath: String, options: LoadFileOptions = 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
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). A noop rejection handler is already attached, which avoids unhandled rejection errors.

Link copied to clipboard
fun off(event: WebContentsEvent.BEFORE_INPUT_EVENT, listener: (event: Event<*>, input: Input) -> Unit)
fun off(event: WebContentsEvent.BLUR, listener: Function<Unit>)
fun off(event: WebContentsEvent.CERTIFICATE_ERROR, listener: (event: Event<*>, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit, isMainFrame: Boolean) -> Unit)
fun off(event: WebContentsEvent.CONSOLE_MESSAGE, listener: (event: Event<*>, level: Double, message: String, line: Double, sourceId: String) -> Unit)
fun off(event: WebContentsEvent.CONTENT_BOUNDS_UPDATED, listener: (event: Event<*>, bounds: Rectangle) -> Unit)
fun off(event: WebContentsEvent.CONTEXT_MENU, listener: (event: Event<*>, params: ContextMenuParams) -> Unit)
fun off(event: WebContentsEvent.CURSOR_CHANGED, listener: (event: Event<*>, type: String, image: NativeImage, scale: Double, size: Size, hotspot: Point) -> Unit)
fun off(event: WebContentsEvent.DEVTOOLS_OPEN_URL, listener: (event: Event<*>, url: String) -> Unit)
fun off(event: WebContentsEvent.DID_ATTACH_WEBVIEW, listener: (event: Event<*>, webContents: WebContents) -> Unit)
fun off(event: WebContentsEvent.DID_CHANGE_THEME_COLOR, listener: (event: Event<*>, color: String?) -> Unit)
fun off(event: WebContentsEvent.DID_FAIL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.DID_FAIL_PROVISIONAL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.DID_FRAME_FINISH_LOAD, listener: (event: Event<*>, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.DID_FRAME_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.DID_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String) -> Unit)
fun off(event: WebContentsEvent.DID_NAVIGATE_IN_PAGE, listener: (event: Event<*>, url: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.DID_REDIRECT_NAVIGATION, listener: (details: Event<WebContentsDidRedirectNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.DID_START_NAVIGATION, listener: (details: Event<WebContentsDidStartNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.FOCUS, listener: Function<Unit>)
fun off(event: WebContentsEvent.FOUND_IN_PAGE, listener: (event: Event<*>, result: Result) -> Unit)
fun off(event: WebContentsEvent.FRAME_CREATED, listener: (event: Event<*>, details: FrameCreatedDetails) -> Unit)
fun off(event: WebContentsEvent.INPUT_EVENT, listener: (event: Event<*>, inputEvent: InputEvent) -> Unit)
fun off(event: WebContentsEvent.LOGIN, listener: (event: Event<*>, authenticationResponseDetails: AuthenticationResponseDetails, authInfo: AuthInfo, callback: (username: String?, password: String?) -> Unit) -> Unit)
fun off(event: WebContentsEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun off(event: WebContentsEvent.PAINT, listener: (event: Event<*>, dirtyRect: Rectangle, image: NativeImage) -> Unit)
fun off(event: WebContentsEvent.PLUGIN_CRASHED, listener: (event: Event<*>, name: String, version: String) -> Unit)
fun off(event: WebContentsEvent.PREFERRED_SIZE_CHANGED, listener: (event: Event<*>, preferredSize: Size) -> Unit)
fun off(event: WebContentsEvent.PRELOAD_ERROR, listener: (event: Event<*>, preloadPath: String, JsError) -> Unit)
fun off(event: WebContentsEvent.RENDER_PROCESS_GONE, listener: (event: Event<*>, details: RenderProcessGoneDetails) -> Unit)
fun off(event: WebContentsEvent.SELECT_BLUETOOTH_DEVICE, listener: (event: Event<*>, ReadonlyArray<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit)
fun off(event: WebContentsEvent.SELECT_CLIENT_CERTIFICATE, listener: (event: Event<*>, url: String, ReadonlyArray<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit)
fun off(event: WebContentsEvent.UPDATE_TARGET_URL, listener: (event: Event<*>, url: String) -> Unit)
fun off(event: WebContentsEvent.WILL_ATTACH_WEBVIEW, listener: (event: Event<*>, webPreferences: WebPreferences, params: ReadonlyRecord<String, String>) -> Unit)
fun off(event: WebContentsEvent.WILL_NAVIGATE, listener: (details: Event<WebContentsWillNavigateEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.WILL_PREVENT_UNLOAD, listener: (event: Event<*>) -> Unit)
fun off(event: WebContentsEvent.WILL_REDIRECT, listener: (details: Event<WebContentsWillRedirectEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun off(event: WebContentsEvent.ZOOM_CHANGED, listener: (event: Event<*>, zoomDirection: WebContentsOffListenerZoomDirection) -> Unit)
Link copied to clipboard

Emitted when media becomes audible or inaudible.

fun on(event: WebContentsEvent.BEFORE_INPUT_EVENT, listener: (event: Event<*>, input: Input) -> Unit)

Emitted before dispatching the keydown and keyup events in the page. Calling event.preventDefault will prevent the page keydown/keyup events and the menu shortcuts.

fun on(event: WebContentsEvent.BLUR, listener: Function<Unit>)

Emitted when the WebContents loses focus.

fun on(event: WebContentsEvent.CERTIFICATE_ERROR, listener: (event: Event<*>, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit, isMainFrame: Boolean) -> Unit)

Emitted when failed to verify the certificate for url.

fun on(event: WebContentsEvent.CONSOLE_MESSAGE, listener: (event: Event<*>, level: Double, message: String, line: Double, sourceId: String) -> Unit)

Emitted when the associated window logs a console message.

fun on(event: WebContentsEvent.CONTENT_BOUNDS_UPDATED, listener: (event: Event<*>, bounds: Rectangle) -> Unit)

Emitted when the page calls window.moveTo, window.resizeTo or related APIs.

fun on(event: WebContentsEvent.CONTEXT_MENU, listener: (event: Event<*>, params: ContextMenuParams) -> Unit)

Emitted when there is a new context menu that needs to be handled.

fun on(event: WebContentsEvent.CURSOR_CHANGED, listener: (event: Event<*>, type: String, image: NativeImage, scale: Double, size: Size, hotspot: Point) -> Unit)

Emitted when the cursor's type changes. The type parameter can be pointer, crosshair, hand, text, wait, help, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize, ns-resize, ew-resize, nesw-resize, nwse-resize, col-resize, row-resize, m-panning, m-panning-vertical, m-panning-horizontal, e-panning, n-panning, ne-panning, nw-panning, s-panning, se-panning, sw-panning, w-panning, move, vertical-text, cell, context-menu, alias, progress, nodrop, copy, none, not-allowed, zoom-in, zoom-out, grab, grabbing, custom, null, drag-drop-none, drag-drop-move, drag-drop-copy, drag-drop-link, ns-no-resize, ew-no-resize, nesw-no-resize, nwse-no-resize, or default.

fun on(event: WebContentsEvent.DESTROYED, listener: Function<Unit>)

Emitted when webContents is destroyed.

Emitted when DevTools is closed.

Emitted when DevTools is focused / opened.

Emitted when DevTools is opened.

fun on(event: WebContentsEvent.DEVTOOLS_OPEN_URL, listener: (event: Event<*>, url: String) -> Unit)

Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for a link in its context menu.

Emitted when the devtools window instructs the webContents to reload

fun on(event: WebContentsEvent.DID_ATTACH_WEBVIEW, listener: (event: Event<*>, webContents: WebContents) -> Unit)

Emitted when a <webview> has been attached to this web contents.

fun on(event: WebContentsEvent.DID_CHANGE_THEME_COLOR, listener: (event: Event<*>, color: String?) -> Unit)

Emitted when a page's theme color changes. This is usually due to encountering a meta tag:

fun on(event: WebContentsEvent.DID_CREATE_WINDOW, listener: (window: BrowserWindow, details: DidCreateWindowDetails) -> Unit)

Emitted after successful creation of a window via window.open in the renderer. Not emitted if the creation of the window is canceled from webContents.setWindowOpenHandler.

fun on(event: WebContentsEvent.DID_FAIL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

This event is like did-finish-load but emitted when the load failed. The full list of error codes and their meaning is available here.

fun on(event: WebContentsEvent.DID_FAIL_PROVISIONAL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

This event is like did-fail-load but emitted when the load was cancelled (e.g. window.stop() was invoked).

Emitted when the navigation is done, i.e. the spinner of the tab has stopped spinning, and the onload event was dispatched.

fun on(event: WebContentsEvent.DID_FRAME_FINISH_LOAD, listener: (event: Event<*>, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted when a frame has done navigation.

fun on(event: WebContentsEvent.DID_FRAME_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted when any frame navigation is done.

fun on(event: WebContentsEvent.DID_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String) -> Unit)

Emitted when a main frame navigation is done.

fun on(event: WebContentsEvent.DID_NAVIGATE_IN_PAGE, listener: (event: Event<*>, url: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted when an in-page navigation happened in any frame.

fun on(event: WebContentsEvent.DID_REDIRECT_NAVIGATION, listener: (details: Event<WebContentsDidRedirectNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted after a server side redirect occurs during navigation. For example a 302 redirect.

Corresponds to the points in time when the spinner of the tab started spinning.

fun on(event: WebContentsEvent.DID_START_NAVIGATION, listener: (details: Event<WebContentsDidStartNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted when any frame (including main) starts navigating.

Corresponds to the points in time when the spinner of the tab stopped spinning.

fun on(event: WebContentsEvent.DOM_READY, listener: Function<Unit>)

Emitted when the document in the top-level frame is loaded.

Emitted when the window enters a full-screen state triggered by HTML API.

fun on(event: WebContentsEvent.FOCUS, listener: Function<Unit>)

Emitted when the WebContents gains focus.

fun on(event: WebContentsEvent.FOUND_IN_PAGE, listener: (event: Event<*>, result: Result) -> Unit)

Emitted when a result is available for webContents.findInPage request.

fun on(event: WebContentsEvent.FRAME_CREATED, listener: (event: Event<*>, details: FrameCreatedDetails) -> Unit)

Emitted when the mainFrame, an <iframe>, or a nested <iframe> is loaded within the page.

fun on(event: WebContentsEvent.INPUT_EVENT, listener: (event: Event<*>, inputEvent: InputEvent) -> Unit)

Emitted when an input event is sent to the WebContents. See InputEvent for details.

Emitted when the renderer process sends an asynchronous message via ipcRenderer.send().

Emitted when the renderer process sends a synchronous message via ipcRenderer.sendSync().

Emitted when the window leaves a full-screen state triggered by HTML API.

fun on(event: WebContentsEvent.LOGIN, listener: (event: Event<*>, authenticationResponseDetails: AuthenticationResponseDetails, authInfo: AuthInfo, callback: (username: String?, password: String?) -> Unit) -> Unit)

Emitted when webContents wants to do basic auth.

Emitted when media is paused or done playing.

Emitted when media starts playing.

fun on(event: WebContentsEvent.PAGE_FAVICON_UPDATED, listener: (event: Event<*>, ReadonlyArray<String>) -> Unit)

Emitted when page receives favicon urls.

fun on(event: WebContentsEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)

Fired when page title is set during navigation. explicitSet is false when title is synthesized from file url.

fun on(event: WebContentsEvent.PAINT, listener: (event: Event<*>, dirtyRect: Rectangle, image: NativeImage) -> Unit)

Emitted when a new frame is generated. Only the dirty area is passed in the buffer.

fun on(event: WebContentsEvent.PLUGIN_CRASHED, listener: (event: Event<*>, name: String, version: String) -> Unit)

Emitted when a plugin process has crashed.

fun on(event: WebContentsEvent.PREFERRED_SIZE_CHANGED, listener: (event: Event<*>, preferredSize: Size) -> Unit)

Emitted when the WebContents preferred size has changed.

fun on(event: WebContentsEvent.PRELOAD_ERROR, listener: (event: Event<*>, preloadPath: String, JsError) -> Unit)

Emitted when the preload script preloadPath throws an unhandled exception error.

fun on(event: WebContentsEvent.RENDER_PROCESS_GONE, listener: (event: Event<*>, details: RenderProcessGoneDetails) -> Unit)

Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed.

Emitted when the unresponsive web page becomes responsive again.

fun on(event: WebContentsEvent.SELECT_BLUETOOTH_DEVICE, listener: (event: Event<*>, ReadonlyArray<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit)

Emitted when a bluetooth device needs to be selected when a call to navigator.bluetooth.requestDevice is made. callback should be called with the deviceId of the device to be selected. Passing an empty string to callback will cancel the request.

fun on(event: WebContentsEvent.SELECT_CLIENT_CERTIFICATE, listener: (event: Event<*>, url: String, ReadonlyArray<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit)

Emitted when a client certificate is requested.

Emitted when the web page becomes unresponsive.

fun on(event: WebContentsEvent.UPDATE_TARGET_URL, listener: (event: Event<*>, url: String) -> Unit)

Emitted when mouse moves over a link or the keyboard moves the focus to a link.

fun on(event: WebContentsEvent.WILL_ATTACH_WEBVIEW, listener: (event: Event<*>, webPreferences: WebPreferences, params: ReadonlyRecord<String, String>) -> Unit)

Emitted when a <webview>'s web contents is being attached to this web contents. Calling event.preventDefault() will destroy the guest page.

Emitted when a user or the page wants to start navigation in any frame. It can happen when the window.location object is changed or a user clicks a link in the page.

fun on(event: WebContentsEvent.WILL_NAVIGATE, listener: (details: Event<WebContentsWillNavigateEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted when a user or the page wants to start navigation on the main frame. It can happen when the window.location object is changed or a user clicks a link in the page.

fun on(event: WebContentsEvent.WILL_PREVENT_UNLOAD, listener: (event: Event<*>) -> Unit)

Emitted when a beforeunload event handler is attempting to cancel a page unload.

fun on(event: WebContentsEvent.WILL_REDIRECT, listener: (details: Event<WebContentsWillRedirectEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)

Emitted when a server side redirect occurs during navigation. For example a 302 redirect.

fun on(event: WebContentsEvent.ZOOM_CHANGED, listener: (event: Event<*>, zoomDirection: WebContentsOnListenerZoomDirection) -> Unit)

Emitted when the user is requesting to change the zoom level using the mouse wheel.

Link copied to clipboard
fun once(event: WebContentsEvent.BEFORE_INPUT_EVENT, listener: (event: Event<*>, input: Input) -> Unit)
fun once(event: WebContentsEvent.BLUR, listener: Function<Unit>)
fun once(event: WebContentsEvent.CERTIFICATE_ERROR, listener: (event: Event<*>, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit, isMainFrame: Boolean) -> Unit)
fun once(event: WebContentsEvent.CONSOLE_MESSAGE, listener: (event: Event<*>, level: Double, message: String, line: Double, sourceId: String) -> Unit)
fun once(event: WebContentsEvent.CONTENT_BOUNDS_UPDATED, listener: (event: Event<*>, bounds: Rectangle) -> Unit)
fun once(event: WebContentsEvent.CONTEXT_MENU, listener: (event: Event<*>, params: ContextMenuParams) -> Unit)
fun once(event: WebContentsEvent.CURSOR_CHANGED, listener: (event: Event<*>, type: String, image: NativeImage, scale: Double, size: Size, hotspot: Point) -> Unit)
fun once(event: WebContentsEvent.DEVTOOLS_OPEN_URL, listener: (event: Event<*>, url: String) -> Unit)
fun once(event: WebContentsEvent.DID_ATTACH_WEBVIEW, listener: (event: Event<*>, webContents: WebContents) -> Unit)
fun once(event: WebContentsEvent.DID_CHANGE_THEME_COLOR, listener: (event: Event<*>, color: String?) -> Unit)
fun once(event: WebContentsEvent.DID_FAIL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.DID_FAIL_PROVISIONAL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.DID_FRAME_FINISH_LOAD, listener: (event: Event<*>, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.DID_FRAME_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.DID_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String) -> Unit)
fun once(event: WebContentsEvent.DID_NAVIGATE_IN_PAGE, listener: (event: Event<*>, url: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.DID_REDIRECT_NAVIGATION, listener: (details: Event<WebContentsDidRedirectNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.DID_START_NAVIGATION, listener: (details: Event<WebContentsDidStartNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.FOCUS, listener: Function<Unit>)
fun once(event: WebContentsEvent.FOUND_IN_PAGE, listener: (event: Event<*>, result: Result) -> Unit)
fun once(event: WebContentsEvent.FRAME_CREATED, listener: (event: Event<*>, details: FrameCreatedDetails) -> Unit)
fun once(event: WebContentsEvent.INPUT_EVENT, listener: (event: Event<*>, inputEvent: InputEvent) -> Unit)
fun once(event: WebContentsEvent.LOGIN, listener: (event: Event<*>, authenticationResponseDetails: AuthenticationResponseDetails, authInfo: AuthInfo, callback: (username: String?, password: String?) -> Unit) -> Unit)
fun once(event: WebContentsEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun once(event: WebContentsEvent.PAINT, listener: (event: Event<*>, dirtyRect: Rectangle, image: NativeImage) -> Unit)
fun once(event: WebContentsEvent.PLUGIN_CRASHED, listener: (event: Event<*>, name: String, version: String) -> Unit)
fun once(event: WebContentsEvent.PREFERRED_SIZE_CHANGED, listener: (event: Event<*>, preferredSize: Size) -> Unit)
fun once(event: WebContentsEvent.PRELOAD_ERROR, listener: (event: Event<*>, preloadPath: String, JsError) -> Unit)
fun once(event: WebContentsEvent.RENDER_PROCESS_GONE, listener: (event: Event<*>, details: RenderProcessGoneDetails) -> Unit)
fun once(event: WebContentsEvent.SELECT_BLUETOOTH_DEVICE, listener: (event: Event<*>, ReadonlyArray<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit)
fun once(event: WebContentsEvent.SELECT_CLIENT_CERTIFICATE, listener: (event: Event<*>, url: String, ReadonlyArray<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit)
fun once(event: WebContentsEvent.UPDATE_TARGET_URL, listener: (event: Event<*>, url: String) -> Unit)
fun once(event: WebContentsEvent.WILL_ATTACH_WEBVIEW, listener: (event: Event<*>, webPreferences: WebPreferences, params: ReadonlyRecord<String, String>) -> Unit)
fun once(event: WebContentsEvent.WILL_NAVIGATE, listener: (details: Event<WebContentsWillNavigateEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.WILL_PREVENT_UNLOAD, listener: (event: Event<*>) -> Unit)
fun once(event: WebContentsEvent.WILL_REDIRECT, listener: (details: Event<WebContentsWillRedirectEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun once(event: WebContentsEvent.ZOOM_CHANGED, listener: (event: Event<*>, zoomDirection: WebContentsOnceListenerZoomDirection) -> Unit)
Link copied to clipboard
fun openDevTools(options: OpenDevToolsOptions = definedExternally)

Opens the devtools.

Link copied to clipboard
fun paste()

Executes the editing command paste in web page.

Link copied to clipboard

Executes the editing command pasteAndMatchStyle in web page.

Link copied to clipboard
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
fun print(options: WebContentsPrintOptions = definedExternally, callback: (success: Boolean, failureReason: String) -> Unit = definedExternally)

When a custom pageSize is passed, Chromium attempts to validate platform specific minimum values for width_microns and height_microns. Width and height must both be minimum 353 microns but may be higher on some operating systems.

Link copied to clipboard

Resolves with the generated PDF data.

Link copied to clipboard
fun redo()

Executes the editing command redo in web page.

Link copied to clipboard
fun reload()

Reloads the current web page.

Link copied to clipboard

Reloads current page and ignores cache.

Link copied to clipboard

Resolves if the removal was successful.

Link copied to clipboard
fun removeListener(event: WebContentsEvent.BEFORE_INPUT_EVENT, listener: (event: Event<*>, input: Input) -> Unit)
fun removeListener(event: WebContentsEvent.CERTIFICATE_ERROR, listener: (event: Event<*>, url: String, error: String, certificate: Certificate, callback: (isTrusted: Boolean) -> Unit, isMainFrame: Boolean) -> Unit)
fun removeListener(event: WebContentsEvent.CONSOLE_MESSAGE, listener: (event: Event<*>, level: Double, message: String, line: Double, sourceId: String) -> Unit)
fun removeListener(event: WebContentsEvent.CONTENT_BOUNDS_UPDATED, listener: (event: Event<*>, bounds: Rectangle) -> Unit)
fun removeListener(event: WebContentsEvent.CONTEXT_MENU, listener: (event: Event<*>, params: ContextMenuParams) -> Unit)
fun removeListener(event: WebContentsEvent.CURSOR_CHANGED, listener: (event: Event<*>, type: String, image: NativeImage, scale: Double, size: Size, hotspot: Point) -> Unit)
fun removeListener(event: WebContentsEvent.DEVTOOLS_OPEN_URL, listener: (event: Event<*>, url: String) -> Unit)
fun removeListener(event: WebContentsEvent.DID_ATTACH_WEBVIEW, listener: (event: Event<*>, webContents: WebContents) -> Unit)
fun removeListener(event: WebContentsEvent.DID_CHANGE_THEME_COLOR, listener: (event: Event<*>, color: String?) -> Unit)
fun removeListener(event: WebContentsEvent.DID_FAIL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.DID_FAIL_PROVISIONAL_LOAD, listener: (event: Event<*>, errorCode: Double, errorDescription: String, validatedURL: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.DID_FRAME_FINISH_LOAD, listener: (event: Event<*>, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.DID_FRAME_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.DID_NAVIGATE, listener: (event: Event<*>, url: String, httpResponseCode: Double, httpStatusText: String) -> Unit)
fun removeListener(event: WebContentsEvent.DID_NAVIGATE_IN_PAGE, listener: (event: Event<*>, url: String, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.DID_REDIRECT_NAVIGATION, listener: (details: Event<WebContentsDidRedirectNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.DID_START_NAVIGATION, listener: (details: Event<WebContentsDidStartNavigationEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.FOUND_IN_PAGE, listener: (event: Event<*>, result: Result) -> Unit)
fun removeListener(event: WebContentsEvent.FRAME_CREATED, listener: (event: Event<*>, details: FrameCreatedDetails) -> Unit)
fun removeListener(event: WebContentsEvent.INPUT_EVENT, listener: (event: Event<*>, inputEvent: InputEvent) -> Unit)
fun removeListener(event: WebContentsEvent.LOGIN, listener: (event: Event<*>, authenticationResponseDetails: AuthenticationResponseDetails, authInfo: AuthInfo, callback: (username: String?, password: String?) -> Unit) -> Unit)
fun removeListener(event: WebContentsEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun removeListener(event: WebContentsEvent.PAINT, listener: (event: Event<*>, dirtyRect: Rectangle, image: NativeImage) -> Unit)
fun removeListener(event: WebContentsEvent.PLUGIN_CRASHED, listener: (event: Event<*>, name: String, version: String) -> Unit)
fun removeListener(event: WebContentsEvent.PREFERRED_SIZE_CHANGED, listener: (event: Event<*>, preferredSize: Size) -> Unit)
fun removeListener(event: WebContentsEvent.PRELOAD_ERROR, listener: (event: Event<*>, preloadPath: String, JsError) -> Unit)
fun removeListener(event: WebContentsEvent.SELECT_BLUETOOTH_DEVICE, listener: (event: Event<*>, ReadonlyArray<BluetoothDevice>, callback: (deviceId: String) -> Unit) -> Unit)
fun removeListener(event: WebContentsEvent.SELECT_CLIENT_CERTIFICATE, listener: (event: Event<*>, url: String, ReadonlyArray<Certificate>, callback: (certificate: Certificate) -> Unit) -> Unit)
fun removeListener(event: WebContentsEvent.UPDATE_TARGET_URL, listener: (event: Event<*>, url: String) -> Unit)
fun removeListener(event: WebContentsEvent.WILL_ATTACH_WEBVIEW, listener: (event: Event<*>, webPreferences: WebPreferences, params: ReadonlyRecord<String, String>) -> Unit)
fun removeListener(event: WebContentsEvent.WILL_NAVIGATE, listener: (details: Event<WebContentsWillNavigateEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
fun removeListener(event: WebContentsEvent.WILL_PREVENT_UNLOAD, listener: (event: Event<*>) -> Unit)
fun removeListener(event: WebContentsEvent.WILL_REDIRECT, listener: (details: Event<WebContentsWillRedirectEventParams>, url: String, isInPlace: Boolean, isMainFrame: Boolean, frameProcessId: Double, frameRoutingId: Double) -> Unit)
Link copied to clipboard

Removes the specified path from DevTools workspace.

Link copied to clipboard
fun replace(text: String)

Executes the editing command replace in web page.

Link copied to clipboard

Executes the editing command replaceMisspelling in web page.

Link copied to clipboard

resolves if the page is saved.

Link copied to clipboard

Scrolls to the bottom of the current webContents.

Link copied to clipboard

Scrolls to the top of the current webContents.

Link copied to clipboard
fun selectAll()

Executes the editing command selectAll in web page.

Link copied to clipboard
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

Sends an input event to the page. Note: The BrowserWindow containing the contents needs to be focused for sendInputEvent() to work.

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

Send an asynchronous message to a specific frame in a 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

Mute the audio on the current web page.

Link copied to clipboard

Controls whether or not this WebContents will throttle animations and timers when the page becomes backgrounded. This also affects the Page Visibility API.

Link copied to clipboard

Changes the title of the DevTools window to title. This will only be visible if DevTools is opened in undocked or detach mode.

Link copied to clipboard
fun setDevToolsWebContents(devToolsWebContents: WebContents)

Uses the devToolsWebContents as the target WebContents to show devtools.

Link copied to clipboard

If offscreen rendering is enabled sets the frame rate to the specified number. Only values between 1 and 240 are accepted.

Link copied to clipboard

Ignore application menu shortcuts while this web contents is focused.

Link copied to clipboard

Sets the image animation policy for this webContents. The policy only affects new images, existing images that are currently being animated are unaffected. This is a known limitation in Chromium, you can force image animation to be recalculated with img.src = img.src which will result in no network traffic but will update the animation policy.

Link copied to clipboard
Link copied to clipboard
fun setUserAgent(userAgent: String)

Overrides the user agent for this web page.

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

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

Link copied to clipboard

Setting the WebRTC IP handling policy allows you to control which IPs are exposed via WebRTC. See BrowserLeaks for more details.

Link copied to clipboard

Setting the WebRTC UDP Port Range allows you to restrict the udp port range used by WebRTC. By default the port range is unrestricted. Note: To reset to an unrestricted port range this value should be set to { min: 0, max: 0 }.

Link copied to clipboard
fun setWindowOpenHandler(handler: (details: HandlerDetails) -> Any)

Called before creating a window a new window is requested by the renderer, e.g. by window.open(), a link with target="_blank", shift+clicking on a link, or submitting a form with <form target="_blank">. See window.open() for more details and how to use this in conjunction with did-create-window.

Link copied to clipboard
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
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
fun startDrag(item: Item)

Sets the item as dragging item for current drag-drop operation, file is the absolute path of the file to be dragged, and icon is the image showing under the cursor when dragging.

Link copied to clipboard

If offscreen rendering is enabled and not painting, start painting.

Link copied to clipboard
fun stop()

Stops any pending navigation.

Link copied to clipboard

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

Link copied to clipboard

If offscreen rendering is enabled and painting, stop painting.

Link copied to clipboard

Indicates whether the snapshot has been created successfully.

Link copied to clipboard

Toggles the developer tools.

Link copied to clipboard
fun undo()

Executes the editing command undo in web page.

Link copied to clipboard
fun unselect()

Executes the editing command unselect in web page.