Skip to content

Commit

Permalink
fix: extension -> extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Nov 12, 2024
1 parent 2197374 commit 22853e6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .changes/extension-path.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion crates/tauri-cli/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-runtime-wry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4285,7 +4285,7 @@ fn create_webview<T: UserEvent>(

#[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);
}
}
Expand Down
12 changes: 6 additions & 6 deletions crates/tauri-runtime/src/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub struct WebviewAttributes {
pub proxy_url: Option<Url>,
pub zoom_hotkeys_enabled: bool,
pub browser_extensions_enabled: bool,
pub extension_path: Option<PathBuf>,
pub extensions_path: Option<PathBuf>,
pub use_https_scheme: bool,
pub devtools: Option<bool>,
pub background_color: Option<Color>,
Expand Down Expand Up @@ -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
}
Expand All @@ -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,
Expand Down Expand Up @@ -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<Path>) -> Self {
self.extension_path = Some(path.as_ref().to_path_buf());
pub fn set_extensions_path(mut self, path: impl AsRef<Path>) -> Self {
self.extensions_path = Some(path.as_ref().to_path_buf());
self
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-schema-generator/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions crates/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf>,
pub extensions_path: Option<PathBuf>,

/// Sets whether the custom protocols should use `https://<scheme>.localhost` instead of the default `http://<scheme>.localhost` on Windows and Android. Defaults to `false`.
///
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -3052,7 +3052,7 @@ mod build {
parent,
zoom_hotkeys_enabled,
browser_extensions_enabled,
extension_path,
extensions_path,
use_https_scheme,
devtools,
background_color
Expand Down
4 changes: 2 additions & 2 deletions crates/tauri/src/webview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Path>) -> Self {
self.webview_attributes.extension_path = Some(path.as_ref().to_path_buf());
pub fn extensions_path(mut self, path: impl AsRef<Path>) -> Self {
self.webview_attributes.extensions_path = Some(path.as_ref().to_path_buf());
self
}

Expand Down
4 changes: 2 additions & 2 deletions crates/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@ impl<'a, R: Runtime, M: Manager<R>> 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<Path>) -> Self {
self.webview_builder = self.webview_builder.extension_path(path);
pub fn extensions_path(mut self, path: impl AsRef<Path>) -> Self {
self.webview_builder = self.webview_builder.extensions_path(path);
self
}

Expand Down

0 comments on commit 22853e6

Please sign in to comment.