Skip to content

Commit

Permalink
Update src/webview/webkitgtk/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Aug 21, 2024
1 parent 70e0990 commit 42c5dd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webview/webkitgtk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ impl InnerWebView {
let webview = Rc::new(webview);
let w = window_rc.clone();
let ipc_handler = attributes.ipc_handler.take();

// Use the window hash as the script handler name to prevent from conflict when sharing same
// web context.
let window_hash = {
let mut hasher = DefaultHasher::new();
w.id().hash(&mut hasher);
hasher.finish().to_string()
};
// Connect before registering as recommended by the docs
manager.connect_script_message_received(None, move |_m, msg| {
#[cfg(feature = "tracing")]
Expand Down

0 comments on commit 42c5dd0

Please sign in to comment.