Procházet zdrojové kódy

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.
Lucas Fernandes Nogueira před 2 roky
rodič
revize
d788d23071

+ 0 - 5
.changes/additional-args-api.md

@@ -1,5 +0,0 @@
----
-"api": minor
----
-
-Added the `additionalBrowserArgs` option when creating a window.

+ 2 - 1
core/tauri/src/endpoints/window.rs

@@ -213,8 +213,9 @@ impl Cmd {
   #[module_command_handler(window_create)]
   async fn create_webview<R: Runtime>(
     context: InvokeContext<R>,
-    options: Box<WindowConfig>,
+    mut options: Box<WindowConfig>,
   ) -> super::Result<()> {
+    options.additional_browser_args = None;
     crate::window::WindowBuilder::from_config(&context.window, *options)
       .build()
       .map_err(crate::error::into_anyhow)?;

+ 0 - 4
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 {