diff --git a/README.asciidoc b/README.asciidoc index 815955963..677cbedf2 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -137,6 +137,7 @@ Contributors, sorted by the number of commits in descending order: * Regina Hug * Peter Vilim * Helen Sherwood-Taylor +* HalosGhost // QUTE_AUTHORS_END The following people have contributed graphics: diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index ab08c1451..d5535d485 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -322,8 +322,13 @@ Quit qutebrowser. [[reload]] === reload +Syntax: +:reload [*--force*]+ + Reload the current/[count]th tab. +==== optional arguments +* +*-f*+, +*--force*+: Bypass the page cache. + ==== count The tab index to reload. diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 0a6e280fc..2d489dfd5 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -29,7 +29,7 @@ from PyQt5.QtWidgets import QApplication, QTabBar from PyQt5.QtCore import Qt, QUrl from PyQt5.QtGui import QClipboard from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog -from PyQt5.QtWebKitWidgets import QWebInspector +from PyQt5.QtWebKitWidgets import QWebPage, QWebInspector import pygments import pygments.lexers import pygments.formatters @@ -305,15 +305,19 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', name='reload', scope='window') - def reloadpage(self, count: {'special': 'count'}=None): + def reloadpage(self, force=False, count: {'special': 'count'}=None): """Reload the current/[count]th tab. Args: count: The tab index to reload, or None. + force: Bypass the page cache. """ tab = self._cntwidget(count) if tab is not None: - tab.reload() + if force: + tab.page().triggerAction(QWebPage.ReloadAndBypassCache) + else: + tab.reload() @cmdutils.register(instance='command-dispatcher', scope='window') def stop(self, count: {'special': 'count'}=None): diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 6d59c18df..08fecadd8 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -945,6 +945,7 @@ KEY_DATA = collections.OrderedDict([ ('tab-prev', ['K']), ('tab-clone', ['gC']), ('reload', ['r']), + ('reload -f', ['R']), ('back', ['H', '']), ('back -t', ['th']), ('back -w', ['wh']),