From dba19a211fd57525ae9eec6c7cd14f4fa5b23b0a Mon Sep 17 00:00:00 2001 From: vesp Date: Mon, 12 Jan 2026 22:43:46 +0100 Subject: [PATCH] FIX: Empty tab detection with default User-Agent header --- src/tab_manager.py | 5 ++++- src/window.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tab_manager.py b/src/tab_manager.py index 33cdad1..fae44d4 100644 --- a/src/tab_manager.py +++ b/src/tab_manager.py @@ -49,7 +49,10 @@ class TabManager: # Make a copy to avoid reference issues # Create original for saved requests or loaded history items (anything with content) # Only skip for truly blank new requests - has_content = bool(request.url or request.body or request.headers) + # Consider headers empty if they only contain default headers + has_only_default_headers = request.headers == HttpRequest.default_headers() + has_non_default_headers = request.headers and not has_only_default_headers + has_content = bool(request.url or request.body or has_non_default_headers) original_request = HttpRequest( method=request.method, url=request.url, diff --git a/src/window.py b/src/window.py index 2735daf..d84cca2 100644 --- a/src/window.py +++ b/src/window.py @@ -301,10 +301,13 @@ class RosterWindow(Adw.ApplicationWindow): # Check if it's empty request = widget.get_request() + # Consider headers empty if they're either empty or only contain default headers + from .models import HttpRequest + has_only_default_headers = request.headers == HttpRequest.default_headers() is_empty = ( not request.url.strip() and not request.body.strip() and - not request.headers + (not request.headers or has_only_default_headers) ) return is_empty