Skip to content

Commit f18723c

Browse files
committed
only trigger navigation handler for main frame navigation
1 parent ec12a04 commit f18723c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/tauri-runtime-cef/src/cef_impl/request_handler.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ wrap_request_handler! {
132132
_user_gesture: ::std::os::raw::c_int,
133133
_is_redirect: ::std::os::raw::c_int,
134134
) -> ::std::os::raw::c_int {
135+
let Some(frame) = frame else {
136+
return 0;
137+
};
138+
// we only fire main frame navigation events to match the behavior of the wry runtime
139+
if frame.is_main() == 0 {
140+
return 0;
141+
}
135142
let Some(handler) = &self.navigation_handler else {
136143
return 0;
137144
};

0 commit comments

Comments
 (0)