Merge pull request #2036 from safing/fix/2023-mouse-BACK-btn-causes-blank-UI

fix[desktop:Tauri]: block navigation to blank page
This commit is contained in:
Alexandr Stelnykovych
2025-10-06 13:36:55 +03:00
committed by GitHub

View File

@@ -42,6 +42,14 @@ pub fn create_main_window(app: &AppHandle) -> Result<WebviewWindow> {
debug!("[tauri] main window page loaded: {}", _event.url());
do_after_main_window_created(); // required operations after Main window creation
})
.on_navigation(|url| {
debug!("[tauri] main window navigation event: {}", url);
if url.as_str() == "about:blank" {
debug!("[tauri] blocking navigation to about:blank");
return false;
}
return true;
})
.build();
match res {