WebviewTag
Properties
A boolean
. When this attribute is present the guest page will be allowed to open new windows. Popups are disabled by default.
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.
A boolean
. When this attribute is present the guest page will have web security disabled. Web security is enabled by default.
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.
A string
that sets the referrer URL for the guest page.
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.
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.
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.
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.
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.
Functions
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.
Whether the guest page can go forward.
Whether the guest page can go to offset
.
Resolves with a NativeImage
Centers the current text selection in page.
Clears the navigation history.
Closes the DevTools window of guest page.
Initiates a download of the resource at url
without navigating.
A promise that resolves with the result of the executed code or is rejected if the result of the code is a rejected promise.
The request id used for the request.
The user agent for guest page.
The WebContents ID of this webview
.
the current zoom factor.
the current zoom level.
Navigates to the specified offset from the "current entry".
Inserts text
to the focused element.
Starts inspecting element at position (x
, y
) of guest page.
Opens the DevTools for the service worker context present in the guest page.
Opens the DevTools for the shared worker context present in the guest page.
Whether guest page has been muted.
Whether audio is currently playing.
Whether DevTools window of guest page is focused.
Whether guest page has a DevTools window attached.
Whether the main frame (and not just iframes or frames within it) is still loading.
Whether the guest page is waiting for a first-response for the main resource of the page.
Opens a DevTools window for guest page.
Executes editing command pasteAndMatchStyle
in page.
Prints webview
's web page. Same as webContents.print([options])
.
Resolves with the generated PDF data.
Reloads the guest page and ignores cache.
Resolves if the removal was successful.
Executes editing command replaceMisspelling
in page.
Scrolls to the bottom of the current <webview>
.
Scrolls to the top of the current <webview>
.
Sends an input event
to the page.
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.
Set guest page muted.
Overrides the user agent for the guest page.
Sets the maximum and minimum pinch-to-zoom level.
Changes the zoom factor to the specified factor. Zoom factor is zoom percent divided by 100, so 300% = 3.0.
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
.
Shows pop-up dictionary that searches the selected word on the page.
Stops any findInPage
request for the webview
with the provided action
.