fix[desktop:Tauri]: block navigation to blank page

https://github.com/safing/portmaster/issues/2023
This commit is contained in:
Alexandr Stelnykovych
2025-10-02 17:53:42 +03:00
parent a66544959c
commit f8679f6b8c

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 {