Skip to content
Tauri

WebviewOptions

Defined in: webview.ts:707

Configuration for the webview to create.

2.0.0

optional acceptFirstMouse: boolean

Defined in: webview.ts:745

Whether clicking an inactive webview also clicks through to the webview on macOS.


optional allowLinkPreview: boolean

Defined in: webview.ts:849

on 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 backgroundColor: Color

Defined in: webview.ts:821

Set the window and webview background color.

  • macOS / iOS: Not implemented.
  • Windows:
    • On Windows 7, alpha channel is ignored.
    • On Windows 8 and newer, if alpha channel is not 0, it will be ignored.

2.1.0


optional backgroundThrottling: BackgroundThrottlingPolicy

Defined in: webview.ts:840

Change 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.

  • Linux / Windows / Android: Unsupported. Workarounds like a pending WebLock transaction might suffice.
  • iOS: Supported since version 17.0+.
  • macOS: Supported since version 14.0+.

see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578

2.3.0


optional devtools: boolean

Defined in: webview.ts:808

Whether 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.

  • macOS: This will call private functions on macOS.
  • Android: Open chrome://inspect/#devices in Chrome to get the devtools window. Wry’s WebView devtools API isn’t supported on Android.
  • iOS: Open Safari > Develop > [Your Device Name] > [Your WebView] to get the devtools window.

2.1.0


optional disableInputAccessoryView: boolean

Defined in: webview.ts:856

Allows 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.


optional dragDropEnabled: boolean

Defined in: webview.ts:741

Whether 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 focus: boolean

Defined in: webview.ts:735

Whether the webview should have focus or not

2.1.0


height: number

Defined in: webview.ts:723

The initial height.


optional incognito: boolean

Defined in: webview.ts:757

Whether or not the webview should be launched in incognito mode.

  • Android: Unsupported.

optional javascriptDisabled: boolean

Defined in: webview.ts:844

Whether we should disable JavaScript code execution on the webview or not.


optional proxyUrl: string

Defined in: webview.ts:767

The proxy URL for the WebView for all network requests.

Must be either a http:// or a socks5:// URL.

  • macOS: Requires the macos-proxy feature flag and only compiles for macOS 14+.

optional transparent: boolean

Defined in: webview.ts:729

Whether 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 url: string

Defined in: webview.ts:715

Remote URL or local file path to open.

  • URL such as https://github.com/tauri-apps is opened directly on a Tauri webview.
  • data: URL such as data:text/html,<html>... is only supported with the webview-data-url Cargo feature for the tauri dependency.
  • local file path or route such as /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).

optional useHttpsScheme: boolean

Defined in: webview.ts:794

Sets 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.

2.1.0


optional userAgent: string

Defined in: webview.ts:749

The user agent for the webview.


width: number

Defined in: webview.ts:721

The initial width.


x: number

Defined in: webview.ts:717

The initial vertical position.


y: number

Defined in: webview.ts:719

The initial horizontal position.


optional zoomHotkeysEnabled: boolean

Defined in: webview.ts:779

Whether 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.


© 2025 Tauri Contributors. CC-BY / MIT