From 37c3b79b9b17e39c064c9fac18aa78411d37da23 Mon Sep 17 00:00:00 2001 From: Imran Sobir Date: Fri, 10 Feb 2017 17:47:20 +0500 Subject: [PATCH] Add :history command. --- qutebrowser/browser/commands.py | 13 +++++++++++++ tests/end2end/features/misc.feature | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 95dd0e4f2..342cc7a2c 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1396,6 +1396,19 @@ class CommandDispatcher: tab.dump_async(callback, plain=plain) + @cmdutils.register(instance='command-dispatcher', name='history', + scope='window') + def show_history(self, tab=True, bg=False, window=False): + r"""Show browsing history + + Args: + tab: Open in a new tab. + bg: Open in a background tab. + window: Open in a new window. + """ + url = QUrl('qute://history/') + self._open(url, tab, bg, window) + @cmdutils.register(instance='command-dispatcher', name='help', scope='window') @cmdutils.argument('topic', completion=usertypes.Completion.helptopic) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 168ea98ca..ca45055b5 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -290,6 +290,24 @@ Feature: Various utility commands. - about:blank - qute://help/index.html (active) + # :history + + Scenario: :history without arguments + When I run :tab-only + And I run :history + And I wait until qute://history/ is loaded + Then the following tabs should be open: + - qute://history/ (active) + + Scenario: :history with -t + When I open about:blank + And I run :tab-only + And I run :history -t + And I wait until qute://history/ is loaded + Then the following tabs should be open: + - about:blank + - qute://history/ (active) + # :home Scenario: :home with single page