Optional
urlRemote 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.
Optional
transparentWhether 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
.
Optional
focusWhether the webview should have focus or not
Optional
dragWhether 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.
Optional
acceptWhether clicking an inactive webview also clicks through to the webview on macOS.
Optional
userThe user agent for the webview.
Optional
incognitoOptional
proxyOptional
zoomWhether 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.
Optional
useSets 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.
Optional
devtoolsWhether 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.Optional
backgroundOptional
backgroundChange 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
Optional
javascriptWhether we should disable JavaScript code execution on the webview or not.
Optional
allowon 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
Optional
disableAllows 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.
Configuration for the webview to create.
Since
2.0.0