From b32223acc739e56cbf42f85676c46e4f6755ed0a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 29 May 2017 06:37:28 +0200 Subject: [PATCH] Only inherit private mode when window is set Otherwise, everything calling _open in a private window (like :quickmark-load) will open a new window. --- qutebrowser/browser/commands.py | 2 +- tests/end2end/features/private.feature | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index e2344273b..bcb38a650 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -124,7 +124,7 @@ class CommandDispatcher: urlutils.raise_cmdexc_if_invalid(url) tabbed_browser = self._tabbed_browser cmdutils.check_exclusive((tab, background, window, private), 'tbwp') - if private is None: + if window and private is None: private = self._tabbed_browser.private if window or private: diff --git a/tests/end2end/features/private.feature b/tests/end2end/features/private.feature index f2d23abbf..55ded35d7 100644 --- a/tests/end2end/features/private.feature +++ b/tests/end2end/features/private.feature @@ -139,3 +139,17 @@ Feature: Using private browsing And I open data/hello.txt And I run :jseval localStorage.qute_private_test Then "No output or error" should be logged + + Scenario: Opening quickmark in private window + When I open data/numbers/1.txt in a private window + And I run :window-only + And I run :quickmark-add http://localhost:(port)/data/numbers/2.txt two + And I run :quickmark-load two + And I wait until data/numbers/2.txt is loaded + Then the session should look like: + windows: + - private: True + tabs: + - history: + - url: http://localhost:*/data/numbers/1.txt + - url: http://localhost:*/data/numbers/2.txt