bump wry to 0.34
This commit is contained in:
1 parent
c84a13f164
commit
5fdff4b7ed
4 files changed
+33
-10
No files matched your search
@@ -35,7 +35,7 @@ frameworks = ["WebKit"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.56"
|
anyhow = "1.0.56"
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
wry = "0.31.0"
|
wry = "0.34.0"
|
||||||
dioxus = { path = "../../packages/dioxus" }
|
dioxus = { path = "../../packages/dioxus" }
|
||||||
dioxus-desktop = { path = "../../packages/desktop", features = [
|
dioxus-desktop = { path = "../../packages/desktop", features = [
|
||||||
"tokio_runtime",
|
"tokio_runtime",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ serde = "1.0.136"
|
|||||||
serde_json = "1.0.79"
|
serde_json = "1.0.79"
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
wry = { version = "0.31.0", default-features = false, features = ["protocol", "file-drop"] }
|
wry = { version = "0.34.0", default-features = false, features = ["tao", "protocol", "file-drop"] }
|
||||||
futures-channel = { workspace = true }
|
futures-channel = { workspace = true }
|
||||||
tokio = { workspace = true, features = [
|
tokio = { workspace = true, features = [
|
||||||
"sync",
|
"sync",
|
||||||
@@ -41,7 +41,7 @@ crossbeam-channel = "0.5.8"
|
|||||||
|
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "windows",target_os = "macos",target_os = "linux",target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
|
[target.'cfg(any(target_os = "windows",target_os = "macos",target_os = "linux",target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
|
||||||
rfd = "0.11.3"
|
rfd = "0.12"
|
||||||
global-hotkey = { git = "https://github.com/tauri-apps/global-hotkey" }
|
global-hotkey = { git = "https://github.com/tauri-apps/global-hotkey" }
|
||||||
|
|
||||||
[target.'cfg(target_os = "ios")'.dependencies]
|
[target.'cfg(target_os = "ios")'.dependencies]
|
||||||
@@ -58,8 +58,6 @@ tokio_runtime = ["tokio"]
|
|||||||
fullscreen = ["wry/fullscreen"]
|
fullscreen = ["wry/fullscreen"]
|
||||||
transparent = ["wry/transparent"]
|
transparent = ["wry/transparent"]
|
||||||
devtools = ["wry/devtools"]
|
devtools = ["wry/devtools"]
|
||||||
tray = ["wry/tray"]
|
|
||||||
dox = ["wry/dox"]
|
|
||||||
hot-reload = ["dioxus-hot-reload"]
|
hot-reload = ["dioxus-hot-reload"]
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use tao::event_loop::{EventLoopProxy, EventLoopWindowTarget};
|
|||||||
pub use wry;
|
pub use wry;
|
||||||
pub use wry::application as tao;
|
pub use wry::application as tao;
|
||||||
use wry::application::window::Window;
|
use wry::application::window::Window;
|
||||||
|
use wry::http::Response;
|
||||||
use wry::webview::{WebContext, WebView, WebViewBuilder};
|
use wry::webview::{WebContext, WebView, WebViewBuilder};
|
||||||
|
|
||||||
pub fn build(
|
pub fn build(
|
||||||
@@ -44,9 +45,24 @@ pub fn build(
|
|||||||
_ = proxy.send_event(UserWindowEvent(EventData::Ipc(message), window.id()));
|
_ = proxy.send_event(UserWindowEvent(EventData::Ipc(message), window.id()));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.with_custom_protocol(String::from("dioxus"), move |r| {
|
.with_custom_protocol(
|
||||||
protocol::desktop_handler(r, custom_head.clone(), index_file.clone(), &root_name)
|
String::from("dioxus"),
|
||||||
})
|
move |r| match protocol::desktop_handler(
|
||||||
|
&r,
|
||||||
|
custom_head.clone(),
|
||||||
|
index_file.clone(),
|
||||||
|
&root_name,
|
||||||
|
) {
|
||||||
|
Ok(response) => response,
|
||||||
|
Err(err) => {
|
||||||
|
tracing::error!("Error: {}", err);
|
||||||
|
Response::builder()
|
||||||
|
.status(500)
|
||||||
|
.body(err.to_string().into_bytes().into())
|
||||||
|
.unwrap()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
.with_file_drop_handler(move |window, evet| {
|
.with_file_drop_handler(move |window, evet| {
|
||||||
file_handler
|
file_handler
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -71,7 +87,16 @@ pub fn build(
|
|||||||
// .with_web_context(&mut web_context);
|
// .with_web_context(&mut web_context);
|
||||||
|
|
||||||
for (name, handler) in cfg.protocols.drain(..) {
|
for (name, handler) in cfg.protocols.drain(..) {
|
||||||
webview = webview.with_custom_protocol(name, handler)
|
webview = webview.with_custom_protocol(name, move |r| match handler(&r) {
|
||||||
|
Ok(response) => response,
|
||||||
|
Err(err) => {
|
||||||
|
tracing::error!("Error: {}", err);
|
||||||
|
Response::builder()
|
||||||
|
.status(500)
|
||||||
|
.body(err.to_string().into_bytes().into())
|
||||||
|
.unwrap()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.disable_context_menu {
|
if cfg.disable_context_menu {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ keyboard-types = "0.7"
|
|||||||
async-trait = "0.1.58"
|
async-trait = "0.1.58"
|
||||||
serde-value = "0.7.0"
|
serde-value = "0.7.0"
|
||||||
tokio = { workspace = true, features = ["fs", "io-util"], optional = true }
|
tokio = { workspace = true, features = ["fs", "io-util"], optional = true }
|
||||||
rfd = { version = "0.11.3", optional = true }
|
rfd = { version = "0.12", optional = true }
|
||||||
async-channel = "1.8.0"
|
async-channel = "1.8.0"
|
||||||
serde_json = { version = "1", optional = true }
|
serde_json = { version = "1", optional = true }
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user