Allows desktop apps to open mailto links (#4282)

* Allows desktop apps to open mailto links

* Drop webbrowser, use `open` only

* switch to that_detached

* use workspace `open`

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Juan VásquezandJonathan Kelley authored and GitHub committed 2025-06-18 16:14:54 -07:00
1 parent af6fc3a542
commit 1d3168dc4a
6 files changed
+9 -24

No files matched your search

+1 -1
View File
@@ -271,7 +271,7 @@ impl App {
if let Some(temp) = msg.params().as_object() {
if temp.contains_key("href") {
if let Some(href) = temp.get("href").and_then(|v| v.as_str()) {
if let Err(e) = webbrowser::open(href) {
if let Err(e) = open::that_detached(href) {
tracing::error!("Open Browser error: {:?}", e);
}
}
+5 -2
View File
@@ -346,8 +346,11 @@ impl WebviewInstance {
if var.starts_with("dioxus://") || var.starts_with("http://dioxus.") {
true
} else {
if var.starts_with("http://") || var.starts_with("https://") {
_ = webbrowser::open(&var);
if var.starts_with("http://")
|| var.starts_with("https://")
|| var.starts_with("mailto:")
{
_ = open::that_detached(&var);
}
false
}