From f8679f6b8ccd66394c2f178b0960070f5893d29c Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Thu, 2 Oct 2025 17:53:42 +0300 Subject: [PATCH] fix[desktop:Tauri]: block navigation to blank page https://github.com/safing/portmaster/issues/2023 --- desktop/tauri/src-tauri/src/window.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/tauri/src-tauri/src/window.rs b/desktop/tauri/src-tauri/src/window.rs index c789a97d..ca817dcd 100644 --- a/desktop/tauri/src-tauri/src/window.rs +++ b/desktop/tauri/src-tauri/src/window.rs @@ -42,6 +42,14 @@ pub fn create_main_window(app: &AppHandle) -> Result { 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 {