fix(tauri-driver): Parse ms:edgeOptions separately (#12383)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
bicarlsen 2025-01-25 13:13:13 +01:00 committed by GitHub
parent 46c7b16111
commit fb294af8e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-driver": "patch:bug"
---
Parse ms:edgeOptions separately to prevent `invalid argument` errors.

View File

@ -50,13 +50,18 @@ impl TauriOptions {
#[cfg(target_os = "windows")]
fn into_native_object(self) -> Map<String, Value> {
let mut ms_edge_options = Map::new();
ms_edge_options.insert("binary".into(), json!(self.application));
ms_edge_options.insert("args".into(), self.args.into());
if let Some(webview_options) = self.webview_options {
ms_edge_options.insert("webviewOptions".into(), webview_options);
}
let mut map = Map::new();
map.insert("ms:edgeChromium".into(), json!(true));
map.insert("browserName".into(), json!("webview2"));
map.insert(
"ms:edgeOptions".into(),
json!({"binary": self.application, "args": self.args, "webviewOptions": self.webview_options}),
);
map.insert("ms:edgeOptions".into(), ms_edge_options.into());
map
}
}