Header menu logo fable-electron-docs-api

WebContents Module

Types and nested modules

Type/Module Description

AdjustSelection

BeforeInputEvent

BeginFrameSubscription

CapturePage

Close

ContextMenu

DidCreateWindow

DownloadURL

EnableDeviceEmulation

FindInPage

FoundInPage

FrameCreated

InsertCSS

LoadFile

LoadURL

Login

OpenDevTools

Print

PrintToPDF

SetWebRTCUDPPortRange

SetWindowOpenHandler

StartDrag

GetWebRTCUDPPortRange

IOnBeforeInputEvent

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.To only prevent the menu shortcuts, use setIgnoreMenuShortcuts:

IOnBeforeMouseEvent

Emitted before dispatching mouse events in the page.Calling event.preventDefault will prevent the page mouse events.

IOnCertificateError

Emitted when failed to verify the certificate for url.The usage is the same with the certificate-error event of app.

IOnConsoleMessage

Emitted when the associated window logs a console message.

IOnContentBoundsUpdated

Emitted when the page calls window.moveTo, window.resizeTo or related APIs.By default, this will move the window. To prevent that behavior, call event.preventDefault().

IOnContextMenu

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

IOnCursorChanged

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.If the type parameter is custom, the image parameter will hold the custom cursor image in a NativeImage, and scale, size and hotspot will hold additional information about the custom cursor.

IOnDevtoolsOpenUrl

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

IOnDevtoolsSearchQuery

Emitted when 'Search' is selected for text in its context menu.

IOnDidAttachWebview

Emitted when a has been attached to this web contents.

IOnDidChangeThemeColor

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

IOnDidCreateWindow

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.See window.open() for more details and how to use this in conjunction with webContents.setWindowOpenHandler.

IOnDidFailLoad

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.

IOnDidFailProvisionalLoad

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

IOnDidFrameFinishLoad

Emitted when a frame has done navigation.

IOnDidFrameNavigate

Emitted when any frame navigation is done.This event is not emitted for in-page navigations, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose.

IOnDidNavigate

Emitted when a main frame navigation is done.This event is not emitted for in-page navigations, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose.

IOnDidNavigateInPage

Emitted when an in-page navigation happened in any frame.When in-page navigation happens, the page URL changes but does not cause navigation outside of the page. Examples of this occurring are when anchor links are clicked or when the DOM hashchange event is triggered.

IOnDidRedirectNavigation

Emitted after a server side redirect occurs during navigation. For example a 302 redirect.This event cannot be prevented, if you want to prevent redirects you should checkout out the will-redirect event above.

IOnDidStartNavigation

Emitted when any frame (including main) starts navigating.

IOnFoundInPage

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

IOnFrameCreated

Emitted when the mainFrame, an