From d788d23071c2017ca9377b72538d817f43497fee Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 31 Mar 2023 10:05:18 -0300 Subject: [PATCH] refactor(core): do not allow JS API to set additional browser args (#6216) This was introduced in #5799, but it's dangerous to let the frontend set this option. --- .changes/additional-args-api.md | 5 ----- core/tauri/src/endpoints/window.rs | 3 ++- tooling/api/src/window.ts | 4 ---- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 .changes/additional-args-api.md diff --git a/.changes/additional-args-api.md b/.changes/additional-args-api.md deleted file mode 100644 index e5a257daf..000000000 --- a/.changes/additional-args-api.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"api": minor ---- - -Added the `additionalBrowserArgs` option when creating a window. diff --git a/core/tauri/src/endpoints/window.rs b/core/tauri/src/endpoints/window.rs index 6040c9559..51bc505fc 100644 --- a/core/tauri/src/endpoints/window.rs +++ b/core/tauri/src/endpoints/window.rs @@ -213,8 +213,9 @@ impl Cmd { #[module_command_handler(window_create)] async fn create_webview( context: InvokeContext, - options: Box, + mut options: Box, ) -> super::Result<()> { + options.additional_browser_args = None; crate::window::WindowBuilder::from_config(&context.window, *options) .build() .map_err(crate::error::into_anyhow)?; diff --git a/tooling/api/src/window.ts b/tooling/api/src/window.ts index a52c5a957..891f655d4 100644 --- a/tooling/api/src/window.ts +++ b/tooling/api/src/window.ts @@ -2144,10 +2144,6 @@ interface WindowOptions { * The user agent for the webview. */ userAgent?: string - /** - * Additional arguments for the webview. **Windows Only** - */ - additionalBrowserArguments?: string } function mapMonitor(m: Monitor | null): Monitor | null {