Open andrewbaxter opened 3 weeks ago
Looks like they're open to PRs... I'll try to take a look, but one more item in my growing backlog.
Can you please show a full reproduction example?
use tao::{
event::{
Event,
WindowEvent,
},
event_loop::{
ControlFlow,
EventLoop,
},
platform::unix::WindowExtUnix,
window::WindowBuilder,
};
use wry::{
WebViewBuilder,
WebViewBuilderExtUnix,
};
fn main() -> wry::Result<()> {
let event_loop = EventLoop::new();
let window = WindowBuilder::new().build(&event_loop).unwrap();
let _webview =
WebViewBuilder::new_gtk(window.default_vbox().unwrap())
.with_url(format!("file://{}/examples/test.html", env!("CARGO_MANIFEST_DIR")))
.with_ipc_handler(|_r| { })
.build()?;
event_loop.run(move |event, _, control_flow| {
*control_flow = ControlFlow::Wait;
if let Event::WindowEvent { event: WindowEvent::CloseRequested, .. } = event {
*control_flow = ControlFlow::Exit
}
});
}
with html
<html>
<body>
<script>
window.ipc.postMessage("");
</script>
</body>
</html>
I guess we need to fix this panic and reduce the number of .unwrap()
calls we have.
anyways, iirc file://
is not supported on all webviews and I'd recommend using a custom protocol to serve your asserts, see https://github.com/tauri-apps/wry/blob/dev/examples/custom_protocol.rs example
Yeah, and for error logging... in my case I only need Linux though and even with a custom protocol (can I use file://
as a custom protocol?) I'd want the sorts of uris that cause the panic here. I'm working on a fix for the http issue.
Describe the bug I'm using a
file://
uri for the webview, and attach an IPC handler. When I run the app it panics atwhich is
Steps To Reproduce
Expected behavior
http
issue https://github.com/hyperium/http/issues/323Screenshots
Platform and Versions (please complete the following information): OS: Arch Rustc: 1.76.0
Additional context