fix link opening on mobile (#4415)
* fix link opening on mobile * fix compil;e * ughh just use webbrowser * remove open
This commit is contained in:
1 parent
2dec6205c8
commit
9bfde632f9
4 files changed
+21
-5
No files matched your search
Generated
+17
-1
@@ -5316,7 +5316,6 @@ dependencies = [
|
||||
"ndk-sys 0.6.0+11769913",
|
||||
"objc",
|
||||
"objc_id",
|
||||
"open",
|
||||
"openssl",
|
||||
"percent-encoding",
|
||||
"pollster",
|
||||
@@ -5336,6 +5335,7 @@ dependencies = [
|
||||
"tracing",
|
||||
"tray-icon",
|
||||
"tungstenite 0.27.0",
|
||||
"webbrowser",
|
||||
"wry",
|
||||
]
|
||||
|
||||
@@ -18196,6 +18196,22 @@ dependencies = [
|
||||
"string_cache_codegen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webbrowser"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aaf4f3c0ba838e82b4e5ccc4157003fb8c324ee24c058470ffb82820becbde98"
|
||||
dependencies = [
|
||||
"core-foundation 0.10.1",
|
||||
"jni 0.21.1",
|
||||
"log",
|
||||
"ndk-context",
|
||||
"objc2 0.6.1",
|
||||
"objc2-foundation 0.3.1",
|
||||
"url",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webkit2gtk"
|
||||
version = "2.0.1"
|
||||
|
||||
@@ -47,11 +47,11 @@ async-trait = { workspace = true }
|
||||
tao = { workspace = true, features = ["rwh_05"] }
|
||||
dioxus-history = { workspace = true }
|
||||
base64 = { workspace = true }
|
||||
open = { workspace = true }
|
||||
libc = "0.2.174"
|
||||
pollster = "0.4.0"
|
||||
rand = { workspace = true, features = ["std_rng"] }
|
||||
subtle = { version = "2.6", features = ["const-generics"] }
|
||||
webbrowser = { version = "1.0" }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
signal-hook = "0.3.18"
|
||||
|
||||
@@ -268,8 +268,8 @@ 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) = open::that_detached(href) {
|
||||
tracing::error!("Open Browser error: {:?}", e);
|
||||
if let Err(err) = webbrowser::open(href) {
|
||||
tracing::error!("Failed to open URL: {}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ impl WebviewInstance {
|
||||
|| var.starts_with("https://")
|
||||
|| var.starts_with("mailto:")
|
||||
{
|
||||
_ = open::that_detached(&var);
|
||||
_ = webbrowser::open(&var);
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user