{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://schema.tauri.app/config/2.13.0", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", "required": [ "identifier" ], "properties": { "$schema": { "description": "The JSON schema for the Tauri config.", "type": [ "string", "null" ] }, "productName": { "description": "App name.\n\n This is the name your app is known by on the user's system, so it must be changed from the\n default before publishing. Besides naming the generated bundles, it is written into platform\n metadata and install paths that are expected to be unique to your application.\n\n ## Platform-specific\n\n - **macOS**: Names the `.app` bundle and the `.dmg`, and sets the bundle's\n `CFBundleDisplayName` and `CFBundleName` properties. `CFBundleName` can be overridden with\n [`bundle > macOS > bundleName`](MacConfig::bundle_name).\n - **Linux**: Kebab-cased for the Debian and RPM package names, used as the `Name` entry of\n the desktop file and as the resource directory name under `/usr/lib`.\n - **Windows**: Names the installers, the installation directory, the Start Menu folder and\n the `HKCU\\Software\\\\` registry key. It also derives the default\n WiX upgrade code, which must be unique across applications and can be set explicitly with\n [`bundle > windows > wix > upgradeCode`](WixConfig::upgrade_code).", "type": [ "string", "null" ], "pattern": "^[^/\\:*?\"<>|]+$" }, "mainBinaryName": { "description": "Overrides app's main binary filename.\n\n By default, Tauri uses the output binary from `cargo`, by setting this, we will rename that binary in `tauri-cli`'s\n `tauri build` command, and target `tauri bundle` to it\n\n If possible, change the [`package name`] or set the [`name field`] instead,\n and if that's not enough and you're using nightly, consider using the [`different-binary-name`] feature instead\n\n Note: this config should not include the binary extension (e.g. `.exe`), we'll add that for you\n\n [`package name`]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field\n [`name field`]: https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-name-field\n [`different-binary-name`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#different-binary-name", "type": [ "string", "null" ] }, "version": { "description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field.\n\n If removed the version number from `Cargo.toml` is used.\n It's recommended to manage the app versioning in the Tauri config.\n\n ## Platform-specific\n\n - **macOS**: Translates to the bundle's CFBundleShortVersionString property and is used as the default CFBundleVersion.\n You can set an specific bundle version using [`bundle > macOS > bundleVersion`](MacConfig::bundle_version).\n - **iOS**: Translates to the bundle's CFBundleShortVersionString property and is used as the default CFBundleVersion.\n You can set an specific bundle version using [`bundle > iOS > bundleVersion`](IosConfig::bundle_version).\n The `tauri ios build` CLI command has a `--build-number ` option that lets you append a build number to the app version.\n - **Android**: By default version 1.0 is used. You can set a version code using [`bundle > android > versionCode`](AndroidConfig::version_code).\n\n By default version 1.0 is used on Android.", "type": [ "string", "null" ] }, "identifier": { "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`).\n This string must be unique across applications since it is used in system configurations like\n the bundle ID and path to the webview data directory.\n This string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-),\n and periods (.).\n The default value `com.tauri.dev` is rejected by `tauri build` and must be changed before\n building your application.", "type": "string" }, "app": { "description": "The App configuration.", "default": { "enableGTKAppId": false, "macOSPrivateApi": false, "security": { "assetProtocol": { "enable": false, "scope": [] }, "capabilities": [], "dangerousDisableAssetCspModification": false, "freezePrototype": false, "pattern": { "use": "brownfield" } }, "windows": [], "withGlobalTauri": false }, "allOf": [ { "$ref": "#/definitions/AppConfig" } ] }, "build": { "description": "The build configuration.", "default": { "additionalWatchFolders": [], "removeUnusedCommands": false, "windows": { "staticVCRuntime": true } }, "allOf": [ { "$ref": "#/definitions/BuildConfig" } ] }, "bundle": { "description": "The bundler configuration.", "default": { "active": false, "android": { "autoIncrementVersionCode": false, "minSdkVersion": 24 }, "createUpdaterArtifacts": false, "iOS": { "minimumSystemVersion": "15.0" }, "icon": [], "linux": { "appimage": { "bundleMediaFramework": false, "files": {} }, "deb": { "files": {} }, "pacman": { "files": {} }, "rpm": { "epoch": 0, "files": {}, "release": "1" } }, "macOS": { "dmg": { "appPosition": { "x": 180, "y": 170 }, "applicationFolderPosition": { "x": 480, "y": 170 }, "windowSize": { "height": 400, "width": 660 } }, "files": {}, "hardenedRuntime": true, "minimumSystemVersion": "10.13" }, "targets": "all", "useLocalToolsDir": false, "windows": { "allowDowngrades": true, "bundleVCRuntime": false, "certificateThumbprint": null, "digestAlgorithm": null, "minimumWebview2Version": null, "nsis": null, "signCommand": null, "timestampUrl": null, "tsp": false, "webviewInstallMode": { "silent": true, "type": "downloadBootstrapper" }, "wix": null } }, "allOf": [ { "$ref": "#/definitions/BundleConfig" } ] }, "plugins": { "description": "The plugins config.", "default": {}, "allOf": [ { "$ref": "#/definitions/PluginConfig" } ] } }, "additionalProperties": false, "definitions": { "AppConfig": { "description": "The App configuration object.\n\n See more: ", "type": "object", "properties": { "windows": { "description": "The app windows configuration.\n\n ## Example:\n\n To create a window at app startup\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n If not specified, the window's label (its identifier) defaults to \"main\",\n you can use this label to get the window through\n `app.get_webview_window` in Rust or `WebviewWindow.getByLabel` in JavaScript\n\n When working with multiple windows, each window will need an unique label\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"label\": \"main\", \"width\": 800, \"height\": 600 },\n { \"label\": \"secondary\", \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n You can also set `create` to false and use this config through the Rust APIs\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"create\": false, \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n and use it like this\n\n ```rust,no_run\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": [], "type": "array", "items": { "$ref": "#/definitions/WindowConfig" } }, "security": { "description": "Security configuration.", "default": { "assetProtocol": { "enable": false, "scope": [] }, "capabilities": [], "dangerousDisableAssetCspModification": false, "freezePrototype": false, "pattern": { "use": "brownfield" } }, "allOf": [ { "$ref": "#/definitions/SecurityConfig" } ] }, "trayIcon": { "description": "Configuration for app tray icon.", "anyOf": [ { "$ref": "#/definitions/TrayIconConfig" }, { "type": "null" } ] }, "macOSPrivateApi": { "description": "MacOS private API configuration. Enables the transparent background API and sets the `fullScreenEnabled` preference to `true`.\n\n No-op in Tauri 2.12.1+ because the APIs are always enabled now.", "default": false, "type": "boolean" }, "withGlobalTauri": { "description": "Whether we should inject the Tauri API on `window.__TAURI__` or not.", "default": false, "type": "boolean" }, "enableGTKAppId": { "description": "Whether the application `identifier` is used as the GTK application ID on systems that use GTK.\n\n Setting the GTK application ID lets the desktop environment associate the app's windows with\n its `.desktop` entry of the same name, which is what makes Wayland compositors and GNOME show\n the correct icon and application name, and group the windows in the dock or taskbar.\n\n Defaults to `false`, because registering an application ID also makes GTK register the\n application on the session bus under that ID, which prevents running more than one instance\n of the app at the same time.\n\n ## Platform-specific\n\n - **Linux / FreeBSD / DragonFly / NetBSD / OpenBSD**: The identifier must be a valid GTK\n application ID.\n - **Windows / macOS / Android / iOS**: Unsupported.", "default": false, "type": "boolean" }, "appDirectoriesOverride": { "description": "Overrides the directories returned by the `app_*_dir` path APIs (`app_config_dir`, `app_data_dir`,\n `app_local_data_dir`, `app_cache_dir` and `app_log_dir`) and the matching `$APPCONFIG`, `$APPDATA`,\n `$APPLOCALDATA`, `$APPCACHE` and `$APPLOG` base directory variables.\n\n This is useful for portable apps that keep all of their data next to the executable,\n and for apps that want their app directories in a location they choose, such as `$DOCUMENT/my-app`.\n Everything that resolves paths through these APIs follows the override, including Tauri itself\n (the default webview data directory on Windows and Linux) and plugins,\n so the storage locations do not need to be configured one by one.\n The only exception is a window's `dataDirectory` config, which is not affected.\n\n It can also isolate the data of a development build from an installed version of the app,\n though a distinct `identifier` for development builds achieves that while keeping the production directory layout.\n\n The value is either a single path used as the root of every app directory\n (config, data and local data resolve to the root itself, cache to `/caches` and log to `/logs`),\n or an object that overrides individual directories (`config`, `data`, `localData`, `cache` and `log`),\n each resolving to exactly the configured path. Directories that are not listed in the object keep their default location.\n\n Each path is resolved as follows:\n\n - A path starting with a base directory variable is resolved relative to that directory.\n The supported variables are `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`,\n `$DOWNLOAD`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$TEMP` and `$VIDEO`.\n `..` components are kept, so `$DATA/../my-app` refers to a sibling of the data directory.\n - An absolute path is used as is.\n - Any other path is resolved relative to the directory containing the executable,\n which must be writable, see the platform-specific notes below.\n\n ## Examples\n\n Keep all data in an `app-data` folder next to the executable, for a portable build:\n\n ```json\n {\n \"app\": {\n \"appDirectoriesOverride\": \"./app-data\"\n }\n }\n ```\n\n Only move the logs and the cache:\n\n ```json\n {\n \"app\": {\n \"appDirectoriesOverride\": {\n \"log\": \"$DATA/my-app/logs\",\n \"cache\": \"$CACHE/my-app\"\n }\n }\n }\n ```\n\n Set the override at runtime, for instance from an environment variable, a command line flag\n or a directory picked by the user, by modifying the config returned by `tauri::generate_context!()`\n before building the app:\n\n ```rust,no_run\n use tauri::utils::config::AppDirectoriesOverride;\n\n fn main() {\n // on an actual app, remove the string argument\n let mut context = tauri::generate_context!(\"../tauri/test/fixture/src-tauri/tauri.conf.json\");\n\n if let Ok(data_dir) = std::env::var(\"MY_APP_DATA_DIR\") {\n context.config_mut().app.app_directories_override =\n Some(AppDirectoriesOverride::Root(data_dir.into()));\n }\n\n tauri::Builder::default()\n .run(context)\n .expect(\"error while running tauri application\");\n }\n ```\n\n ## Security\n\n Scopes and permissions that use the `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE` and `$APPLOG`\n variables follow the override, so the configured paths must be directories dedicated to the app.\n A single root is used as is for the config, data and local data directories, so a root that is not dedicated\n to the app, such as `\"./\"` or `\"$DOCUMENT\"`, extends those scopes to everything it contains.\n With `\"./\"`, `fs:default` (which allows reading the app directories recursively) lets the webview read\n every file next to the executable, including anything else in the folder the app was run from,\n such as the downloads folder. If the app also grants write access to an app directory, a compromised webview\n (e.g. through XSS) can replace files next to the executable, such as dropping a DLL that Windows loads\n from the executable's directory on the next launch, leading to code execution.\n Always point the override to a subfolder owned by the app, such as `\"./app-data\"` or `\"$DOCUMENT/my-app\"`.\n\n ## Platform-specific\n\n A path relative to the executable only works where the executable's directory is writable:\n portable builds, `tauri dev` builds in the `target` directory and the cases listed below.\n Everywhere else every write to an app directory fails at runtime, so installed apps should use\n a base directory variable or an absolute path instead. Unless every distribution of the app is portable,\n keep relative paths out of the shared configuration and apply them to the portable build flavor only,\n for instance with the CLI's `--config` flag, which accepts a JSON file or an inline JSON string:\n\n ```sh\n tauri build --config '{ \"app\": { \"appDirectoriesOverride\": \"./app-data\" } }'\n ```\n\n - **Linux**: Relative paths only work for AppImages, where they are resolved relative to the AppImage file,\n as long as it is kept in a writable directory. `.deb` and `.rpm` packages install the executable to `/usr/bin`.\n - **macOS**: Relative paths are resolved next to the `.app` bundle. This does not work for installed apps,\n since `/Applications` is not writable for standard users, nor for bundles downloaded from the internet,\n which run from a random read-only location (App Translocation) until the user moves them out of the quarantined folder.\n - **Windows**: Relative paths also work for per-user NSIS installers,\n but not for per-machine installers in `Program Files`.\n - **Android / iOS**: Relative paths are not supported, since there is no writable directory next to the executable.\n Use a base directory variable or an absolute path instead. `$DESKTOP` is not available on Android.", "anyOf": [ { "$ref": "#/definitions/AppDirectoriesOverride" }, { "type": "null" } ] }, "androidTauriProtocolHostname": { "description": "Serves the app from `https://` instead of `http(s)://tauri.localhost` on Android, so autofill\n services can link webview credentials to the app through [Digital Asset Links](https://developers.google.com/digital-asset-links).\n\n The value is a lowercase domain name such as `app.example.com`, without a scheme, port or path.\n Tauri trusts only this exact origin for IPC. The other custom protocols (`asset`, `ipc` and plugin protocols)\n keep their `http(s)://.localhost` URLs, following `useHttpsScheme`.\n\n ## Security\n\n Use a dedicated host that serves nothing but `/.well-known/assetlinks.json`, since WebSocket connections\n and some redirected requests to the host reach the real server. Service workers can't use the host.\n\n ## Warning\n\n Setting or changing this value changes the app origin, so the app can't access its old IndexedDB, cookies\n and localStorage. Backend CORS rules and Content Security Policy sources must allow the new origin.\n\n `http(s)://tauri.localhost` no longer serves the app, so hardcoded URLs such as navigation targets\n or OAuth redirect URIs must use `https://` instead.", "anyOf": [ { "$ref": "#/definitions/Hostname" }, { "type": "null" } ] } }, "additionalProperties": false }, "WindowConfig": { "description": "The window configuration object.\n\n See more: ", "type": "object", "properties": { "label": { "description": "The window identifier. It must be alphanumeric.", "default": "main", "type": "string" }, "create": { "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust,no_run\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": true, "type": "boolean" }, "url": { "description": "The window webview URL.", "default": "index.html", "allOf": [ { "$ref": "#/definitions/WebviewUrl" } ] }, "userAgent": { "description": "The user agent for the webview", "type": [ "string", "null" ] }, "dragDropEnabled": { "description": "Whether the drag and drop handlers used internally to generate [`DragDropEvent`]s are enabled on the webview. By default it is enabled.\n\n Disabling it is required to use HTML5 drag and drop on the frontend on Windows since we replace the drag drop handler of WebView2.\n\n Note: this setting maps to [`WebviewBuilder::disable_drag_drop_handler`], not [`WindowBuilder::drag_and_drop`].\n\n [`DragDropEvent`]: https://docs.rs/tauri/latest/tauri/enum.DragDropEvent.html\n [`WebviewBuilder::disable_drag_drop_handler`]: https://docs.rs/tauri/latest/tauri/webview/struct.WebviewBuilder.html#method.disable_drag_drop_handler\n [`WindowBuilder::drag_and_drop`]: https://docs.rs/tauri/latest/x86_64-pc-windows-msvc/tauri/window/struct.WindowBuilder.html#method.drag_and_drop", "default": true, "type": "boolean" }, "center": { "description": "Whether or not the window starts centered or not.", "default": false, "type": "boolean" }, "x": { "description": "The horizontal position of the window's top left corner in logical pixels", "type": [ "number", "null" ], "format": "double" }, "y": { "description": "The vertical position of the window's top left corner in logical pixels", "type": [ "number", "null" ], "format": "double" }, "width": { "description": "The window width in logical pixels.", "default": 800.0, "type": "number", "format": "double" }, "height": { "description": "The window height in logical pixels.", "default": 600.0, "type": "number", "format": "double" }, "minWidth": { "description": "The min window width in logical pixels.", "type": [ "number", "null" ], "format": "double" }, "minHeight": { "description": "The min window height in logical pixels.", "type": [ "number", "null" ], "format": "double" }, "maxWidth": { "description": "The max window width in logical pixels.", "type": [ "number", "null" ], "format": "double" }, "maxHeight": { "description": "The max window height in logical pixels.", "type": [ "number", "null" ], "format": "double" }, "preventOverflow": { "description": "Whether or not to prevent the window from overflowing the workarea\n\n ## Platform-specific\n\n - **iOS / Android:** Unsupported.", "anyOf": [ { "$ref": "#/definitions/PreventOverflowConfig" }, { "type": "null" } ] }, "resizable": { "description": "Whether the window is resizable or not. When resizable is set to false, native window's maximize button is automatically disabled.", "default": true, "type": "boolean" }, "maximizable": { "description": "Whether the window's native maximize button is enabled or not.\n If resizable is set to false, this setting is ignored.\n\n ## Platform-specific\n\n - **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n - **Linux / iOS / Android:** Unsupported.", "default": true, "type": "boolean" }, "minimizable": { "description": "Whether the window's native minimize button is enabled or not.\n\n ## Platform-specific\n\n - **Linux / iOS / Android:** Unsupported.", "default": true, "type": "boolean" }, "closable": { "description": "Whether the window's native close button is enabled or not.\n\n ## Platform-specific\n\n - **Linux:** \"GTK+ will do its best to convince the window manager not to show a close button.\n Depending on the system, this function may not have any effect when called on a window that is already visible\"\n - **iOS / Android:** Unsupported.", "default": true, "type": "boolean" }, "title": { "description": "The window title.", "default": "Tauri App", "type": "string" }, "fullscreen": { "description": "Whether the window starts as fullscreen or not.", "default": false, "type": "boolean" }, "focus": { "description": "Whether the window will be initially focused or not.", "default": true, "type": "boolean" }, "focusable": { "description": "Whether the window will be focusable or not.", "default": true, "type": "boolean" }, "transparent": { "description": "Whether the window is transparent or not.\n\n ## Platform-specific\n\n - **Windows**: Using `noRedirectionBitmap` can help avoid a white flash when creating a transparent window.", "default": false, "type": "boolean" }, "maximized": { "description": "Whether the window is maximized or not.", "default": false, "type": "boolean" }, "visible": { "description": "Whether the window is visible or not.", "default": true, "type": "boolean" }, "decorations": { "description": "Whether the window should have borders and bars.", "default": true, "type": "boolean" }, "alwaysOnBottom": { "description": "Whether the window should always be below other windows.", "default": false, "type": "boolean" }, "alwaysOnTop": { "description": "Whether the window should always be on top of other windows.", "default": false, "type": "boolean" }, "visibleOnAllWorkspaces": { "description": "Whether the window should be visible on all workspaces or virtual desktops.\n\n ## Platform-specific\n\n - **Windows / iOS / Android:** Unsupported.", "default": false, "type": "boolean" }, "contentProtected": { "description": "Prevents the window contents from being captured by other apps.", "default": false, "type": "boolean" }, "skipTaskbar": { "description": "If `true`, hides the window icon from the taskbar on Windows and Linux.", "default": false, "type": "boolean" }, "windowClassname": { "description": "The name of the window class created on Windows to create the window. **Windows only**.", "type": [ "string", "null" ] }, "noRedirectionBitmap": { "description": "This sets `WS_EX_NOREDIRECTIONBITMAP`.\n\n This can avoid the white flash that may appear before the webview content is rendered\n when using a transparent window. **Windows only**.", "default": false, "type": "boolean" }, "theme": { "description": "The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+.", "anyOf": [ { "$ref": "#/definitions/Theme" }, { "type": "null" } ] }, "titleBarStyle": { "description": "The style of the macOS title bar.", "default": "Visible", "allOf": [ { "$ref": "#/definitions/TitleBarStyle" } ] }, "trafficLightPosition": { "description": "The position of the window controls on macOS.\n\n Requires titleBarStyle: Overlay and decorations: true.", "anyOf": [ { "$ref": "#/definitions/LogicalPosition" }, { "type": "null" } ] }, "hiddenTitle": { "description": "If `true`, sets the window title to be hidden on macOS.", "default": false, "type": "boolean" }, "acceptFirstMouse": { "description": "Whether clicking an inactive window also clicks through to the webview on macOS.", "default": false, "type": "boolean" }, "tabbingIdentifier": { "description": "Defines the window [tabbing identifier] for macOS.\n\n Windows with matching tabbing identifiers will be grouped together.\n If the tabbing identifier is not set, automatic tabbing will be disabled.\n\n [tabbing identifier]: ", "type": [ "string", "null" ] }, "additionalBrowserArgs": { "description": "Defines additional browser arguments on Windows.\n\n ## Warning\n\n Webview instances with different browser arguments must also have different [data directories](Self::data_directory).\n\n By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection`\n so if you set this, you also need to disable these components by yourself if you want.", "type": [ "string", "null" ] }, "shadow": { "description": "Whether or not the window has shadow.\n\n ## Platform-specific\n\n - **Windows:**\n - `false` has no effect on decorated window, shadow are always ON.\n - `true` will make undecorated window have a 1px white border,\n and on Windows 11, it will have a rounded corners.\n - **Linux:** Unsupported.", "default": true, "type": "boolean" }, "windowEffects": { "description": "Window effects.\n\n Requires the window to be transparent.\n\n ## Platform-specific:\n\n - **Windows**: If using decorations or shadows, you may want to try this workaround \n - **Linux**: Unsupported", "anyOf": [ { "$ref": "#/definitions/WindowEffectsConfig" }, { "type": "null" } ] }, "incognito": { "description": "Whether or not the webview should be launched in incognito mode.\n\n ## Platform-specific:\n\n - **Android**: Unsupported.", "default": false, "type": "boolean" }, "parent": { "description": "Sets the window associated with this label to be the parent of the window to be created.\n\n ## Platform-specific\n\n - **Windows**: This sets the passed parent as an owner window to the window to be created.\n From [MSDN owned windows docs](https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows):\n - An owned window is always above its owner in the z-order.\n - The system automatically destroys an owned window when its owner is destroyed.\n - An owned window is hidden when its owner is minimized.\n - **Linux**: This makes the new window transient for parent, see \n - **macOS**: This adds the window as a child of parent, see ", "type": [ "string", "null" ] }, "proxyUrl": { "description": "The proxy URL for the WebView for all network requests.\n\n Must be either a `http://` or a `socks5://` URL.\n\n ## Platform-specific\n\n - **macOS**: Requires the `macos-proxy` feature flag and only compiles for macOS 14+.", "type": [ "string", "null" ], "format": "uri" }, "zoomHotkeysEnabled": { "description": "Whether page zooming by hotkeys is enabled\n\n ## Platform-specific:\n\n - **Windows**: Controls WebView2's [`IsZoomControlEnabled`](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2settings?view=webview2-winrt-1.0.2420.47#iszoomcontrolenabled) setting.\n - **MacOS / Linux**: Injects a polyfill that zooms in and out with `ctrl/command` + `-/=`,\n 20% in each step, ranging from 20% to 1000%. Requires `webview:allow-set-webview-zoom` permission\n\n - **Android / iOS**: Unsupported.", "default": false, "type": "boolean" }, "browserExtensionsEnabled": { "description": "Whether browser extensions can be installed for the webview process\n\n ## Platform-specific:\n\n - **Windows**: Enables the WebView2 environment's [`AreBrowserExtensionsEnabled`](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2environmentoptions?view=webview2-winrt-1.0.2739.15#arebrowserextensionsenabled)\n - **MacOS / Linux / iOS / Android** - Unsupported.", "default": false, "type": "boolean" }, "browserAcceleratorKeys": { "description": "Whether browser keyboard shortcuts (such as F5, Ctrl+R, Ctrl+F, Ctrl+P) are enabled.\n\n Defaults to `true`.\n\n ## Platform-specific:\n\n - **Windows**: Maps to [`ICoreWebView2Settings3::AreBrowserAcceleratorKeysEnabled`](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2settings#arebrowseracceleratorkeysenabled).\n - **Linux / macOS / Android / iOS**: Unsupported.", "default": true, "type": "boolean" }, "useHttpsScheme": { "description": "Sets whether the custom protocols should use `https://.localhost` instead of the default `http://.localhost` on Windows and Android. Defaults to `false`.\n\n ## Note\n\n Using a `https` scheme will NOT allow mixed content when trying to fetch `http` endpoints and therefore will not match the behavior of the `://localhost` protocols used on macOS and Linux.\n\n ## Warning\n\n Changing this value between releases will change the IndexedDB, cookies and localstorage location and your app will not be able to access the old data.\n\n ## Platform-specific\n\n - **Android**: When `app > androidTauriProtocolHostname` is set, the app itself is always served from\n `https://`; this setting only applies to the other custom protocols.", "default": false, "type": "boolean" }, "devtools": { "description": "Enable web inspector which is usually called browser devtools. Enabled by default.\n\n This API works in **debug** builds, but requires `devtools` feature flag to enable it in **release** builds.\n\n ## Platform-specific\n\n - macOS: This will call private functions on **macOS**.\n - Android: Open `chrome://inspect/#devices` in Chrome to get the devtools window. Wry's `WebView` devtools API isn't supported on Android.\n - iOS: Open Safari > Develop > [Your Device Name] > [Your WebView] to get the devtools window.", "type": [ "boolean", "null" ] }, "backgroundColor": { "description": "Set the window and webview background color.\n\n ## Platform-specific:\n\n - **Windows**: alpha channel is ignored for the window layer.\n - **Windows**: On Windows 7, alpha channel is ignored for the webview layer.\n - **Windows**: On Windows 8 and newer, if alpha channel is not `0`, it will be ignored for the webview layer.", "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" } ] }, "backgroundThrottling": { "description": "Change the default background throttling behaviour.\n\n By default, browsers use a suspend policy that will throttle timers and even unload\n the whole tab (view) to free resources after roughly 5 minutes when a view became\n minimized or hidden. This will pause all tasks until the documents visibility state\n changes back from hidden to visible by bringing the view back to the foreground.\n\n ## Platform-specific\n\n - **Linux / Windows / Android**: Unsupported. Workarounds like a pending WebLock transaction might suffice.\n - **iOS**: Supported since version 17.0+.\n - **macOS**: Supported since version 14.0+.\n\n see ", "anyOf": [ { "$ref": "#/definitions/BackgroundThrottlingPolicy" }, { "type": "null" } ] }, "javascriptDisabled": { "description": "Whether we should disable JavaScript code execution on the webview or not.", "default": false, "type": "boolean" }, "allowLinkPreview": { "description": "on macOS and iOS there is a link preview on long pressing links, this is enabled by default.\n see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview", "default": true, "type": "boolean" }, "disableInputAccessoryView": { "description": "Allows disabling the input accessory view on iOS.\n\n The accessory view is the view that appears above the keyboard when a text input element is focused.\n It usually displays a view with \"Done\", \"Next\" buttons.", "default": false, "type": "boolean" }, "dataDirectory": { "description": "Set a custom path for the webview's data directory (localStorage, cache, etc.),\n **relative to the local data directory (`localDataDir()`), followed by the window label**.\n\n To set absolute paths, use [`WebviewWindowBuilder::data_directory`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.data_directory)\n\n This path is not affected by the `app > appDirectoriesOverride` config.\n To keep the webview data in an overridden directory, leave this unset (the webview then uses the app local data directory)\n or resolve a path from `app.path().app_local_data_dir()` and set it with `WebviewWindowBuilder::data_directory`.\n\n #### Platform-specific:\n\n - **Windows**: WebViews with different values for settings like `additionalBrowserArgs`, `browserExtensionsEnabled` or `scrollBarStyle` must have different data directories.\n - **macOS / iOS**: Unsupported, use `profileIdentifier` instead.\n - **Android**: Unsupported.", "type": [ "string", "null" ] }, "dataStoreIdentifier": { "description": "Deprecated: use [`Self::profile_identifier`] (`profileIdentifier`) instead.\n\n Initialize the WebView with a custom data store identifier. This can be seen as a replacement for `dataDirectory` which is unavailable in WKWebView.\n\n See \n\n The array must contain 16 u8 numbers.\n\n #### Platform-specific:\n\n - **iOS**: Supported since version 17.0+.\n - **macOS**: Supported since version 14.0+.\n - **Windows / Linux / Android**: Unsupported.", "deprecated": true, "type": [ "array", "null" ], "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 16, "minItems": 16 }, "profileIdentifier": { "description": "Isolates the webview's browsing data (cookies, local storage, IndexedDB, cache, etc.)\n in a profile identified by the given 16 bytes (usually a UUID).\n\n Webviews using the same identifier share their browsing data,\n while webviews using different identifiers are fully isolated from each other.\n\n The array must contain 16 u8 numbers.\n\n #### Platform-specific:\n\n - **macOS / iOS**: Uses a [`WKWebsiteDataStore`](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/init(foridentifier:)?language=objc)\n created with this identifier. Supported on macOS 14.0+ and iOS 17.0+.\n - **Windows**: Uses a [WebView2 profile](https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/multi-profile-support)\n named after the lowercase hex representation of the identifier, stored inside the data directory.\n Requires WebView2 Runtime 101+, older runtimes ignore this setting.\n - **Linux / Android**: Unsupported.", "type": [ "array", "null" ], "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 16, "minItems": 16 }, "scrollBarStyle": { "description": "Specifies the native scrollbar style to use with the webview.\n CSS styles that modify the scrollbar are applied on top of the native appearance configured here.\n\n Defaults to `default`, which is the browser default.\n\n ## Platform-specific\n\n - **Windows**:\n - `fluentOverlay` requires WebView2 Runtime version 125.0.2535.41 or higher,\n and does nothing on older versions.\n - This option must be given the same value for all webviews that target the same data directory.\n - **Linux / Android / iOS / macOS**: Unsupported. Only supports `Default` and performs no operation.", "default": "default", "allOf": [ { "$ref": "#/definitions/ScrollBarStyle" } ] }, "limitNavigationsToAppBoundDomains": { "description": "Whether to limit navigations to App-Bound Domains.\n\n This is required to enable Service Workers in WKWebView, which are otherwise\n unavailable. Defaults to `false`.\n\n When this is set to `true`, the webview can only navigate to the domains listed in the\n `WKAppBoundDomains` array of `src-tauri/Info.ios.plist`. Add `localhost` and every\n [registrable domain](https://developer.mozilla.org/en-US/docs/Glossary/Registrable_domain)\n this webview loads to that array:\n\n ```xml\n \n \n WKAppBoundDomains\n \n localhost\n aregistrabledomain.example\n \n \n \n ```\n\n `localhost` must be listed if any webview with this option enabled opens a local webpage,\n makes any localhost call, or uses the isolation pattern, because Tauri serves the\n application webpage, the IPC protocol and the isolation pattern iframe from the\n `localhost` domain.\n\n Requests served through custom URI schemes are allowed as long as they use a registrable\n domain listed in the `WKAppBoundDomains` array, including requests to the `localhost`\n domain.\n\n An entire URI scheme can be listed by adding the protocol name followed by a colon, for\n example `stream:` for a custom `stream` scheme (see the\n [streaming example](https://github.com/tauri-apps/tauri/blob/dev/examples/streaming/main.rs)).\n This is not covered by Apple's\n [App-Bound Domains announcement](https://webkit.org/blog/10882/app-bound-domains/),\n so it may not be accepted during App Store review.\n\n See and\n \n for the official documentation on App-Bound Domains.\n\n ## Platform-specific\n\n - **iOS**: Supported since version 14.0+.\n - **Linux / Windows / Android / macOS:** Unsupported.", "default": false, "type": "boolean" }, "activityName": { "description": "The name of the Android activity to create for this window.", "type": [ "string", "null" ] }, "createdByActivityName": { "description": "The name of the Android activity that is creating this webview window.\n\n This is important to determine which stack the activity will belong to.", "type": [ "string", "null" ] }, "requestedBySceneIdentifier": { "description": "Sets the identifier of the scene that is requesting the new scene,\n establishing a relationship between the two scenes.\n\n By default the system uses the foreground scene.", "type": [ "string", "null" ] }, "generalAutofillEnabled": { "description": "Controls the WebView's browser-level general autofill behavior.\n\n **This option does not disable password or credit card autofill.**\n\n When set to `false`, the WebView will not automatically populate\n general form fields using previously stored data such as addresses\n or contact information.\n\n If not specified, this is `true` by default.\n\n ## Platform-specific\n\n - **Windows**: Supported. WebView2's autofill feature (called\n \"Suggestions\") may not honor `autocomplete=\"off\"` on input\n elements in some cases.\n - **Linux / Android / iOS / macOS**: Unsupported and performs no\n operation.", "default": true, "type": "boolean" }, "onNewWindow": { "description": "Action to perform when a new window is requested to be created.\n\n ## Platform-specific\n\n - **Android / iOS**: Unsupported, new window requests are always denied.", "default": { "action": "deny" }, "allOf": [ { "$ref": "#/definitions/OnNewWindow" } ] } }, "additionalProperties": false }, "WebviewUrl": { "description": "An URL to open on a Tauri webview window.", "anyOf": [ { "description": "An external URL. Must use either the `http` or `https` schemes.", "type": "string", "format": "uri" }, { "description": "The path portion of an app URL.\n For instance, to load `tauri://localhost/users/john`,\n you can simply provide `users/john` in this configuration.", "type": "string" }, { "description": "A custom protocol url, for example, `doom://index.html`", "type": "string", "format": "uri" } ] }, "PreventOverflowConfig": { "description": "Prevent overflow with a margin", "anyOf": [ { "description": "Enable prevent overflow or not", "type": "boolean" }, { "description": "Enable prevent overflow with a margin\n so that the window's size + this margin won't overflow the workarea", "allOf": [ { "$ref": "#/definitions/PreventOverflowMargin" } ] } ] }, "PreventOverflowMargin": { "description": "Enable prevent overflow with a margin\n so that the window's size + this margin won't overflow the workarea", "type": "object", "required": [ "height", "width" ], "properties": { "width": { "description": "Horizontal margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 }, "height": { "description": "Vertical margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false }, "Theme": { "description": "System theme.", "oneOf": [ { "description": "Light theme.", "type": "string", "enum": [ "Light" ] }, { "description": "Dark theme.", "type": "string", "enum": [ "Dark" ] } ] }, "TitleBarStyle": { "description": "How the window title bar should be displayed on macOS.", "oneOf": [ { "description": "A normal title bar.", "type": "string", "enum": [ "Visible" ] }, { "description": "Makes the title bar transparent, so the window background color is shown instead.\n\n Useful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color.", "type": "string", "enum": [ "Transparent" ] }, { "description": "Shows the title bar as a transparent overlay over the window's content.\n\n Keep in mind:\n - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect.\n - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus .\n - The color of the window title depends on the system theme.", "type": "string", "enum": [ "Overlay" ] } ] }, "LogicalPosition": { "description": "Position coordinates struct.", "type": "object", "required": [ "x", "y" ], "properties": { "x": { "description": "X coordinate.", "type": "number", "format": "double" }, "y": { "description": "Y coordinate.", "type": "number", "format": "double" } }, "additionalProperties": false }, "WindowEffectsConfig": { "description": "The window effects configuration object", "type": "object", "required": [ "effects" ], "properties": { "effects": { "description": "List of Window effects to apply to the Window.\n\n Generally, conflicting effects will apply the first one and ignore the rest but\n on macOS you can specify one Liquid Glass style and one Visual Effect material at the same time\n to make Tauri fallback to the latter on macOS 15 and below.", "type": "array", "items": { "$ref": "#/definitions/WindowEffect" } }, "state": { "description": "Window effect state **macOS Only**. Ignored for Liquid Glass Effects.", "anyOf": [ { "$ref": "#/definitions/WindowEffectState" }, { "type": "null" } ] }, "radius": { "description": "Window effect corner radius **macOS Only**", "type": [ "number", "null" ], "format": "double" }, "color": { "description": "Window effect color.\n\n ## Platform-specific\n\n - **Windows**: Affects [`WindowEffect::Blur`] and [`WindowEffect::Acrylic`] only\n on Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11.\n - **macOS**: Only affects Liquid Glass effects.", "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" } ] }, "interactive": { "description": "Enables interactive glass behavior, which adds a visual response to user interactions.\n\n **macOS 27.0+**. Only affects Liquid Glass effects.", "default": false, "type": "boolean" } }, "additionalProperties": false }, "WindowEffect": { "description": "Platform-specific window effects", "oneOf": [ { "description": "A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**", "deprecated": true, "type": "string", "enum": [ "appearanceBased" ] }, { "description": "**macOS 10.14-**", "deprecated": true, "type": "string", "enum": [ "light" ] }, { "description": "**macOS 10.14-**", "deprecated": true, "type": "string", "enum": [ "dark" ] }, { "description": "**macOS 10.14-**", "deprecated": true, "type": "string", "enum": [ "mediumLight" ] }, { "description": "**macOS 10.14-**", "deprecated": true, "type": "string", "enum": [ "ultraDark" ] }, { "description": "**macOS 10.10+**", "type": "string", "enum": [ "titlebar" ] }, { "description": "**macOS 10.10+**", "type": "string", "enum": [ "selection" ] }, { "description": "**macOS 10.11+**", "type": "string", "enum": [ "menu" ] }, { "description": "**macOS 10.11+**", "type": "string", "enum": [ "popover" ] }, { "description": "**macOS 10.11+**", "type": "string", "enum": [ "sidebar" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "headerView" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "sheet" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "windowBackground" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "hudWindow" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "fullScreenUI" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "tooltip" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "contentBackground" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "underWindowBackground" ] }, { "description": "**macOS 10.14+**", "type": "string", "enum": [ "underPageBackground" ] }, { "description": "**macOS 26.0+**", "type": "string", "enum": [ "liquidGlassRegular" ] }, { "description": "**macOS 26.0+**", "type": "string", "enum": [ "liquidGlassClear" ] }, { "description": "Mica effect that matches the system dark preference **Windows 11 Only**", "type": "string", "enum": [ "mica" ] }, { "description": "Mica effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**", "type": "string", "enum": [ "micaDark" ] }, { "description": "Mica effect with light mode **Windows 11 Only**", "type": "string", "enum": [ "micaLight" ] }, { "description": "Tabbed effect that matches the system dark preference **Windows 11 Only**", "type": "string", "enum": [ "tabbed" ] }, { "description": "Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**", "type": "string", "enum": [ "tabbedDark" ] }, { "description": "Tabbed effect with light mode **Windows 11 Only**", "type": "string", "enum": [ "tabbedLight" ] }, { "description": "**Windows 7/10/11(22H1) Only**\n\n ## Notes\n\n This effect has bad performance when resizing/dragging the window on Windows 11 build 22621.", "type": "string", "enum": [ "blur" ] }, { "description": "**Windows 10/11 Only**\n\n ## Notes\n\n This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000.", "type": "string", "enum": [ "acrylic" ] } ] }, "WindowEffectState": { "description": "Window effect state **macOS only**\n\n ", "oneOf": [ { "description": "Make window effect state follow the window's active state", "type": "string", "enum": [ "followsWindowActiveState" ] }, { "description": "Make window effect state always active", "type": "string", "enum": [ "active" ] }, { "description": "Make window effect state always inactive", "type": "string", "enum": [ "inactive" ] } ] }, "Color": { "anyOf": [ { "description": "Color hex string, for example: #fff, #ffffff, or #ffffffff.", "type": "string", "pattern": "^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$" }, { "description": "Array of RGB colors. Each value has minimum of 0 and maximum of 255.", "type": "array", "items": [ { "type": "integer", "format": "uint8", "minimum": 0.0 }, { "type": "integer", "format": "uint8", "minimum": 0.0 }, { "type": "integer", "format": "uint8", "minimum": 0.0 } ], "maxItems": 3, "minItems": 3 }, { "description": "Array of RGBA colors. Each value has minimum of 0 and maximum of 255.", "type": "array", "items": [ { "type": "integer", "format": "uint8", "minimum": 0.0 }, { "type": "integer", "format": "uint8", "minimum": 0.0 }, { "type": "integer", "format": "uint8", "minimum": 0.0 }, { "type": "integer", "format": "uint8", "minimum": 0.0 } ], "maxItems": 4, "minItems": 4 }, { "description": "Object of red, green, blue, alpha color values. Each value has minimum of 0 and maximum of 255.", "type": "object", "required": [ "blue", "green", "red" ], "properties": { "red": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "green": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "blue": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "alpha": { "default": 255, "type": "integer", "format": "uint8", "minimum": 0.0 } } } ] }, "BackgroundThrottlingPolicy": { "description": "Background throttling policy.", "oneOf": [ { "description": "A policy where background throttling is disabled", "type": "string", "enum": [ "disabled" ] }, { "description": "A policy where a web view that's not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.", "type": "string", "enum": [ "suspend" ] }, { "description": "A policy where a web view that's not in a window limits processing, but does not fully suspend tasks.", "type": "string", "enum": [ "throttle" ] } ] }, "ScrollBarStyle": { "description": "The scrollbar style to use in the webview.\n\n ## Platform-specific\n\n - **Windows**: This option must be given the same value for all webviews that target the same data directory.", "oneOf": [ { "description": "The platform's native scrollbar, as rendered by the webview by default.\n\n This is the only supported value outside of Windows.", "type": "string", "enum": [ "default" ] }, { "description": "Fluent UI style overlay scrollbars. **Windows Only**\n\n Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,\n see ", "type": "string", "enum": [ "fluentOverlay" ] } ] }, "OnNewWindow": { "description": "Action to perform when a new window is requested to be created.", "oneOf": [ { "description": "Allow the window to be created using the default webview implementation.\n\n The `urls` scope is only checked against the URL initially requested by `window.open`.\n The window is then managed by the webview and Tauri cannot restrict its navigation,\n so it can still be navigated to any URL afterwards (e.g. by the opener or a redirect).\n Use [`Self::AllowTauriWindow`] if navigations must be restricted to the scope too.", "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string", "enum": [ "allowDefault" ] }, "urls": { "description": "Only allow URLs matching the given pattern list when set.\n\n Each entry is a glob pattern such as `\"https://*.tauri.app/**\"`, where `*` does not match `/`\n and `**` matches any number of path segments.\n A pattern without a path such as `\"https://tauri.app\"` matches any path on that origin.\n\n The full [URLPattern] spec is used instead when the `url-pattern` Cargo feature is enabled.\n See [`UrlScope`] for details.\n\n [URLPattern]: https://developer.mozilla.org/en-US/docs/Web/API/URLPattern", "type": [ "array", "null" ], "items": { "$ref": "#/definitions/UrlScope" } } }, "additionalProperties": false }, { "description": "Allow the window to be created using a Tauri window.\n\n The created windows are labeled `{label}-created-{n}`, where `{label}` is the label\n of the webview that requested the new window and `{n}` is a counter starting at 0\n (e.g. `main-created-0`).\n\n **Security**: capabilities are matched against window labels with glob patterns,\n so a capability targeting `\"windows\": [\"*\"]` or `\"windows\": [\"main*\"]` also grants\n its permissions to the windows created for `main`, which may load any URL\n allowed by `urls` (any URL at all if `urls` is not set).\n Scope capabilities to exact window labels (e.g. `\"windows\": [\"main\"]`)\n and set `urls` to restrict which URLs these windows can load.", "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string", "enum": [ "allowTauriWindow" ] }, "urls": { "description": "Only allow URLs matching the given pattern list when set.\n\n Each entry is a glob pattern such as `\"https://*.tauri.app/**\"`, where `*` does not match `/`\n and `**` matches any number of path segments.\n A pattern without a path such as `\"https://tauri.app\"` matches any path on that origin.\n\n The full [URLPattern] spec is used instead when the `url-pattern` Cargo feature is enabled.\n See [`UrlScope`] for details.\n\n [URLPattern]: https://developer.mozilla.org/en-US/docs/Web/API/URLPattern", "type": [ "array", "null" ], "items": { "$ref": "#/definitions/UrlScope" } } }, "additionalProperties": false }, { "description": "Deny the window from being created.", "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string", "enum": [ "deny" ] } }, "additionalProperties": false } ] }, "UrlScope": { "type": "string" }, "SecurityConfig": { "description": "Security configuration.\n\n See more: ", "type": "object", "properties": { "csp": { "description": "The Content Security Policy that will be injected on all HTML files on the built application.\n If `devCsp` is not specified, this value is also injected on dev.\n\n This is a really important part of the configuration since it helps you ensure your WebView is secured.\n See .", "anyOf": [ { "$ref": "#/definitions/Csp" }, { "type": "null" } ] }, "devCsp": { "description": "The Content Security Policy that will be injected on all HTML files on development.\n\n This is a really important part of the configuration since it helps you ensure your WebView is secured.\n See .", "anyOf": [ { "$ref": "#/definitions/Csp" }, { "type": "null" } ] }, "freezePrototype": { "description": "Whether `Object.freeze(Object.prototype)` is run as an initialization script on every webview.\n\n This hardens the frontend against prototype pollution: once the prototype is frozen,\n a script cannot add or replace properties on `Object.prototype` and thus cannot tamper\n with objects it does not own, including the ones used by the Tauri API.\n\n The script runs before any of your frontend code, on every webview, regardless of whether\n the content is served by the custom protocol or by a development server.\n\n Defaults to `false`. Note that frontend libraries that extend built-in prototypes\n (polyfills, some older frameworks) stop working when this is enabled, so test your\n application with it on before shipping.", "default": false, "type": "boolean" }, "dangerousDisableAssetCspModification": { "description": "Disables the Tauri-injected CSP sources.\n\n At compile time, Tauri parses all the frontend assets and changes the Content-Security-Policy\n to only allow loading of your own scripts and styles by injecting nonce and hash sources.\n This stricts your CSP, which may introduce issues when using along with other flexing sources.\n\n This configuration option allows both a boolean and a list of strings as value.\n A boolean instructs Tauri to disable the injection for all CSP injections,\n and a list of strings indicates the CSP directives that Tauri cannot inject.\n\n **WARNING:** Only disable this if you know what you are doing and have properly configured the CSP.\n Your application might be vulnerable to XSS attacks without this Tauri protection.", "default": false, "allOf": [ { "$ref": "#/definitions/DisabledCspModificationKind" } ] }, "assetProtocol": { "description": "Custom protocol config.", "default": { "enable": false, "scope": [] }, "allOf": [ { "$ref": "#/definitions/AssetProtocolConfig" } ] }, "pattern": { "description": "The application pattern, which defines how the frontend communicates with the Rust core.\n\n - `brownfield` (default): the frontend talks to the core directly. Use it unless you need\n the extra isolation layer.\n - `isolation`: every IPC message is routed through a secure JavaScript application you own,\n hosted in a sandboxed `