Skip to content

Commit fb294af

Browse files
fix(tauri-driver): Parse ms:edgeOptions separately (#12383)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
1 parent 46c7b16 commit fb294af

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.changes/change-pr-12383.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-driver": "patch:bug"
3+
---
4+
5+
Parse ms:edgeOptions separately to prevent `invalid argument` errors.

crates/tauri-driver/src/server.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,18 @@ impl TauriOptions {
5050

5151
#[cfg(target_os = "windows")]
5252
fn into_native_object(self) -> Map<String, Value> {
53+
let mut ms_edge_options = Map::new();
54+
ms_edge_options.insert("binary".into(), json!(self.application));
55+
ms_edge_options.insert("args".into(), self.args.into());
56+
57+
if let Some(webview_options) = self.webview_options {
58+
ms_edge_options.insert("webviewOptions".into(), webview_options);
59+
}
60+
5361
let mut map = Map::new();
5462
map.insert("ms:edgeChromium".into(), json!(true));
5563
map.insert("browserName".into(), json!("webview2"));
56-
map.insert(
57-
"ms:edgeOptions".into(),
58-
json!({"binary": self.application, "args": self.args, "webviewOptions": self.webview_options}),
59-
);
64+
map.insert("ms:edgeOptions".into(), ms_edge_options.into());
6065
map
6166
}
6267
}

0 commit comments

Comments
 (0)