diff --git a/.changes/extension-path.md b/.changes/extension-path.md index e74d13a7e44f..b100ff29cf4a 100644 --- a/.changes/extension-path.md +++ b/.changes/extension-path.md @@ -6,4 +6,4 @@ "tauri-utils": "patch:feat" --- -Add `with_extension_path` to `WebviewBuilder` for Linux and Windows. +Add `with_extensions_path` to `WebviewBuilder` for Linux and Windows. diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 6222bdcb8e87..0f0f177ebc46 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -494,7 +494,7 @@ "default": false, "type": "boolean" }, - "extensionPath": { + "extensionsPath": { "description": "Set the path from which to load extensions from. Extensions stored in this path should be unpacked.\n\n ## Platform-specific:\n\n - **Windows**: Browser extensions must first be enabled. See [`browser_extensions_enabled`](Self::browser_extensions_enabled)\n - **Linux**: Browser extensions do not need to be enabled.\n - **MacOS / iOS / Android** - Unsupported.", "type": [ "string", diff --git a/crates/tauri-runtime-wry/src/lib.rs b/crates/tauri-runtime-wry/src/lib.rs index 446cc8cb267b..7ceafcc2b7ac 100644 --- a/crates/tauri-runtime-wry/src/lib.rs +++ b/crates/tauri-runtime-wry/src/lib.rs @@ -4285,7 +4285,7 @@ fn create_webview( #[cfg(any(windows, target_os = "linux"))] { - if let Some(path) = &webview_attributes.extension_path { + if let Some(path) = &webview_attributes.extensions_path { webview_builder = webview_builder.with_extension_path(path); } } diff --git a/crates/tauri-runtime/src/webview.rs b/crates/tauri-runtime/src/webview.rs index 1d1ffbabf4b8..f20faaa90bce 100644 --- a/crates/tauri-runtime/src/webview.rs +++ b/crates/tauri-runtime/src/webview.rs @@ -210,7 +210,7 @@ pub struct WebviewAttributes { pub proxy_url: Option, pub zoom_hotkeys_enabled: bool, pub browser_extensions_enabled: bool, - pub extension_path: Option, + pub extensions_path: Option, pub use_https_scheme: bool, pub devtools: Option, pub background_color: Option, @@ -248,8 +248,8 @@ impl From<&WindowConfig> for WebviewAttributes { if let Some(color) = config.background_color { builder = builder.background_color(color); } - if let Some(path) = &config.extension_path { - builder = builder.set_extension_path(path); + if let Some(path) = &config.extensions_path { + builder = builder.set_extensions_path(path); } builder } @@ -276,7 +276,7 @@ impl WebviewAttributes { proxy_url: None, zoom_hotkeys_enabled: false, browser_extensions_enabled: false, - extension_path: None, + extensions_path: None, use_https_scheme: false, devtools: None, background_color: None, @@ -413,8 +413,8 @@ impl WebviewAttributes { /// - **Linux**: Browser extensions do not need to be enabled. /// - **MacOS / iOS / Android** - Unsupported. #[must_use] - pub fn set_extension_path(mut self, path: impl AsRef) -> Self { - self.extension_path = Some(path.as_ref().to_path_buf()); + pub fn set_extensions_path(mut self, path: impl AsRef) -> Self { + self.extensions_path = Some(path.as_ref().to_path_buf()); self } diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 6222bdcb8e87..0f0f177ebc46 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -494,7 +494,7 @@ "default": false, "type": "boolean" }, - "extensionPath": { + "extensionsPath": { "description": "Set the path from which to load extensions from. Extensions stored in this path should be unpacked.\n\n ## Platform-specific:\n\n - **Windows**: Browser extensions must first be enabled. See [`browser_extensions_enabled`](Self::browser_extensions_enabled)\n - **Linux**: Browser extensions do not need to be enabled.\n - **MacOS / iOS / Android** - Unsupported.", "type": [ "string", diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index de32c0794350..0bed7a9f11b8 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -1664,7 +1664,7 @@ pub struct WindowConfig { /// - **Linux**: Browser extensions do not need to be enabled. /// - **MacOS / iOS / Android** - Unsupported. #[serde(default, alias = "extensions-path")] - pub extension_path: Option, + pub extensions_path: Option, /// Sets whether the custom protocols should use `https://.localhost` instead of the default `http://.localhost` on Windows and Android. Defaults to `false`. /// @@ -1746,7 +1746,7 @@ impl Default for WindowConfig { proxy_url: None, zoom_hotkeys_enabled: false, browser_extensions_enabled: false, - extension_path: None, + extensions_path: None, use_https_scheme: false, devtools: None, background_color: None, @@ -3000,7 +3000,7 @@ mod build { let parent = opt_str_lit(self.parent.as_ref()); let zoom_hotkeys_enabled = self.zoom_hotkeys_enabled; let browser_extensions_enabled = self.browser_extensions_enabled; - let extension_path = opt_lit(self.extension_path.as_ref().map(path_buf_lit).as_ref()); + let extensions_path = opt_lit(self.extensions_path.as_ref().map(path_buf_lit).as_ref()); let use_https_scheme = self.use_https_scheme; let devtools = opt_lit(self.devtools.as_ref()); let background_color = opt_lit(self.background_color.as_ref()); @@ -3052,7 +3052,7 @@ mod build { parent, zoom_hotkeys_enabled, browser_extensions_enabled, - extension_path, + extensions_path, use_https_scheme, devtools, background_color diff --git a/crates/tauri/src/webview/mod.rs b/crates/tauri/src/webview/mod.rs index 982f144c6120..83ddb89f6096 100644 --- a/crates/tauri/src/webview/mod.rs +++ b/crates/tauri/src/webview/mod.rs @@ -810,8 +810,8 @@ fn main() { /// - **Linux**: Browser extensions do not need to be enabled. /// - **MacOS / iOS / Android** - Unsupported. #[must_use] - pub fn extension_path(mut self, path: impl AsRef) -> Self { - self.webview_attributes.extension_path = Some(path.as_ref().to_path_buf()); + pub fn extensions_path(mut self, path: impl AsRef) -> Self { + self.webview_attributes.extensions_path = Some(path.as_ref().to_path_buf()); self } diff --git a/crates/tauri/src/webview/webview_window.rs b/crates/tauri/src/webview/webview_window.rs index 32a6a0d1229e..f295fec3c258 100644 --- a/crates/tauri/src/webview/webview_window.rs +++ b/crates/tauri/src/webview/webview_window.rs @@ -914,8 +914,8 @@ impl<'a, R: Runtime, M: Manager> WebviewWindowBuilder<'a, R, M> { /// - **Linux**: Browser extensions do not need to be enabled. /// - **MacOS / iOS / Android** - Unsupported. #[must_use] - pub fn extension_path(mut self, path: impl AsRef) -> Self { - self.webview_builder = self.webview_builder.extension_path(path); + pub fn extensions_path(mut self, path: impl AsRef) -> Self { + self.webview_builder = self.webview_builder.extensions_path(path); self }