Merge branch 'master' into jk/unify

This commit is contained in:
Jonathan Kelley committed 2022-01-21 00:16:45 -05:00
commit 824defa2db
21 files changed
+476 -91

No files matched your search

+1
View File
@@ -29,6 +29,7 @@ tokio = { version = "1.12.0", features = [
], optional = true, default-features = false }
dioxus-core-macro = { path = "../core-macro", version ="^0.1.6"}
dioxus-html = { path = "../html", features = ["serialize"], version ="^0.1.4"}
webbrowser = "0.5.5"
[features]
default = ["tokio_runtime"]
+14
View File
@@ -187,6 +187,20 @@ pub fn launch_with_props<P: 'static + Send>(
is_ready.store(true, std::sync::atomic::Ordering::Relaxed);
let _ = proxy.send_event(UserWindowEvent::Update);
}
"browser_open" => {
let data = req.params.unwrap();
log::trace!("Open browser: {:?}", data);
if let Some(arr) = data.as_array() {
if let Some(temp) = arr[0].as_object() {
if temp.contains_key("href") {
let url = temp.get("href").unwrap().as_str().unwrap();
if let Err(e) = webbrowser::open(url) {
log::error!("Open Browser error: {:?}", e);
}
}
}
}
}
_ => {}
}
None