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:
@@ -42,6 +42,14 @@ pub fn create_main_window(app: &AppHandle) -> Result<WebviewWindow> {
|
|||||||
debug!("[tauri] main window page loaded: {}", _event.url());
|
debug!("[tauri] main window page loaded: {}", _event.url());
|
||||||
do_after_main_window_created(); // required operations after Main window creation
|
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();
|
.build();
|
||||||
|
|
||||||
match res {
|
match res {
|
||||||
|
|||||||
Reference in New Issue
Block a user