WebContents Module
Types and nested modules
| Type/Module | Description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: |
|
|
Emitted before dispatching mouse events in the page.Calling event.preventDefault will prevent the page mouse events. |
|
|
Emitted when failed to verify the certificate for url.The usage is the same with the certificate-error event of app. |
|
|
Emitted when the associated window logs a console message. |
|
|
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(). |
|
|
Emitted when there is a new context menu that needs to be handled. |
|
|
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. |
|
|
Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for a link in its context menu. |
|
|
Emitted when 'Search' is selected for text in its context menu. |
|
|
Emitted when a |
|
|
Emitted when a page's theme color changes. This is usually due to encountering a meta tag: |
|
|
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. |
|
|
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. |
|
|
This event is like did-fail-load but emitted when the load was cancelled (e.g. window.stop() was invoked). |
|
|
Emitted when a frame has done navigation. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
Emitted when any frame (including main) starts navigating. |
|
|
Emitted when a result is available for webContents.findInPage request. |
|
|
Emitted when the mainFrame, an |
|
|
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().See also webContents.ipc, which provides an IpcMain-like interface for responding to IPC messages specifically from this WebContents. |
|
|
Emitted when the renderer process sends a synchronous message via ipcRenderer.sendSync().See also webContents.ipc, which provides an IpcMain-like interface for responding to IPC messages specifically from this WebContents. |
|
|
Emitted when webContents wants to do basic auth.The usage is the same with the login event of app. |
|
|
Emitted when page receives favicon urls. |
|
|
Fired when page title is set during navigation. explicitSet is false when title is synthesized from file url. |
|
|
Emitted when a new frame is generated. Only the dirty area is passed in the buffer.When using shared texture (set webPreferences.offscreen.useSharedTexture to true) feature, you can pass the texture handle to external rendering pipeline without the overhead of copying data between CPU and GPU memory, with Chromium's hardware acceleration support. This feature is helpful for high-performance rendering scenarios.Only a limited number of textures can exist at the same time, so it's important that you call texture.release() as soon as you're done with the texture. By managing the texture lifecycle by yourself, you can safely pass the texture.textureInfo to other processes through IPC.More details can be found in the offscreen rendering tutorial. To learn about how to handle the texture in native code, refer to offscreen rendering's code documentation.. |
|
|
Emitted when the WebContents preferred size has changed.This event will only be emitted when enablePreferredSizeMode is set to true in webPreferences. |
|
|
Emitted when the preload script preloadPath throws an unhandled exception error. |
|
|
Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed. |
|
|
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.If no event listener is added for this event, all bluetooth requests will be cancelled.If event.preventDefault is not called when handling this event, the first available device will be automatically selected.Due to the nature of bluetooth, scanning for devices when navigator.bluetooth.requestDevice is called may take time and will cause select-bluetooth-device to fire multiple times until callback is called with either a device id or an empty string to cancel the request. |
|
|
Emitted when a client certificate is requested.The usage is the same with the select-client-certificate event of app. |
|
|
Emitted when mouse moves over a link or the keyboard moves the focus to a link. |
|
|
Emitted when a |
|
|
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.This event will not emit when the navigation is started programmatically with APIs like webContents.loadURL and webContents.back.It is also 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.Calling event.preventDefault() will prevent the navigation. |
|
|
Emitted when a server side redirect occurs during navigation. For example a 302 redirect.This event will be emitted after did-start-navigation and always before the did-redirect-navigation event for the same navigation.Calling event.preventDefault() will prevent the navigation (not just the redirect). |
|
|
Emitted when the user is requesting to change the zoom level using the mouse wheel. |
fable-electron-docs-api