OptionalurlRemote URL or local file path to open.
https://github.com/tauri-apps is opened directly on a Tauri webview.data:text/html,<html>... is only supported with the webview-data-url Cargo feature for the tauri dependency./path/to/page.html or /users is appended to the application URL (the devServer URL on development, or tauri://localhost/ and https://tauri.localhost/ on production).The initial vertical position.
The initial horizontal position.
The initial width.
The initial height.
OptionaltransparentWhether the webview is transparent or not.
Note that on macOS this requires the macos-private-api feature flag, enabled under tauri.conf.json > app > macOSPrivateApi.
WARNING: Using private APIs on macOS prevents your application from being accepted to the App Store.
OptionalfocusWhether the webview should have focus or not
OptionaldragWhether the drag and drop is enabled or not on the webview. By default it is enabled.
Disabling it is required to use HTML5 drag and drop on the frontend on Windows.
OptionalacceptWhether clicking an inactive webview also clicks through to the webview on macOS.
OptionaluserThe user agent for the webview.
OptionalincognitoOptionalproxyOptionalzoomWhether page zooming by hotkeys is enabled
Windows: Controls WebView2's IsZoomControlEnabled setting.
MacOS / Linux: Injects a polyfill that zooms in and out with ctrl/command + -/=,
20% in each step, ranging from 20% to 1000%. Requires webview:allow-set-webview-zoom permission
Android / iOS: Unsupported.
OptionaluseSets whether the custom protocols should use https://<scheme>.localhost instead of the default http://<scheme>.localhost on Windows and Android. Defaults to false.
Using a https scheme will NOT allow mixed content when trying to fetch http endpoints and therefore will not match the behavior of the <scheme>://localhost protocols used on macOS and Linux.
Changing this value between releases will change the IndexedDB, cookies and localstorage location and your app will not be able to access them.
OptionaldevtoolsWhether web inspector, which is usually called browser devtools, is enabled or not. Enabled by default.
This API works in debug builds, but requires devtools feature flag to enable it in release builds.
chrome://inspect/#devices in Chrome to get the devtools window. Wry's WebView devtools API isn't supported on Android.OptionalbackgroundOptionalbackgroundChange the default background throttling behaviour.
By default, browsers use a suspend policy that will throttle timers and even unload the whole tab (view) to free resources after roughly 5 minutes when a view became minimized or hidden. This will pause all tasks until the documents visibility state changes back from hidden to visible by bringing the view back to the foreground.
see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578
OptionaljavascriptWhether we should disable JavaScript code execution on the webview or not.
Optionalallowon macOS and iOS there is a link preview on long pressing links, this is enabled by default. see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview
OptionaldisableAllows disabling the input accessory view on iOS.
The accessory view is the view that appears above the keyboard when a text input element is focused. It usually displays a view with "Done", "Next" buttons.
OptionaldataSet a custom path for the webview's data directory (localStorage, cache, etc.) relative to [appDataDir()]/${label}.
For security reasons, paths outside of that location can only be configured on the Rust side.
additionalBrowserArgs, browserExtensionsEnabled or scrollBarStyle must have different data directories.dataStoreIdentifier instead.OptionaldataInitialize the WebView with a custom data store identifier. This can be seen as a replacement for dataDirectory which is unavailable in WKWebView.
See https://developer.apple.com/documentation/webkit/wkwebsitedatastore/init(foridentifier:)?language=objc
The array must contain 16 u8 numbers.
OptionalscrollSpecifies the native scrollbar style to use with the webview. CSS styles that modify the scrollbar are applied on top of the native appearance configured here.
Defaults to default, which is the browser default.
fluentOverlay requires WebView2 Runtime version 125.0.2535.41 or higher, and does nothing
on older versions.Default and performs no operation.
Configuration for the webview to create.
Since
2.0.0