Skip to content

Commit

Permalink
fix: remove from config
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Nov 12, 2024
1 parent 22853e6 commit aabec05
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 37 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_extensions_path` to `WebviewBuilder` for Linux and Windows.
Add `WebviewWindowBuilder/WebviewBuilder::extensions_path` on Linux and Windows.
7 changes: 0 additions & 7 deletions crates/tauri-cli/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,6 @@
"default": false,
"type": "boolean"
},
"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",
"null"
]
},
"useHttpsScheme": {
"description": "Sets whether the custom protocols should use `https://<scheme>.localhost` instead of the default `http://<scheme>.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 `<scheme>://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.",
"default": false,
Expand Down
6 changes: 1 addition & 5 deletions crates/tauri-runtime/src/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ impl From<&WindowConfig> for WebviewAttributes {
if let Some(color) = config.background_color {
builder = builder.background_color(color);
}
if let Some(path) = &config.extensions_path {
builder = builder.set_extensions_path(path);
}
builder
}
}
Expand Down Expand Up @@ -405,12 +402,11 @@ impl WebviewAttributes {
self
}

/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked.
/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked Chrome extensions on Windows, and compiled `.so` extensions on Linux.
///
/// ## Platform-specific:
///
/// - **Windows**: Browser extensions must first be enabled. See [`browser_extensions_enabled`](Self::browser_extensions_enabled)
/// - **Linux**: Browser extensions do not need to be enabled.
/// - **MacOS / iOS / Android** - Unsupported.
#[must_use]
pub fn set_extensions_path(mut self, path: impl AsRef<Path>) -> Self {
Expand Down
7 changes: 0 additions & 7 deletions crates/tauri-schema-generator/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,6 @@
"default": false,
"type": "boolean"
},
"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",
"null"
]
},
"useHttpsScheme": {
"description": "Sets whether the custom protocols should use `https://<scheme>.localhost` instead of the default `http://<scheme>.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 `<scheme>://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.",
"default": false,
Expand Down
13 changes: 0 additions & 13 deletions crates/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,16 +1656,6 @@ pub struct WindowConfig {
#[serde(default, alias = "browser-extensions-enabled")]
pub browser_extensions_enabled: bool,

/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked.
///
/// ## Platform-specific:
///
/// - **Windows**: Browser extensions must first be enabled. See [`browser_extensions_enabled`](Self::browser_extensions_enabled)
/// - **Linux**: Browser extensions do not need to be enabled.
/// - **MacOS / iOS / Android** - Unsupported.
#[serde(default, alias = "extensions-path")]
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`.
///
/// ## Note
Expand Down Expand Up @@ -1746,7 +1736,6 @@ impl Default for WindowConfig {
proxy_url: None,
zoom_hotkeys_enabled: false,
browser_extensions_enabled: false,
extensions_path: None,
use_https_scheme: false,
devtools: None,
background_color: None,
Expand Down Expand Up @@ -3000,7 +2989,6 @@ 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 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 +3040,6 @@ mod build {
parent,
zoom_hotkeys_enabled,
browser_extensions_enabled,
extensions_path,
use_https_scheme,
devtools,
background_color
Expand Down
3 changes: 1 addition & 2 deletions crates/tauri/src/webview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,12 +802,11 @@ fn main() {
self
}

/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked.
/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked Chrome extensions on Windows, and compiled `.so` extensions on Linux.
///
/// ## Platform-specific:
///
/// - **Windows**: Browser extensions must first be enabled. See [`browser_extensions_enabled`](Self::browser_extensions_enabled)
/// - **Linux**: Browser extensions do not need to be enabled.
/// - **MacOS / iOS / Android** - Unsupported.
#[must_use]
pub fn extensions_path(mut self, path: impl AsRef<Path>) -> Self {
Expand Down
3 changes: 1 addition & 2 deletions crates/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,12 +906,11 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
self
}

/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked.
/// Set the path from which to load extensions from. Extensions stored in this path should be unpacked Chrome extensions on Windows, and compiled `.so` extensions on Linux.
///
/// ## Platform-specific:
///
/// - **Windows**: Browser extensions must first be enabled. See [`browser_extensions_enabled`](Self::browser_extensions_enabled)
/// - **Linux**: Browser extensions do not need to be enabled.
/// - **MacOS / iOS / Android** - Unsupported.
#[must_use]
pub fn extensions_path(mut self, path: impl AsRef<Path>) -> Self {
Expand Down

0 comments on commit aabec05

Please sign in to comment.