Webview
Create new webview or get a handle to an existing one.
Webviews are identified by a label a unique identifier that can be used to reference it later. It may only contain alphanumeric characters a-zA-Z plus the following special characters -, /, : and _.
Requires the unstable Cargo feature
Creating a webview with new Webview(...) adds a child webview to an existing window, which is an unstable API gated behind the unstable feature of the tauri crate:
[dependencies]
tauri = { version = "2", features = ["unstable"] }Without it the call rejects with an "unstable feature not supported" error. Getting a handle to an existing webview (Webview.getByLabel, {@link getCurrentWebview}, {@link getAllWebviews}) and every method on this class work without the feature. To create a window that hosts a single webview, use {@link WebviewWindow} instead, which is stable.
Since
2.0.0
Inheritors
Properties
Functions
Clears all browsing data for this webview: cookies, localStorage, IndexedDB, caches and any other data the webview stores for the loaded origins.
Listen to an emitted event on this webview.
Listen to an emitted event on this webview only once.
Listen to a file drop event. The listener is triggered when the user hovers the selected files on the webview, drops the files or cancels the operation.
The position of the top-left hand corner of the webview's client area relative to the top-left hand corner of the desktop.
Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes.
Specify the webview background color.
Sets the webview position.
The physical size of the webview's client area. The client area is the content of the webview, excluding the title bar and borders.