From 7b7e0c93f5b627480cee0a7c110d24cfbbeff3b7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 16 Jun 2018 11:54:53 +0200 Subject: [PATCH 001/324] Update Chromium version in changelog --- doc/changelog.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b6dfa98b2..35be61392 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -56,7 +56,7 @@ Changed ~~~~~~~ - The Windows/macOS releases now bundle Qt 5.11.1 which is based on - Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.79. + Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and `--temp-basedir`; `-d` and `-D` for `--debug` and `--debug-flag`. - Deleting history items via `:history-clear` or `:completion-item-del` now From 663d1a4d2f2f9d1797a8bb3c745e954f9f3ab4ab Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 17 Jun 2018 19:56:26 +0200 Subject: [PATCH 002/324] Read dictionaries from /usr/share/qt on Qt >= 5.10 Fixes #3759 Supersedes #3762 See #2939, #4003 --- doc/changelog.asciidoc | 3 +++ qutebrowser/browser/webengine/spell.py | 23 ++++++++++++++++--- .../browser/webengine/webenginesettings.py | 2 ++ scripts/dictcli.py | 3 +++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 35be61392..58cc880c4 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -87,6 +87,9 @@ Changed browsing. - When a prompt is opened in insert/passthrough mode, the mode is restored after closing the prompt. +- On Qt 5.10 or newer, dictionaries are now read from the qutebrowser data + directory (e.g. `~/.local/share/qutebrowser`) instead of `/usr/share/qt`. + Existing dictionaries are copied over. Fixed ~~~~~ diff --git a/qutebrowser/browser/webengine/spell.py b/qutebrowser/browser/webengine/spell.py index 5c2ed551b..5a013db74 100644 --- a/qutebrowser/browser/webengine/spell.py +++ b/qutebrowser/browser/webengine/spell.py @@ -22,9 +22,11 @@ import glob import os import re +import os.path +import shutil from PyQt5.QtCore import QLibraryInfo -from qutebrowser.utils import log, message +from qutebrowser.utils import log, message, standarddir, qtutils dict_version_re = re.compile(r".+-(?P[0-9]+-[0-9]+?)\.bdic") @@ -39,9 +41,12 @@ def version(filename): return tuple(int(n) for n in match.group('version').split('-')) -def dictionary_dir(): +def dictionary_dir(old=False): """Return the path (str) to the QtWebEngine's dictionaries directory.""" - datapath = QLibraryInfo.location(QLibraryInfo.DataPath) + if qtutils.version_check('5.10', compiled=False) and not old: + datapath = standarddir.data() + else: + datapath = QLibraryInfo.location(QLibraryInfo.DataPath) return os.path.join(datapath, 'qtwebengine_dictionaries') @@ -73,3 +78,15 @@ def local_filename(code): """ all_installed = local_files(code) return os.path.splitext(all_installed[0])[0] if all_installed else None + + +def init(): + if qtutils.version_check('5.10', compiled=False): + new_dir = dictionary_dir() + old_dir = dictionary_dir(old=True) + os.environ['QTWEBENGINE_DICTIONARIES_PATH'] = new_dir + try: + if os.path.exists(old_dir) and not os.path.exists(new_dir): + shutil.copytree(old_dir, new_dir) + except OSError: + log.misc.exception("Failed to copy old dictionaries") diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py index bae8aaffb..da569eef6 100644 --- a/qutebrowser/browser/webengine/webenginesettings.py +++ b/qutebrowser/browser/webengine/webenginesettings.py @@ -298,6 +298,8 @@ def init(args): not hasattr(QWebEnginePage, 'setInspectedPage')): # only Qt < 5.11 os.environ['QTWEBENGINE_REMOTE_DEBUGGING'] = str(utils.random_port()) + spell.init() + _init_profiles() config.instance.changed.connect(_update_settings) diff --git a/scripts/dictcli.py b/scripts/dictcli.py index 12c80b72d..4017159b6 100755 --- a/scripts/dictcli.py +++ b/scripts/dictcli.py @@ -36,6 +36,7 @@ import attr sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) from qutebrowser.browser.webengine import spell from qutebrowser.config import configdata +from qutebrowser.utils import standarddir API_URL = 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git/+/master/' @@ -257,6 +258,8 @@ def remove_old(languages): def main(): if configdata.DATA is None: configdata.init() + standarddir.init(None) + parser = get_argparser() argv = sys.argv[1:] args = parser.parse_args(argv) From 2029f52fdcc30810db88bf2c68dcbeeaa3cf7d52 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 17 Jun 2018 20:52:35 +0200 Subject: [PATCH 003/324] Show cause when ~/.netrc can't be read --- doc/changelog.asciidoc | 2 ++ qutebrowser/browser/shared.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 58cc880c4..c919eac5c 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -90,6 +90,8 @@ Changed - On Qt 5.10 or newer, dictionaries are now read from the qutebrowser data directory (e.g. `~/.local/share/qutebrowser`) instead of `/usr/share/qt`. Existing dictionaries are copied over. +- If an error while parsing `~/.netrc` occurs, the cause of the error is now + logged. Fixed ~~~~~ diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index 8ebbe3926..31f00f52c 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -312,10 +312,10 @@ def netrc_authentication(url, authenticator): (user, _account, password) = authenticators except FileNotFoundError: log.misc.debug("No .netrc file found") - except OSError: - log.misc.exception("Unable to read the netrc file") - except netrc.NetrcParseError: - log.misc.exception("Error when parsing the netrc file") + except OSError as e: + log.misc.exception("Unable to read the netrc file: {}".format(e)) + except netrc.NetrcParseError as e: + log.misc.exception("Error when parsing the netrc file: {}".format(e)) if user is None: return False From 3399f2df9698a3c7bb7b9da3cfa34467f01efcb7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 17 Jun 2018 21:03:44 +0200 Subject: [PATCH 004/324] Always clear searches between page loads Looks like this wasn't properly fixed in Qt for some reason. Fixes #3693 See #2728 and bef372e5f5dd811eacd959de28f17355407cb7e2 --- doc/changelog.asciidoc | 1 + qutebrowser/browser/webengine/webenginetab.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index c919eac5c..f1eee3983 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -97,6 +97,7 @@ Fixed ~~~~~ - Various subtle keyboard focus issues. +- Workaround for a Qt bug which preserves searches between page loads. Removed ~~~~~~~ diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 86f5e08c8..6739c2f66 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1137,11 +1137,10 @@ class WebEngineTab(browsertab.AbstractTab): @pyqtSlot() def _on_load_started(self): """Clear search when a new load is started if needed.""" - if (qtutils.version_check('5.9', compiled=False) and - not qtutils.version_check('5.9.2', compiled=False)): - # WORKAROUND for - # https://bugreports.qt.io/browse/QTBUG-61506 - self.search.clear() + # WORKAROUND for + # https://bugreports.qt.io/browse/QTBUG-61506 + # (seems to be back in later Qt versions as well) + self.search.clear() super()._on_load_started() self.data.netrc_used = False From 91c0aae05b1e81df4caabd4451bf79b97c854202 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 18 Jun 2018 19:11:13 +0200 Subject: [PATCH 005/324] Update requests from 2.18.4 to 2.19.1 --- misc/requirements/requirements-codecov.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-codecov.txt b/misc/requirements/requirements-codecov.txt index 8ce859da3..6920af52c 100644 --- a/misc/requirements/requirements-codecov.txt +++ b/misc/requirements/requirements-codecov.txt @@ -5,5 +5,5 @@ chardet==3.0.4 codecov==2.0.15 coverage==4.5.1 idna==2.7 -requests==2.18.4 +requests==2.19.1 urllib3==1.22 From da8f76d0821cc72182e415df2fbccfff9b978523 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 18 Jun 2018 19:11:14 +0200 Subject: [PATCH 006/324] Update requests from 2.18.4 to 2.19.1 --- misc/requirements/requirements-pylint-master.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 15555b9d6..e31217497 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -11,7 +11,7 @@ mccabe==0.6.1 -e git+https://github.com/PyCQA/pylint.git#egg=pylint python-dateutil==2.7.3 ./scripts/dev/pylint_checkers -requests==2.18.4 +requests==2.19.1 six==1.11.0 uritemplate==3.0.0 urllib3==1.22 From fa0e8c1b51fd828978a7417c3ba9d298a960a534 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 18 Jun 2018 19:11:16 +0200 Subject: [PATCH 007/324] Update requests from 2.18.4 to 2.19.1 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index c5081b1a6..018d5a427 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -11,7 +11,7 @@ mccabe==0.6.1 pylint==1.9.2 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers -requests==2.18.4 +requests==2.19.1 six==1.11.0 uritemplate==3.0.0 urllib3==1.22 From c3b76d1d01f45339857f46d814b24492f81cbd16 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 18 Jun 2018 19:11:17 +0200 Subject: [PATCH 008/324] Update cheroot from 6.3.1 to 6.3.2 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 67a81ad63..a36409725 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -2,7 +2,7 @@ attrs==18.1.0 beautifulsoup4==4.6.0 -cheroot==6.3.1 +cheroot==6.3.2 click==6.7 # colorama==0.3.9 coverage==4.5.1 From 7c4eaa80b0e9b07f0c08f7b0ed63f31a009abb99 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 18 Jun 2018 19:11:19 +0200 Subject: [PATCH 009/324] Update hypothesis from 3.57.0 to 3.59.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index a36409725..e3e1c6d68 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -11,7 +11,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.57.0 +hypothesis==3.59.1 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From a73a778b9d55d5e69dcb20bec055636924c15891 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 18 Jun 2018 19:11:20 +0200 Subject: [PATCH 010/324] Update pytest-qt from 2.4.0 to 2.4.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index e3e1c6d68..334e740c3 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -29,7 +29,7 @@ pytest-cov==2.5.1 pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 -pytest-qt==2.4.0 +pytest-qt==2.4.1 pytest-repeat==0.4.1 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 From e5405f0ae940a62d7be756acb1ae9549108742a3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 00:21:52 +0200 Subject: [PATCH 011/324] Properly add QtQuickWidgets dependency --- README.asciidoc | 1 + doc/changelog.asciidoc | 4 ++++ qutebrowser/misc/earlyinit.py | 1 + 3 files changed, 6 insertions(+) diff --git a/README.asciidoc b/README.asciidoc index db401d49d..89ee3a610 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -100,6 +100,7 @@ The following software and libraries are required to run qutebrowser: * http://qt.io/[Qt] 5.7.1 or newer (5.10 recommended) with the following modules: - QtCore / qtbase - QtQuick (part of qtbase in some distributions) + - QtQuickWidgets (part of qtbase/QtQuick in some distributions) - QtSQL (part of qtbase in some distributions) - QtOpenGL - QtWebEngine, or diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index f1eee3983..d796933ed 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -55,6 +55,10 @@ Added Changed ~~~~~~~ +- New dependency on the `PyQt5.QtQuickWidgets` module (which was already + accidentally introduced in v1.3.2). For most distributions, this is already + contained in the existing dependencies - only distributions which have + separate packages for PyQt submodules might be affected. - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 9649d27cc..f30e17124 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -233,6 +233,7 @@ def check_libraries(): 'PyQt5.QtQml': _missing_str("PyQt5.QtQml"), 'PyQt5.QtSql': _missing_str("PyQt5.QtSql"), 'PyQt5.QtOpenGL': _missing_str("PyQt5.QtOpenGL"), + 'PyQt5.QtQuickWidgets': _missing_str("PyQt5.QtQuickWidgets"), } _check_modules(modules) From 4887385bdd47fffd1b0695cfb8e401fe8cb90dd8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 01:40:36 +0200 Subject: [PATCH 012/324] Fix test_dictionary_dir --- tests/unit/browser/webengine/test_spell.py | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/unit/browser/webengine/test_spell.py b/tests/unit/browser/webengine/test_spell.py index e8ce3cecc..1cc2c5d0f 100644 --- a/tests/unit/browser/webengine/test_spell.py +++ b/tests/unit/browser/webengine/test_spell.py @@ -17,14 +17,14 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . -"""Tests for qutebrowser.browser.webengine.spell module.""" - import logging import os +import pytest from PyQt5.QtCore import QLibraryInfo + from qutebrowser.browser.webengine import spell -from qutebrowser.utils import usertypes +from qutebrowser.utils import usertypes, qtutils, standarddir def test_version(message_mock, caplog): @@ -38,10 +38,19 @@ def test_version(message_mock, caplog): assert msg.text == expected -def test_dictionary_dir(monkeypatch): - monkeypatch.setattr(QLibraryInfo, 'location', lambda _: 'datapath') - assert spell.dictionary_dir() == os.path.join('datapath', - 'qtwebengine_dictionaries') +@pytest.mark.parametrize('qt_version, old, subdir', [ + ('5.9', True, 'global_datapath'), + ('5.9', False, 'global_datapath'), + ('5.10', True, 'global_datapath'), + ('5.10', False, 'user_datapath'), +]) +def test_dictionary_dir(monkeypatch, qt_version, old, subdir): + monkeypatch.setattr(qtutils, 'qVersion', lambda: qt_version) + monkeypatch.setattr(QLibraryInfo, 'location', lambda _: 'global_datapath') + monkeypatch.setattr(standarddir, 'data', lambda: 'user_datapath') + + expected = os.path.join(subdir, 'qtwebengine_dictionaries') + assert spell.dictionary_dir(old=old) == expected def test_local_filename_dictionary_does_not_exist(monkeypatch): From e7a300865c60f4f306bb7a592e1a57ad01d094c7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 01:43:09 +0200 Subject: [PATCH 013/324] Fix lint --- qutebrowser/browser/webengine/spell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webengine/spell.py b/qutebrowser/browser/webengine/spell.py index 5a013db74..55d8aea5b 100644 --- a/qutebrowser/browser/webengine/spell.py +++ b/qutebrowser/browser/webengine/spell.py @@ -21,8 +21,8 @@ import glob import os -import re import os.path +import re import shutil from PyQt5.QtCore import QLibraryInfo @@ -81,6 +81,7 @@ def local_filename(code): def init(): + """Initialize the dictionary path if supported.""" if qtutils.version_check('5.10', compiled=False): new_dir = dictionary_dir() old_dir = dictionary_dir(old=True) From 9f5ca475c9778041a0c26292f4da7bb3de822bda Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 01:44:15 +0200 Subject: [PATCH 014/324] Don't try to set focus if prev_focus is None --- qutebrowser/mainwindow/tabbedbrowser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 2b74df72b..9c4473874 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -506,7 +506,8 @@ class TabbedBrowser(QWidget): usertypes.KeyMode.yesno]: # If we were in a command prompt, restore old focus # The above commands need to be run to switch tabs - prev_focus.setFocus() + if prev_focus is not None: + prev_focus.setFocus() tab.show() self.new_tab.emit(tab, idx) From c87757a9134b9940409ef78f838c8832c076a0a4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 16:35:17 +0200 Subject: [PATCH 015/324] Revert "Properly add QtQuickWidgets dependency" Looks like FreeBSD doesn't have QtQuickWidgets packaged at all, so let's do the same without requiring it... This reverts commit e5405f0ae940a62d7be756acb1ae9549108742a3. --- README.asciidoc | 1 - doc/changelog.asciidoc | 4 ---- qutebrowser/misc/earlyinit.py | 1 - 3 files changed, 6 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index 89ee3a610..db401d49d 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -100,7 +100,6 @@ The following software and libraries are required to run qutebrowser: * http://qt.io/[Qt] 5.7.1 or newer (5.10 recommended) with the following modules: - QtCore / qtbase - QtQuick (part of qtbase in some distributions) - - QtQuickWidgets (part of qtbase/QtQuick in some distributions) - QtSQL (part of qtbase in some distributions) - QtOpenGL - QtWebEngine, or diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index d796933ed..f1eee3983 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -55,10 +55,6 @@ Added Changed ~~~~~~~ -- New dependency on the `PyQt5.QtQuickWidgets` module (which was already - accidentally introduced in v1.3.2). For most distributions, this is already - contained in the existing dependencies - only distributions which have - separate packages for PyQt submodules might be affected. - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index f30e17124..9649d27cc 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -233,7 +233,6 @@ def check_libraries(): 'PyQt5.QtQml': _missing_str("PyQt5.QtQml"), 'PyQt5.QtSql': _missing_str("PyQt5.QtSql"), 'PyQt5.QtOpenGL': _missing_str("PyQt5.QtOpenGL"), - 'PyQt5.QtQuickWidgets': _missing_str("PyQt5.QtQuickWidgets"), } _check_modules(modules) From 62d8b5b57497da86ddbfda359ef248e2fe706695 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 17:14:29 +0200 Subject: [PATCH 016/324] Don't depend on PyQt5.QtQuickWidgets to get RWHV Some distributions (at least FreeBSD) don't package that module, so let's not rely on it. --- doc/changelog.asciidoc | 3 +++ qutebrowser/browser/webengine/webview.py | 10 +++++----- tests/end2end/fixtures/quteprocess.py | 3 --- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index f1eee3983..972ad8c9f 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -55,6 +55,9 @@ Added Changed ~~~~~~~ +- In v1.3.2 a dependency on the `PyQt5.QtQuickWidgets` module was accidentally + introduced. Since that module isn't packaged everywhere, it's been removed + again. - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 8fce9edb9..7436bc01a 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -22,7 +22,7 @@ import sip from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette -from PyQt5.QtQuickWidgets import QQuickWidget +from PyQt5.QtWidgets import QWidget from PyQt5.QtWebEngineWidgets import (QWebEngineView, QWebEnginePage, QWebEngineScript) @@ -71,10 +71,10 @@ class WebEngineView(QWebEngineView): if proxy is not None: return proxy - # This should only find the RenderWidgetHostViewQtDelegateWidget, - # but not e.g. a QMenu - children = [c for c in self.findChildren(QQuickWidget) - if c.isVisible()] + # We don't want e.g. a QMenu. + rwhv_class = 'QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget' + children = [c for c in self.findChildren(QWidget) + if c.isVisible() and c.inherits(rwhv_class)] log.webview.debug("Found possibly lost focusProxy: {}" .format(children)) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 4101e6142..7311c7b38 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -361,9 +361,6 @@ class QuteProc(testprocess.Process): "Focus object changed: " "", - # Qt >= 5.11 with workarounds - "Focus object changed: " - "", ] if (log_line.category == 'ipc' and From 5a7869f2feaa346853d2a85413d6527c87ef0d9f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 21:20:19 +0200 Subject: [PATCH 017/324] Fix XSS issue on qute://history Fixes #4011 --- qutebrowser/browser/qutescheme.py | 6 ++++-- tests/end2end/data/issue4011.html | 10 ++++++++++ tests/end2end/features/history.feature | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tests/end2end/data/issue4011.html diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 6fc2a8429..7e60b265f 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -24,6 +24,7 @@ Module attributes: _HANDLERS: The handlers registered via decorators. """ +import html import json import os import time @@ -241,8 +242,9 @@ def history_data(start_time, offset=None): end_time = start_time - 24*60*60 entries = hist.entries_between(end_time, start_time) - return [{"url": e.url, "title": e.title or e.url, "time": e.atime} - for e in entries] + return [{"url": html.escape(e.url), + "title": html.escape(e.title) or html.escape(e.url), + "time": e.atime} for e in entries] @add_handler('history') diff --git a/tests/end2end/data/issue4011.html b/tests/end2end/data/issue4011.html new file mode 100644 index 000000000..488193736 --- /dev/null +++ b/tests/end2end/data/issue4011.html @@ -0,0 +1,10 @@ + + + + + <img src="x" onerror="console.log('XSS')">foo + + + foo + + diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 2e2e1712a..13a890c10 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -112,3 +112,8 @@ Feature: Page history And I wait until qute://history is loaded Then the page should contain the plaintext "3.txt" Then the page should contain the plaintext "4.txt" + + Scenario: XSS in :history + When I open data/issue4011.html + And I open qute://history + Then the javascript message "XSS" should not be logged From d961eab1d246c2fd9a209ba322514e1bc401c0f8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 21:42:08 +0200 Subject: [PATCH 018/324] Update changelog for v1.3.3 --- doc/changelog.asciidoc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 972ad8c9f..a0dab79a6 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -100,7 +100,6 @@ Fixed ~~~~~ - Various subtle keyboard focus issues. -- Workaround for a Qt bug which preserves searches between page loads. Removed ~~~~~~~ @@ -109,13 +108,22 @@ Removed - The `content.developer_extras` setting got removed. On QtWebKit, developer extras are now automatically enabled when opening the inspector. -v1.3.3 (unreleased) -------------------- +v1.3.3 +------ + +Security +~~~~~~~~ + +- An XSS vulnerability on the `qute://history` page allowed websites to inject + HTML into the page via a crafted title tag. This could allow them to steal + your browsing history. If you're currently unable to upgrade, avoid using + `:history`. Fixed ~~~~~ - Crash in a workaround for a Qt 5.11 bug in rare circumstances. +- Workaround for a Qt bug which preserves searches between page loads. v1.3.2 ------ From 7a7e04a054fb1f9874dc13586598a11bf0cde8a0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 21:42:44 +0200 Subject: [PATCH 019/324] Move fix to v1.3.3 in changelog --- doc/changelog.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index a0dab79a6..0da1254c5 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -55,9 +55,6 @@ Added Changed ~~~~~~~ -- In v1.3.2 a dependency on the `PyQt5.QtQuickWidgets` module was accidentally - introduced. Since that module isn't packaged everywhere, it's been removed - again. - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and @@ -124,6 +121,9 @@ Fixed - Crash in a workaround for a Qt 5.11 bug in rare circumstances. - Workaround for a Qt bug which preserves searches between page loads. +- In v1.3.2 a dependency on the `PyQt5.QtQuickWidgets` module was accidentally + introduced. Since that module isn't packaged everywhere, it's been removed + again. v1.3.2 ------ From 9a5439e5d09c0840918ad37c72e25f9edaef8b2d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 22:22:04 +0200 Subject: [PATCH 020/324] Re-add waiting for QQuickWidget Apparently this is still needed on some PyQt versions. --- tests/end2end/fixtures/quteprocess.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 7311c7b38..4101e6142 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -361,6 +361,9 @@ class QuteProc(testprocess.Process): "Focus object changed: " "", + # Qt >= 5.11 with workarounds + "Focus object changed: " + "", ] if (log_line.category == 'ipc' and From 0864ad406927a0810aaca307909f8665778e4713 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 22:28:27 +0200 Subject: [PATCH 021/324] Fix shadowing of 'html' name --- qutebrowser/browser/qutescheme.py | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 7e60b265f..7c9f9b1aa 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -124,12 +124,12 @@ class add_handler: # noqa: N801,N806 pylint: disable=invalid-name def wrong_backend_handler(self, url): """Show an error page about using the invalid backend.""" - html = jinja.render('error.html', - title="Error while opening qute://url", - url=url.toDisplayString(), - error='{} is not available with this ' - 'backend'.format(url.toDisplayString())) - return 'text/html', html + src = jinja.render('error.html', + title="Error while opening qute://url", + url=url.toDisplayString(), + error='{} is not available with this ' + 'backend'.format(url.toDisplayString())) + return 'text/html', src def data_for_url(url): @@ -197,11 +197,11 @@ def qute_bookmarks(_url): quickmarks = sorted(objreg.get('quickmark-manager').marks.items(), key=lambda x: x[0]) # Sort by name - html = jinja.render('bookmarks.html', - title='Bookmarks', - bookmarks=bookmarks, - quickmarks=quickmarks) - return 'text/html', html + src = jinja.render('bookmarks.html', + title='Bookmarks', + bookmarks=bookmarks, + quickmarks=quickmarks) + return 'text/html', src @add_handler('tabs') @@ -219,10 +219,10 @@ def qute_tabs(_url): urlstr = tab.url().toDisplayString() tabs[str(win_id)].append((tab.title(), urlstr)) - html = jinja.render('tabs.html', - title='Tabs', - tab_list_by_window=tabs) - return 'text/html', html + src = jinja.render('tabs.html', + title='Tabs', + tab_list_by_window=tabs) + return 'text/html', src def history_data(start_time, offset=None): @@ -289,25 +289,25 @@ def qute_javascript(url): @add_handler('pyeval') def qute_pyeval(_url): """Handler for qute://pyeval.""" - html = jinja.render('pre.html', title='pyeval', content=pyeval_output) - return 'text/html', html + src = jinja.render('pre.html', title='pyeval', content=pyeval_output) + return 'text/html', src @add_handler('spawn-output') def qute_spawn_output(_url): """Handler for qute://spawn-output.""" - html = jinja.render('pre.html', title='spawn output', content=spawn_output) - return 'text/html', html + src = jinja.render('pre.html', title='spawn output', content=spawn_output) + return 'text/html', src @add_handler('version') @add_handler('verizon') def qute_version(_url): """Handler for qute://version.""" - html = jinja.render('version.html', title='Version info', - version=version.version(), - copyright=qutebrowser.__copyright__) - return 'text/html', html + src = jinja.render('version.html', title='Version info', + version=version.version(), + copyright=qutebrowser.__copyright__) + return 'text/html', src @add_handler('plainlog') @@ -325,8 +325,8 @@ def qute_plainlog(url): if not level: level = 'vdebug' text = log.ram_handler.dump_log(html=False, level=level) - html = jinja.render('pre.html', title='log', content=text) - return 'text/html', html + src = jinja.render('pre.html', title='log', content=text) + return 'text/html', src @add_handler('log') @@ -345,8 +345,8 @@ def qute_log(url): level = 'vdebug' html_log = log.ram_handler.dump_log(html=True, level=level) - html = jinja.render('log.html', title='log', content=html_log) - return 'text/html', html + src = jinja.render('log.html', title='log', content=html_log) + return 'text/html', src @add_handler('gpl') @@ -417,12 +417,12 @@ def qute_help(url): @add_handler('backend-warning') def qute_backend_warning(_url): """Handler for qute://backend-warning.""" - html = jinja.render('backend-warning.html', - distribution=version.distribution(), - Distribution=version.Distribution, - version=pkg_resources.parse_version, - title="Legacy backend warning") - return 'text/html', html + src = jinja.render('backend-warning.html', + distribution=version.distribution(), + Distribution=version.Distribution, + version=pkg_resources.parse_version, + title="Legacy backend warning") + return 'text/html', src def _qute_settings_set(url): @@ -452,10 +452,10 @@ def qute_settings(url): if url.path() == '/set': return _qute_settings_set(url) - html = jinja.render('settings.html', title='settings', - configdata=configdata, - confget=config.instance.get_str) - return 'text/html', html + src = jinja.render('settings.html', title='settings', + configdata=configdata, + confget=config.instance.get_str) + return 'text/html', src @add_handler('bindings') @@ -469,9 +469,9 @@ def qute_bindings(_url): for mode in modes: bindings[mode] = config.key_instance.get_bindings_for(mode) - html = jinja.render('bindings.html', title='Bindings', - bindings=bindings) - return 'text/html', html + src = jinja.render('bindings.html', title='Bindings', + bindings=bindings) + return 'text/html', src @add_handler('back') @@ -480,10 +480,10 @@ def qute_back(url): Simple page to free ram / lazy load a site, goes back on focusing the tab. """ - html = jinja.render( + src = jinja.render( 'back.html', title='Suspended: ' + urllib.parse.unquote(url.fragment())) - return 'text/html', html + return 'text/html', src @add_handler('configdiff') From 66fc3a30dd710712fa5b6d9dc2f6fa92689be021 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 23:30:27 +0200 Subject: [PATCH 022/324] Update changelog --- doc/changelog.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 0da1254c5..472d482bc 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -114,7 +114,8 @@ Security - An XSS vulnerability on the `qute://history` page allowed websites to inject HTML into the page via a crafted title tag. This could allow them to steal your browsing history. If you're currently unable to upgrade, avoid using - `:history`. + `:history`. A CVE request for this issue is pending, see + https://github.com/qutebrowser/qutebrowser/issues/4011[#4011] for updates. Fixed ~~~~~ From d2254ca48b1f79512727ff4fba38a2b4222c6850 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 23:30:51 +0200 Subject: [PATCH 023/324] Release v1.3.3 (cherry picked from commit ad9b50601c82f66646088e9ebdd66613eb2e93e2) --- qutebrowser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/__init__.py b/qutebrowser/__init__.py index 770f014ea..da982a7de 100644 --- a/qutebrowser/__init__.py +++ b/qutebrowser/__init__.py @@ -26,7 +26,7 @@ __copyright__ = "Copyright 2014-2018 Florian Bruhin (The Compiler)" __license__ = "GPL" __maintainer__ = __author__ __email__ = "mail@qutebrowser.org" -__version_info__ = (1, 3, 2) +__version_info__ = (1, 3, 3) __version__ = '.'.join(str(e) for e in __version_info__) __description__ = "A keyboard-driven, vim-like browser based on PyQt5." From a02c25dfb1d0db1a850933250b270f1390b43e21 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 23 Jun 2018 14:27:07 +0200 Subject: [PATCH 024/324] Don't escape URLs for qute://history We only use the URL to set a 'href' attribute, which does not need escaping. See #4011 Fixes #4012 --- doc/changelog.asciidoc | 3 +++ qutebrowser/browser/qutescheme.py | 2 +- qutebrowser/javascript/history.js | 2 +- tests/end2end/features/history.feature | 7 +++++++ tests/end2end/features/test_history_bdd.py | 14 ++++++++++++++ tests/end2end/fixtures/webserver_sub.py | 5 +++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 472d482bc..0fcd56eb1 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -97,6 +97,9 @@ Fixed ~~~~~ - Various subtle keyboard focus issues. +- The security fix in v1.3.3 caused URLs with ampersands + (`www.example.com?one=1&two=2`) to send the wrong arguments when clicked on + the `qute://history` page. Removed ~~~~~~~ diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 7c9f9b1aa..e3483bac0 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -242,7 +242,7 @@ def history_data(start_time, offset=None): end_time = start_time - 24*60*60 entries = hist.entries_between(end_time, start_time) - return [{"url": html.escape(e.url), + return [{"url": e.url, "title": html.escape(e.title) or html.escape(e.url), "time": e.atime} for e in entries] diff --git a/qutebrowser/javascript/history.js b/qutebrowser/javascript/history.js index 417441bd9..093b95b4e 100644 --- a/qutebrowser/javascript/history.js +++ b/qutebrowser/javascript/history.js @@ -114,7 +114,7 @@ window.loadHistory = (function() { title.className = "title"; const link = document.createElement("a"); link.href = itemUrl; - link.innerHTML = itemTitle; + link.innerHTML = itemTitle; // Properly escaped in qutescheme.py const host = document.createElement("span"); host.className = "hostname"; host.innerHTML = link.hostname; diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 13a890c10..0432c0705 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -117,3 +117,10 @@ Feature: Page history When I open data/issue4011.html And I open qute://history Then the javascript message "XSS" should not be logged + + Scenario: Escaping of URLs in :history + When I open query?one=1&two=2 + And I open qute://history + And I hint with args "links normal" and follow a + And I wait until query?one=1&two=2 is loaded + Then the query parameter two should be set to 2 diff --git a/tests/end2end/features/test_history_bdd.py b/tests/end2end/features/test_history_bdd.py index 6efa08330..4d477d832 100644 --- a/tests/end2end/features/test_history_bdd.py +++ b/tests/end2end/features/test_history_bdd.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . +import json import logging import re @@ -34,6 +35,19 @@ def turn_on_sql_history(quteproc): quteproc.wait_for_load_finished_url('qute://pyeval') +@bdd.then(bdd.parsers.parse("the query parameter {name} should be set to " + "{value}")) +def check_query(quteproc, name, value): + """Check if a given query is set correctly. + + This assumes we're on the server query page. + """ + content = quteproc.get_content() + data = json.loads(content) + print(data) + assert data[name] == value + + @bdd.then(bdd.parsers.parse("the history should contain:\n{expected}")) def check_history(quteproc, server, tmpdir, expected): path = tmpdir / 'history' diff --git a/tests/end2end/fixtures/webserver_sub.py b/tests/end2end/fixtures/webserver_sub.py index 7d9af2ee3..15cd0becc 100644 --- a/tests/end2end/fixtures/webserver_sub.py +++ b/tests/end2end/fixtures/webserver_sub.py @@ -261,6 +261,11 @@ def response_headers(): return response +@app.route('/query') +def query(): + return flask.jsonify(flask.request.args) + + @app.route('/user-agent') def view_user_agent(): """Return User-Agent.""" From e6e844b039130d365b72e1570dab09483cbf47bf Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 24 Jun 2018 19:54:24 +0200 Subject: [PATCH 025/324] Support URL patterns for content.headers settings See #3636 --- doc/changelog.asciidoc | 5 +++++ doc/help/settings.asciidoc | 10 ++++++++++ qutebrowser/browser/shared.py | 8 ++++---- qutebrowser/browser/webengine/interceptor.py | 10 ++++++---- .../browser/webkit/network/networkmanager.py | 2 +- qutebrowser/browser/webkit/webpage.py | 2 +- qutebrowser/config/configdata.yml | 14 ++++++++++++-- 7 files changed, 39 insertions(+), 12 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 0fcd56eb1..dd0b03092 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -55,6 +55,11 @@ Added Changed ~~~~~~~ +- The following settings now support URL patterns: + - content.headers.do_not_track + - content.headers.custom + - content.headers.accept_language + - content.headers.user_agent - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 9143a4c41..13818716d 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -1622,6 +1622,9 @@ Default: +pass:[ask]+ [[content.headers.accept_language]] === content.headers.accept_language Value to send in the `Accept-Language` header. +Note that the value read from JavaScript is always the global value. + +This setting supports URL patterns. Type: <> @@ -1631,6 +1634,8 @@ Default: +pass:[en-US,en]+ === content.headers.custom Custom headers for qutebrowser HTTP requests. +This setting supports URL patterns. + Type: <> Default: empty @@ -1640,6 +1645,8 @@ Default: empty Value to send in the `DNT` header. When this is set to true, qutebrowser asks websites to not track your identity. If set to null, the DNT header is not sent at all. +This setting supports URL patterns. + Type: <> Default: +pass:[true]+ @@ -1664,6 +1671,9 @@ This setting is only available with the QtWebKit backend. [[content.headers.user_agent]] === content.headers.user_agent User agent to send. Unset to send the default. +Note that the value read from JavaScript is always the global value. + +This setting supports URL patterns. Type: <> diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index 31f00f52c..92dfdeb03 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -34,21 +34,21 @@ class CallSuper(Exception): """Raised when the caller should call the superclass instead.""" -def custom_headers(): +def custom_headers(url): """Get the combined custom headers.""" headers = {} - dnt_config = config.val.content.headers.do_not_track + dnt_config = config.instance.get('content.headers.do_not_track', url=url) if dnt_config is not None: dnt = b'1' if dnt_config else b'0' headers[b'DNT'] = dnt headers[b'X-Do-Not-Track'] = dnt - conf_headers = config.val.content.headers.custom + conf_headers = config.instance.get('content.headers.custom', url=url) for header, value in conf_headers.items(): headers[header.encode('ascii')] = value.encode('ascii') - accept_language = config.val.content.headers.accept_language + accept_language = config.instance.get('content.headers.accept_language', url=url) if accept_language is not None: headers[b'Accept-Language'] = accept_language.encode('ascii') diff --git a/qutebrowser/browser/webengine/interceptor.py b/qutebrowser/browser/webengine/interceptor.py index b04b7962e..18386eed8 100644 --- a/qutebrowser/browser/webengine/interceptor.py +++ b/qutebrowser/browser/webengine/interceptor.py @@ -68,15 +68,17 @@ class RequestInterceptor(QWebEngineUrlRequestInterceptor): info.firstPartyUrl().toDisplayString(), resource_type, navigation_type)) + url = info.requestUrl() + # FIXME:qtwebengine only block ads for NavigationTypeOther? - if self._host_blocker.is_blocked(info.requestUrl()): + if self._host_blocker.is_blocked(url): log.webview.info("Request to {} blocked by host blocker.".format( - info.requestUrl().host())) + url.host())) info.block(True) - for header, value in shared.custom_headers(): + for header, value in shared.custom_headers(url=url): info.setHttpHeader(header, value) - user_agent = config.val.content.headers.user_agent + user_agent = config.instance.get('content.headers.user_agent', url=url) if user_agent is not None: info.setHttpHeader(b'User-Agent', user_agent.encode('ascii')) diff --git a/qutebrowser/browser/webkit/network/networkmanager.py b/qutebrowser/browser/webkit/network/networkmanager.py index a66802375..ad58cc984 100644 --- a/qutebrowser/browser/webkit/network/networkmanager.py +++ b/qutebrowser/browser/webkit/network/networkmanager.py @@ -380,7 +380,7 @@ class NetworkManager(QNetworkAccessManager): result.setParent(self) return result - for header, value in shared.custom_headers(): + for header, value in shared.custom_headers(url=req.url()): req.setRawHeader(header, value) host_blocker = objreg.get('host-blocker') diff --git a/qutebrowser/browser/webkit/webpage.py b/qutebrowser/browser/webkit/webpage.py index 6bbc27109..853ff1b81 100644 --- a/qutebrowser/browser/webkit/webpage.py +++ b/qutebrowser/browser/webkit/webpage.py @@ -415,7 +415,7 @@ class BrowserPage(QWebPage): def userAgentForUrl(self, url): """Override QWebPage::userAgentForUrl to customize the user agent.""" - ua = config.val.content.headers.user_agent + ua = config.instance.get('content.headers.user_agent', url=url) if ua is None: return super().userAgentForUrl(url) else: diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 49e037538..cf8e60771 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -356,8 +356,12 @@ content.headers.accept_language: type: name: String none_ok: true + supports_pattern: true default: en-US,en - desc: Value to send in the `Accept-Language` header. + desc: >- + Value to send in the `Accept-Language` header. + + Note that the value read from JavaScript is always the global value. content.headers.custom: default: {} @@ -370,6 +374,7 @@ content.headers.custom: name: String encoding: ascii none_ok: true + supports_pattern: true desc: Custom headers for qutebrowser HTTP requests. content.headers.do_not_track: @@ -377,6 +382,7 @@ content.headers.do_not_track: name: Bool none_ok: true default: true + supports_pattern: true desc: >- Value to send in the `DNT` header. @@ -451,7 +457,11 @@ content.headers.user_agent: Gecko" - IE 11.0 for Desktop Win7 64-bit - desc: User agent to send. Unset to send the default. + supports_pattern: true + desc: >- + User agent to send. Unset to send the default. + + Note that the value read from JavaScript is always the global value. content.host_blocking.enabled: default: true From f5e69b2174794bf55fb5dab24f65054ddeeddc4f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 24 Jun 2018 19:57:52 +0200 Subject: [PATCH 026/324] Show inspector after creating it --- qutebrowser/browser/commands.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index b73d86a87..0fddcd1e7 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1455,6 +1455,7 @@ class CommandDispatcher: if tab.data.inspector is None: tab.data.inspector = inspector.create() tab.data.inspector.inspect(page) + tab.data.inspector.show() else: tab.data.inspector.toggle(page) except inspector.WebInspectorError as e: From f2f481d991ed73fd54abf79929841ad51a53962d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 24 Jun 2018 21:38:37 +0200 Subject: [PATCH 027/324] Support URL patterns for permissions and ssl_strict See #3636 --- doc/changelog.asciidoc | 7 +++++++ doc/help/settings.asciidoc | 14 ++++++++++++++ qutebrowser/browser/shared.py | 4 ++-- qutebrowser/config/configdata.yml | 7 +++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index dd0b03092..efd451976 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -40,11 +40,14 @@ Added * Support for requesting persistent storage via `navigator.webkitPersistentStorage.requestQuota` with a new `content.persistent_storage` setting (requires Qt 5.11). + This setting also supports URL patterns. * Support for registering custom protocol handlers via `navigator.registerProtocolHandler` with a new `content.register_protocol_handler` setting (requires Qt 5.11). + This setting also supports URL patterns. * Support for WebRTC screen sharing with a new `content.desktop_capture` setting (requires Qt 5.10). + This setting also supports URL patterns. * New `content.autoplay` setting to enable/disable automatic video playback (requires Qt 5.10). * New `content.webrtc_public_interfaces_only` setting to only expose public @@ -60,6 +63,10 @@ Changed - content.headers.custom - content.headers.accept_language - content.headers.user_agent + - content.ssl_strict + - content.geolocation + - content.notifications + - content.media_capture - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 13818716d..75e684ffc 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -1570,6 +1570,8 @@ Default: +pass:[iso-8859-1]+ Allow websites to share screen content. On Qt < 5.10, a dialog box is always displayed, even if this is set to "true". +This setting supports URL patterns. + Type: <> Valid values: @@ -1609,6 +1611,8 @@ This setting is only available with the QtWebKit backend. === content.geolocation Allow websites to request geolocations. +This setting supports URL patterns. + Type: <> Valid values: @@ -1853,6 +1857,8 @@ Default: +pass:[true]+ === content.media_capture Allow websites to record audio/video. +This setting supports URL patterns. + Type: <> Valid values: @@ -1878,6 +1884,8 @@ Default: empty === content.notifications Allow websites to show notifications. +This setting supports URL patterns. + Type: <> Valid values: @@ -1905,6 +1913,8 @@ This setting is only available with the QtWebKit backend. === content.persistent_storage Allow websites to request persistent storage quota via `navigator.webkitPersistentStorage.requestQuota`. +This setting supports URL patterns. + Type: <> Valid values: @@ -1977,6 +1987,8 @@ This setting is only available with the QtWebKit backend. === content.register_protocol_handler Allow websites to register protocol handlers via `navigator.registerProtocolHandler`. +This setting supports URL patterns. + Type: <> Valid values: @@ -1995,6 +2007,8 @@ On QtWebKit, this setting is unavailable. === content.ssl_strict Validate SSL handshakes. +This setting supports URL patterns. + Type: <> Valid values: diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index 92dfdeb03..01ccab13b 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -156,7 +156,7 @@ def ignore_certificate_errors(url, errors, abort_on): Return: True if the error should be ignored, False otherwise. """ - ssl_strict = config.val.content.ssl_strict + ssl_strict = config.instance.get('content.ssl_strict', url=url) log.webview.debug("Certificate errors {!r}, strict {}".format( errors, ssl_strict)) @@ -213,7 +213,7 @@ def feature_permission(url, option, msg, yes_action, no_action, abort_on, The Question object if a question was asked (and blocking=False), None otherwise. """ - config_val = config.instance.get(option) + config_val = config.instance.get(option, url=url) if config_val == 'ask': if url.isValid(): urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index cf8e60771..2698c34b1 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -321,6 +321,7 @@ content.windowed_fullscreen: content.desktop_capture: type: BoolAsk default: ask + supports_pattern: true desc: >- Allow websites to share screen content. @@ -350,6 +351,7 @@ content.frame_flattening: content.geolocation: default: ask type: BoolAsk + supports_pattern: true desc: Allow websites to request geolocations. content.headers.accept_language: @@ -604,6 +606,7 @@ content.local_storage: content.media_capture: default: ask type: BoolAsk + supports_pattern: true backend: QtWebEngine desc: Allow websites to record audio/video. @@ -620,6 +623,7 @@ content.netrc_file: content.notifications: default: ask type: BoolAsk + supports_pattern: true backend: QtWebKit desc: Allow websites to show notifications. @@ -636,6 +640,7 @@ content.pdfjs: content.persistent_storage: default: ask type: BoolAsk + supports_pattern: true backend: QtWebKit: false QtWebEngine: Qt 5.11 @@ -682,6 +687,7 @@ content.proxy_dns_requests: content.register_protocol_handler: default: ask type: BoolAsk + supports_pattern: true backend: QtWebKit: false QtWebEngine: Qt 5.11 @@ -691,6 +697,7 @@ content.register_protocol_handler: content.ssl_strict: default: ask type: BoolAsk + supports_pattern: true desc: Validate SSL handshakes. content.user_stylesheets: From fc19262eaa953c6240f0756930df88e85fe5700b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 24 Jun 2018 22:31:27 +0200 Subject: [PATCH 028/324] Fix test_shared.py --- tests/unit/browser/test_shared.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/browser/test_shared.py b/tests/unit/browser/test_shared.py index f24f7ad97..78302d8c1 100644 --- a/tests/unit/browser/test_shared.py +++ b/tests/unit/browser/test_shared.py @@ -19,6 +19,8 @@ import pytest +from PyQt5.QtCore import QUrl + from qutebrowser.browser import shared @@ -47,4 +49,4 @@ def test_custom_headers(config_stub, dnt, accept_language, custom_headers, headers.custom = custom_headers expected_items = sorted(expected.items()) - assert shared.custom_headers() == expected_items + assert shared.custom_headers(QUrl()) == expected_items From 13f765a00089ae6eb5c9dda66b6efc35da58efe2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 24 Jun 2018 22:33:46 +0200 Subject: [PATCH 029/324] Fix changelog formatting --- doc/changelog.asciidoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index efd451976..786ec712e 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -59,14 +59,14 @@ Changed ~~~~~~~ - The following settings now support URL patterns: - - content.headers.do_not_track - - content.headers.custom - - content.headers.accept_language - - content.headers.user_agent - - content.ssl_strict - - content.geolocation - - content.notifications - - content.media_capture + * `content.headers.do_not_track` + * `content.headers.custom` + * `content.headers.accept_language` + * `content.headers.user_agent` + * `content.ssl_strict` + * `content.geolocation` + * `content.notifications` + * `content.media_capture` - The Windows/macOS releases now bundle Qt 5.11.1 which is based on Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87. - New short flags for commandline arguments: `-B` and `-T` for `--basedir` and From 6c9e23af4a67df4cf3b14f4232e15ef84464cc4d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 08:14:02 +0200 Subject: [PATCH 030/324] eslint: Turn off max-lines-per-function --- qutebrowser/javascript/.eslintrc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/javascript/.eslintrc.yaml b/qutebrowser/javascript/.eslintrc.yaml index 02081f7a7..6a46f96e9 100644 --- a/qutebrowser/javascript/.eslintrc.yaml +++ b/qutebrowser/javascript/.eslintrc.yaml @@ -57,3 +57,4 @@ rules: no-ternary: "off" max-lines: "off" multiline-ternary: ["error", "always-multiline"] + max-lines-per-function: "off" From da0a6305df06f0f53d0460680f7418f80502c5ff Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 25 Jun 2018 12:45:17 -0400 Subject: [PATCH 031/324] Fix crash when tab is closed after a per-domain forced reload --- qutebrowser/browser/webengine/webenginetab.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 6739c2f66..23c26ef95 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -979,6 +979,9 @@ class WebEngineTab(browsertab.AbstractTab): url: The QUrl to open. predict: If set to False, predicted_navigation is not emitted. """ + if sip.isdeleted(self._widget): + # https://github.com/qutebrowser/qutebrowser/issues/3896 + return self._saved_zoom = self.zoom.factor() self._openurl_prepare(url, predict=predict) self._widget.load(url) From e1bc5389a23900356d20bf5191722c4ccab0c709 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 25 Jun 2018 19:21:12 +0200 Subject: [PATCH 032/324] Update pyqt5 from 5.10 to 5.11.1 --- misc/requirements/requirements-pyqt-old.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyqt-old.txt b/misc/requirements/requirements-pyqt-old.txt index f0fa50ad5..f65c1ca9d 100644 --- a/misc/requirements/requirements-pyqt-old.txt +++ b/misc/requirements/requirements-pyqt-old.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -PyQt5==5.10 # rq.filter: != 5.10.1 +PyQt5==5.11.1 # rq.filter: != 5.10.1 sip==4.19.8 From 1f19db07856f417d98df8d74d94ab12b04f7430f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 25 Jun 2018 19:21:14 +0200 Subject: [PATCH 033/324] Update pyqt5 from 5.10.1 to 5.11.1 --- misc/requirements/requirements-pyqt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyqt.txt b/misc/requirements/requirements-pyqt.txt index 059ff2df7..aa6c51286 100644 --- a/misc/requirements/requirements-pyqt.txt +++ b/misc/requirements/requirements-pyqt.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -PyQt5==5.10.1 +PyQt5==5.11.1 sip==4.19.8 From d6554a131eec06eddbfdff64714530862cc49c2f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 25 Jun 2018 19:21:15 +0200 Subject: [PATCH 034/324] Update hypothesis from 3.59.1 to 3.61.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 334e740c3..a032c2d2f 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -11,7 +11,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.59.1 +hypothesis==3.61.0 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From b3790f7a7e0eebd862875d8ba2abd8ec34607572 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 25 Jun 2018 19:21:17 +0200 Subject: [PATCH 035/324] Update pytest from 3.6.1 to 3.6.2 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index a032c2d2f..d48f5b21a 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -22,7 +22,7 @@ parse-type==0.4.2 pluggy==0.6.0 py==1.5.3 py-cpuinfo==4.0.0 -pytest==3.6.1 +pytest==3.6.2 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 From 158ccd7d548931d2fdf5843a747b0891a4ad3a71 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 20:08:42 +0200 Subject: [PATCH 036/324] Revert "Update pyqt5 from 5.10 to 5.11.1" This reverts commit e1bc5389a23900356d20bf5191722c4ccab0c709. --- misc/requirements/requirements-pyqt-old.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyqt-old.txt b/misc/requirements/requirements-pyqt-old.txt index f65c1ca9d..f0fa50ad5 100644 --- a/misc/requirements/requirements-pyqt-old.txt +++ b/misc/requirements/requirements-pyqt-old.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -PyQt5==5.11.1 # rq.filter: != 5.10.1 +PyQt5==5.10 # rq.filter: != 5.10.1 sip==4.19.8 From 3f923b41e06e0568385cea9eedaf3cbd0dba5268 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 20:08:50 +0200 Subject: [PATCH 037/324] Revert "Update pyqt5 from 5.10.1 to 5.11.1" This reverts commit 1f19db07856f417d98df8d74d94ab12b04f7430f. --- misc/requirements/requirements-pyqt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyqt.txt b/misc/requirements/requirements-pyqt.txt index aa6c51286..059ff2df7 100644 --- a/misc/requirements/requirements-pyqt.txt +++ b/misc/requirements/requirements-pyqt.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -PyQt5==5.11.1 +PyQt5==5.10.1 sip==4.19.8 From 8a4bba11ed846ffd96adf0089875229506290fc7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 20:35:48 +0200 Subject: [PATCH 038/324] Disable certificate workaround on Qt >= 5.9 Fixes #4020 --- doc/changelog.asciidoc | 2 ++ qutebrowser/browser/webengine/webview.py | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 786ec712e..b8df97ea3 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -104,6 +104,8 @@ Changed Existing dictionaries are copied over. - If an error while parsing `~/.netrc` occurs, the cause of the error is now logged. +- On Qt 5.9 or newer, certificate errors now show Chromium's detailed error + page. Fixed ~~~~~ diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 7436bc01a..11add368e 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -199,15 +199,18 @@ class WebEnginePage(QWebEnginePage): "{}".format(error)) ignore = False + log.webview.debug("ignore {}, URL {}, requested {}".format( + ignore, url, self.requestedUrl())) + + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-56207 # We can't really know when to show an error page, as the error might # have happened when loading some resource. # However, self.url() is not available yet and self.requestedUrl() # might not match the URL we get from the error - so we just apply a # heuristic here. - # See https://bugreports.qt.io/browse/QTBUG-56207 - log.webview.debug("ignore {}, URL {}, requested {}".format( - ignore, url, self.requestedUrl())) - if not ignore and url.matches(self.requestedUrl(), QUrl.RemoveScheme): + if (not qtutils.version_check('5.9') and + not ignore and + url.matches(self.requestedUrl(), QUrl.RemoveScheme)): self.setHtml(error_page) return ignore From 81b3ef937ebf202670c1561429552874ed51d32a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 21:04:32 +0200 Subject: [PATCH 039/324] Move handling of certificate errors to webenginetab --- qutebrowser/browser/browsertab.py | 4 -- .../browser/webengine/certificateerror.py | 7 +++ qutebrowser/browser/webengine/webenginetab.py | 33 +++++++++++++- qutebrowser/browser/webengine/webview.py | 43 ++++--------------- qutebrowser/browser/webkit/webkittab.py | 4 ++ 5 files changed, 50 insertions(+), 41 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 7e78b2621..9f2e891c5 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -893,10 +893,6 @@ class AbstractTab(QWidget): self._progress = perc self.load_progress.emit(perc) - @pyqtSlot() - def _on_ssl_errors(self): - self._has_ssl_errors = True - def url(self, requested=False): raise NotImplementedError diff --git a/qutebrowser/browser/webengine/certificateerror.py b/qutebrowser/browser/webengine/certificateerror.py index 47953d4cc..768f54ec6 100644 --- a/qutebrowser/browser/webengine/certificateerror.py +++ b/qutebrowser/browser/webengine/certificateerror.py @@ -28,6 +28,10 @@ class CertificateErrorWrapper(usertypes.AbstractCertificateErrorWrapper): """A wrapper over a QWebEngineCertificateError.""" + def __init__(self, error): + super().__init__(error) + self.ignore = False + def __str__(self): return self._error.errorDescription() @@ -37,5 +41,8 @@ class CertificateErrorWrapper(usertypes.AbstractCertificateErrorWrapper): self._error.error()), string=str(self)) + def url(self): + return self._error.url() + def is_overridable(self): return self._error.isOverridable() diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 6739c2f66..185021bfa 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -31,14 +31,15 @@ from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, from PyQt5.QtGui import QKeyEvent, QIcon from PyQt5.QtNetwork import QAuthenticator from PyQt5.QtWidgets import QApplication -from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript +from PyQt5.QtWebEngineWidgets import (QWebEnginePage, QWebEngineScript, + QWebEngineCertificateError) from qutebrowser.config import configdata, config from qutebrowser.browser import browsertab, mouse, shared from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory, interceptor, webenginequtescheme, cookies, webenginedownloads, - webenginesettings) + webenginesettings, certificateerror) from qutebrowser.misc import miscwidgets from qutebrowser.utils import (usertypes, qtutils, log, javascript, utils, message, objreg, jinja, debug) @@ -1224,6 +1225,34 @@ class WebEngineTab(browsertab.AbstractTab): # the old icon is still displayed. self.icon_changed.emit(QIcon()) + @pyqtSlot(certificateerror.CertificateErrorWrapper) + def _on_ssl_errors(self, error): + self._has_ssl_errors = True + + url = error.url() + log.webview.debug("Certificate error: {}".format(error)) + + if error.is_overridable(): + error.ignore = shared.ignore_certificate_errors( + url, [error], abort_on=[self.shutting_down, self.load_started]) + else: + log.webview.error("Non-overridable certificate error: " + "{}".format(error)) + + log.webview.debug("ignore {}, URL {}, requested {}".format( + error.ignore, url, self.url(requested=True))) + + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-56207 + # We can't really know when to show an error page, as the error might + # have happened when loading some resource. + # However, self.url() is not available yet and the requested URL + # might not match the URL we get from the error - so we just apply a + # heuristic here. + if (not qtutils.version_check('5.9') and + not error.ignore and + url.matches(self.url(requested=True), QUrl.RemoveScheme)): + self._show_error_page(url, str(error)) + @pyqtSlot(QUrl) def _on_predicted_navigation(self, url): """If we know we're going to visit an URL soon, change the settings. diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 11add368e..76007b9d9 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -24,10 +24,11 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette from PyQt5.QtWidgets import QWidget from PyQt5.QtWebEngineWidgets import (QWebEngineView, QWebEnginePage, - QWebEngineScript) + QWebEngineScript, + QWebEngineCertificateError) from qutebrowser.browser import shared -from qutebrowser.browser.webengine import certificateerror, webenginesettings +from qutebrowser.browser.webengine import webenginesettings, certificateerror from qutebrowser.config import config from qutebrowser.utils import log, debug, usertypes, jinja, objreg, qtutils from qutebrowser.misc import miscwidgets @@ -152,11 +153,13 @@ class WebEnginePage(QWebEnginePage): Signals: certificate_error: Emitted on certificate errors. + Needs to be directly connected to a slot setting the + 'ignore' attribute. shutting_down: Emitted when the page is shutting down. navigation_request: Emitted on acceptNavigationRequest. """ - certificate_error = pyqtSignal() + certificate_error = pyqtSignal(certificateerror.CertificateErrorWrapper) shutting_down = pyqtSignal() navigation_request = pyqtSignal(usertypes.NavigationRequest) @@ -181,39 +184,9 @@ class WebEnginePage(QWebEnginePage): def certificateError(self, error): """Handle certificate errors coming from Qt.""" - self.certificate_error.emit() - url = error.url() error = certificateerror.CertificateErrorWrapper(error) - log.webview.debug("Certificate error: {}".format(error)) - - url_string = url.toDisplayString() - error_page = jinja.render( - 'error.html', title="Error loading page: {}".format(url_string), - url=url_string, error=str(error)) - - if error.is_overridable(): - ignore = shared.ignore_certificate_errors( - url, [error], abort_on=[self.loadStarted, self.shutting_down]) - else: - log.webview.error("Non-overridable certificate error: " - "{}".format(error)) - ignore = False - - log.webview.debug("ignore {}, URL {}, requested {}".format( - ignore, url, self.requestedUrl())) - - # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-56207 - # We can't really know when to show an error page, as the error might - # have happened when loading some resource. - # However, self.url() is not available yet and self.requestedUrl() - # might not match the URL we get from the error - so we just apply a - # heuristic here. - if (not qtutils.version_check('5.9') and - not ignore and - url.matches(self.requestedUrl(), QUrl.RemoveScheme)): - self.setHtml(error_page) - - return ignore + self.certificate_error.emit(error) + return error.ignore def javaScriptConfirm(self, url, js_msg): """Override javaScriptConfirm to use qutebrowser prompts.""" diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index cf158ed2d..8039eb5eb 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -808,6 +808,10 @@ class WebKitTab(browsertab.AbstractTab): if navigation.is_main_frame: self.settings.update_for_url(navigation.url) + @pyqtSlot() + def _on_ssl_errors(self): + self._has_ssl_errors = True + def _connect_signals(self): view = self._widget page = view.page() From 87778277e012bf931ce15c6b89920c50ea30b589 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 22:51:48 +0200 Subject: [PATCH 040/324] Fix SSL error page tests --- tests/end2end/features/test_prompts_bdd.py | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/end2end/features/test_prompts_bdd.py b/tests/end2end/features/test_prompts_bdd.py index 12d9cbeec..47b449ec1 100644 --- a/tests/end2end/features/test_prompts_bdd.py +++ b/tests/end2end/features/test_prompts_bdd.py @@ -20,6 +20,8 @@ import pytest_bdd as bdd bdd.scenarios('prompts.feature') +from qutebrowser.utils import qtutils + @bdd.when("I load an SSL page") def load_ssl_page(quteproc, ssl_server): @@ -46,14 +48,19 @@ def no_prompt_shown(quteproc): @bdd.then("a SSL error page should be shown") def ssl_error_page(request, quteproc): - if not request.config.webengine: - line = quteproc.wait_for(message='Error while loading *: SSL ' - 'handshake failed') - line.expected = True - quteproc.wait_for(message="Changing title for idx * to 'Error " - "loading page: *'") - content = quteproc.get_content().strip() - assert "Unable to load page" in content + if request.config.webengine and qtutils.version_check('5.9'): + quteproc.wait_for(message="Certificate error: *") + content = quteproc.get_content().strip() + assert "ERR_INSECURE_RESPONSE" in content + else: + if not request.config.webengine: + line = quteproc.wait_for(message='Error while loading *: SSL ' + 'handshake failed') + line.expected = True + quteproc.wait_for(message="Changing title for idx * to 'Error " + "loading page: *'") + content = quteproc.get_content().strip() + assert "Unable to load page" in content class AbstractCertificateErrorWrapper: From 876aa5a9b1b7d33c6e6dd662c73ab435fcf074b6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 22:51:55 +0200 Subject: [PATCH 041/324] Fix lint --- qutebrowser/browser/shared.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index 01ccab13b..2398ca2e4 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -48,7 +48,8 @@ def custom_headers(url): for header, value in conf_headers.items(): headers[header.encode('ascii')] = value.encode('ascii') - accept_language = config.instance.get('content.headers.accept_language', url=url) + accept_language = config.instance.get('content.headers.accept_language', + url=url) if accept_language is not None: headers[b'Accept-Language'] = accept_language.encode('ascii') From 1bc3d444b6c0e25cc754c34e2b40476cd5ba0464 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Jun 2018 23:01:17 +0200 Subject: [PATCH 042/324] Stabilize escaping URLs test --- tests/end2end/features/history.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 0432c0705..e1a7d3326 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -121,6 +121,7 @@ Feature: Page history Scenario: Escaping of URLs in :history When I open query?one=1&two=2 And I open qute://history + And I wait 0.5s # JS loads the history async And I hint with args "links normal" and follow a And I wait until query?one=1&two=2 is loaded Then the query parameter two should be set to 2 From 54ca9b34e529e7d0fc84c77c16cff21ce302381e Mon Sep 17 00:00:00 2001 From: Jimmy Date: Mon, 25 Jun 2018 14:28:28 +1200 Subject: [PATCH 043/324] greasemonkey: enable running in isolated js worlds QtWebEngine (via chromium) has the ability to run injected scripts in isolated "worlds". What is isolated is just the javascript environment, so variables and functions defined by the page and the script won't clobber each other, or be able to interact (including variables saved to the global `window` object). The DOM is still accessible from "isolated" scripts. This is NOT a security measure. You cannot put untrusted scripts in one of these isolated worlds and expect it to not be able to do whatever page js can do, it is just for namespacing convenience. See https://stackoverflow.com/questions/9515704/insert-code-into-the-page-context-using-a-content-script for some examples of how to inject scripts into the page scope using DOM elements. Now you can specify the world ID in a `@qute-js-world` directive like: ``` // ==UserScript== // @name Do thing // @match *://some.site/* // @qute-js-world 1234 // ==/UserScript== document.body.innerHTML = "overwritten" ``` The QtWebEngine docs say worldid is a `quint32` so you can put whatever number (positive, whole, real) you want there. I have chosen to allow the `qutebrowser.utils.usertypes` enum as aliases for IDs that are predefined in `qutebrowser.browser.webengine.webenginetab._JS_WORLD_MAP`. So you can pass `main`, `application`, `user` or `jseval` in there too. `main` (0) is the default one and is the only one in which JS disabled when `content.javascript.enabled` is set to `false`. All others are still enabled. I'm not sure whether using any of those already-named worlds makes sense, apart from `main`. We could stop people from using them I suppose. Another option is to allow people to pass in `*` as a value to have scripts put into their own little worlds, probably backed by a counter in the GreaseMonkeyManager class. Chrome docs: https://developer.chrome.com/extensions/content_scripts#execution-environment Webengine docs: https://doc.qt.io/qt-5/qwebenginescript.html#details --- qutebrowser/browser/greasemonkey.py | 3 +++ qutebrowser/browser/webengine/webenginetab.py | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/greasemonkey.py b/qutebrowser/browser/greasemonkey.py index db8246bab..cff45f3ac 100644 --- a/qutebrowser/browser/greasemonkey.py +++ b/qutebrowser/browser/greasemonkey.py @@ -58,6 +58,7 @@ class GreasemonkeyScript: self.run_at = None self.script_meta = None self.runs_on_sub_frames = True + self.jsworld = "main" for name, value in properties: if name == 'name': self.name = value @@ -77,6 +78,8 @@ class GreasemonkeyScript: self.runs_on_sub_frames = False elif name == 'require': self.requires.append(value) + elif name == 'qute-js-world': + self.jsworld = value HEADER_REGEX = r'// ==UserScript==|\n+// ==/UserScript==\n' PROPS_REGEX = r'// @(?P[^\s]+)\s*(?P.*)' diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 185021bfa..501735fa5 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -900,7 +900,18 @@ class _WebEngineScripts(QObject): # @run-at (and @include/@exclude/@match) is parsed by # QWebEngineScript. new_script = QWebEngineScript() - new_script.setWorldId(QWebEngineScript.MainWorld) + try: + world = int(script.jsworld) + except ValueError: + try: + world = _JS_WORLD_MAP[usertypes.JsWorld[ + script.jsworld.lower()]] + except KeyError: + log.greasemonkey.error( + "script {} has invalid value for '@qute-js-world'" + ": {}".format(script.name, script.jsworld)) + continue + new_script.setWorldId(world) new_script.setSourceCode(script.code()) new_script.setName("GM-{}".format(script.name)) new_script.setRunsOnSubFrames(script.runs_on_sub_frames) From 521268a1f719a89e38d779010d4353db612a803f Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 26 Jun 2018 12:33:40 +1200 Subject: [PATCH 044/324] Update comment. --- qutebrowser/browser/webengine/webenginetab.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 501735fa5..a62524496 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -874,18 +874,18 @@ class _WebEngineScripts(QObject): self._inject_early_js('stylesheet', js_code, subframes=True) def _inject_userscripts(self): - """Register user JavaScript files with the global profiles.""" + """Register user JavaScript files with the current tab.""" # The Greasemonkey metadata block support in QtWebEngine only starts at # Qt 5.8. With 5.7.1, we need to inject the scripts ourselves in # response to urlChanged. if not qtutils.version_check('5.8'): return - # Since we are inserting scripts into profile.scripts they won't - # just get replaced by new gm scripts like if we were injecting them - # ourselves so we need to remove all gm scripts, while not removing - # any other stuff that might have been added. Like the one for - # stylesheets. + # Since we are inserting scripts into a per-tab collection, + # rather than just injecting scripts on page load, we need to + # make sure we replace existing scripts, not just add new ones. + # While, taking care not to remove any other scripts that might + # have been added elsewhere, like the one for stylesheets. greasemonkey = objreg.get('greasemonkey') scripts = self._widget.page().scripts() for script in scripts.toList(): From 324966cfe7316a395f3b043f734cd090b78d54f7 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 26 Jun 2018 13:05:27 +1200 Subject: [PATCH 045/324] greasemonkey: also support qute-js-world on 5.7.1 A straight copy from webengintab. Yes I know I shouldn't be importing a private thing from webenginetab, I'm working on refactoring now. --- qutebrowser/browser/webengine/webview.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 76007b9d9..2eea5d837 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -288,7 +288,19 @@ class WebEnginePage(QWebEnginePage): def _add_script(script, injection_point): new_script = QWebEngineScript() new_script.setInjectionPoint(injection_point) - new_script.setWorldId(QWebEngineScript.MainWorld) + try: + world = int(script.jsworld) + except ValueError: + try: + from qutebrowser.browser.webengine.webenginetab import _JS_WORLD_MAP + world = _JS_WORLD_MAP[usertypes.JsWorld[ + script.jsworld.lower()]] + except KeyError: + log.greasemonkey.error( + "script {} has invalid value for '@qute-js-world'" + ": {}".format(script.name, script.jsworld)) + return + new_script.setWorldId(world) new_script.setSourceCode(script.code()) new_script.setName("GM-{}".format(script.name)) new_script.setRunsOnSubFrames(script.runs_on_sub_frames) From 6f1232e621355f8940993dc5c1bed4252b113aef Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 26 Jun 2018 14:25:38 +1200 Subject: [PATCH 046/324] greasemonkey: move 5.7.1 injection method into _WebEngineScripts Moves the 5.8 check to `_WebEngineScripts.init()`. Changes `_inject_userscripts` to allow for the two code paths. With 5.7.1 we need to specify the injection point and not clear all scripts for each call, since we have to call it three times. Change the 5.8+ hook to call a new method which passes all the scripts into `_inject_userscripts` so that doesn't have to have a fallback conditional inside it because thats an inversion of responsibility! Pulling the remove scripts part into a seperate function and making it the callers responsibilty to call that first would tidy it up a little more but meh. I was worried about just doing `_widget.page().urlChanged.connect()` once at tab init, where before it was connected at page init, because I was under the impression that the child page can be replaced at any time, eg when navigating to a new origin. But under manual testing I didn't see that at all. Maybe I was mistaken or maybe that only started in a later Qt version. --- qutebrowser/browser/webengine/webenginetab.py | 76 +++++++++++++------ qutebrowser/browser/webengine/webview.py | 56 +------------- 2 files changed, 54 insertions(+), 78 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index a62524496..d3d497ec7 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -854,9 +854,16 @@ class _WebEngineScripts(QObject): self._inject_early_js('js', js_code, subframes=True) self._init_stylesheet() - greasemonkey = objreg.get('greasemonkey') - greasemonkey.scripts_reloaded.connect(self._inject_userscripts) - self._inject_userscripts() + # The Greasemonkey metadata block support in QtWebEngine only starts at + # Qt 5.8. With 5.7.1, we need to inject the scripts ourselves in + # response to urlChanged. + if not qtutils.version_check('5.8'): + self._widget.page().urlChanged.connect( + self._inject_userscripts_for_url) + else: + greasemonkey = objreg.get('greasemonkey') + greasemonkey.scripts_reloaded.connect(self._inject_all_userscripts) + self._inject_all_userscripts() def _init_stylesheet(self): """Initialize custom stylesheets. @@ -873,32 +880,52 @@ class _WebEngineScripts(QObject): ) self._inject_early_js('stylesheet', js_code, subframes=True) - def _inject_userscripts(self): - """Register user JavaScript files with the current tab.""" - # The Greasemonkey metadata block support in QtWebEngine only starts at - # Qt 5.8. With 5.7.1, we need to inject the scripts ourselves in - # response to urlChanged. - if not qtutils.version_check('5.8'): - return + def _inject_userscripts_for_url(self, url): + greasemonkey = objreg.get('greasemonkey') + matching_scripts = greasemonkey.scripts_for(url) + self._inject_userscripts( + matching_scripts.start, QWebEngineScript.DocumentCreation, True) + self._inject_userscripts( + matching_scripts.end, QWebEngineScript.DocumentReady, False) + self._inject_userscripts( + matching_scripts.idle, QWebEngineScript.Deferred, False) + def _inject_all_userscripts(self): + greasemonkey = objreg.get('greasemonkey') + scripts = greasemonkey.all_scripts() + self._inject_userscripts(scripts) + + def _inject_userscripts(self, scripts=None, injection_point=None, + remove_first=True): + """Register user JavaScript files with the current tab. + + Args: + scripts: A list of GreasemonkeyScripts, or None to add all + known by the Greasemonkey subsystem. + injection_point: The QWebEngineScript::InjectionPoint stage + to inject the script into, None to use + auto-detection. + remove_first: Whether to remove all previously injected + scripts before adding these ones. + """ # Since we are inserting scripts into a per-tab collection, # rather than just injecting scripts on page load, we need to # make sure we replace existing scripts, not just add new ones. # While, taking care not to remove any other scripts that might # have been added elsewhere, like the one for stylesheets. - greasemonkey = objreg.get('greasemonkey') - scripts = self._widget.page().scripts() - for script in scripts.toList(): - if script.name().startswith("GM-"): - log.greasemonkey.debug('Removing script: {}' - .format(script.name())) - removed = scripts.remove(script) - assert removed, script.name() + page_scripts = self._widget.page().scripts() + if remove_first: + for script in page_scripts.toList(): + if script.name().startswith("GM-"): + log.greasemonkey.debug('Removing script: {}' + .format(script.name())) + removed = page_scripts.remove(script) + assert removed, script.name() - # Then add the new scripts. - for script in greasemonkey.all_scripts(): - # @run-at (and @include/@exclude/@match) is parsed by - # QWebEngineScript. + if not scripts: + return + + for script in scripts: new_script = QWebEngineScript() try: world = int(script.jsworld) @@ -915,9 +942,12 @@ class _WebEngineScripts(QObject): new_script.setSourceCode(script.code()) new_script.setName("GM-{}".format(script.name)) new_script.setRunsOnSubFrames(script.runs_on_sub_frames) + # Override the @run-at value parsed by QWebEngineScript if desired. + if injection_point: + new_script.setInjectionPoint(injection_point) log.greasemonkey.debug('adding script: {}' .format(new_script.name())) - scripts.insert(new_script) + page_scripts.insert(new_script) class WebEngineTab(browsertab.AbstractTab): diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 2eea5d837..75b5df354 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -20,11 +20,10 @@ """The main browser widget for QtWebEngine.""" import sip -from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, PYQT_VERSION +from PyQt5.QtCore import pyqtSignal, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette from PyQt5.QtWidgets import QWidget from PyQt5.QtWebEngineWidgets import (QWebEngineView, QWebEnginePage, - QWebEngineScript, QWebEngineCertificateError) from qutebrowser.browser import shared @@ -169,7 +168,6 @@ class WebEnginePage(QWebEnginePage): self._theme_color = theme_color self._set_bg_color() config.instance.changed.connect(self._set_bg_color) - self.urlChanged.connect(self._inject_userjs) @config.change_filter('colors.webpage.bg') def _set_bg_color(self): @@ -264,55 +262,3 @@ class WebEnginePage(QWebEnginePage): is_main_frame=is_main_frame) self.navigation_request.emit(navigation) return navigation.accepted - - @pyqtSlot('QUrl') - def _inject_userjs(self, url): - """Inject userscripts registered for `url` into the current page.""" - if qtutils.version_check('5.8'): - # Handled in webenginetab with the builtin Greasemonkey - # support. - return - - # Using QWebEnginePage.scripts() to hold the user scripts means - # we don't have to worry ourselves about where to inject the - # page but also means scripts hang around for the tab lifecycle. - # So clear them here. - scripts = self.scripts() - for script in scripts.toList(): - if script.name().startswith("GM-"): - log.greasemonkey.debug("Removing script: {}" - .format(script.name())) - removed = scripts.remove(script) - assert removed, script.name() - - def _add_script(script, injection_point): - new_script = QWebEngineScript() - new_script.setInjectionPoint(injection_point) - try: - world = int(script.jsworld) - except ValueError: - try: - from qutebrowser.browser.webengine.webenginetab import _JS_WORLD_MAP - world = _JS_WORLD_MAP[usertypes.JsWorld[ - script.jsworld.lower()]] - except KeyError: - log.greasemonkey.error( - "script {} has invalid value for '@qute-js-world'" - ": {}".format(script.name, script.jsworld)) - return - new_script.setWorldId(world) - new_script.setSourceCode(script.code()) - new_script.setName("GM-{}".format(script.name)) - new_script.setRunsOnSubFrames(script.runs_on_sub_frames) - log.greasemonkey.debug("Adding script: {}" - .format(new_script.name())) - scripts.insert(new_script) - - greasemonkey = objreg.get('greasemonkey') - matching_scripts = greasemonkey.scripts_for(url) - for script in matching_scripts.start: - _add_script(script, QWebEngineScript.DocumentCreation) - for script in matching_scripts.end: - _add_script(script, QWebEngineScript.DocumentReady) - for script in matching_scripts.idle: - _add_script(script, QWebEngineScript.Deferred) From ee2c7658592d65030c76178267d04ac63213b2d9 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 26 Jun 2018 14:45:38 +1200 Subject: [PATCH 047/324] greasemonkey: check _widget is not deleted Just for good luck. No crash has been reported here but it is a common pattern for functions called from signals. --- qutebrowser/browser/webengine/webenginetab.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index d3d497ec7..8734a4b04 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -908,6 +908,9 @@ class _WebEngineScripts(QObject): remove_first: Whether to remove all previously injected scripts before adding these ones. """ + if sip.isdeleted(self._widget): + return + # Since we are inserting scripts into a per-tab collection, # rather than just injecting scripts on page load, we need to # make sure we replace existing scripts, not just add new ones. From c43d173197b02bd765a47335643d3643b35f687f Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 26 Jun 2018 14:54:32 +1200 Subject: [PATCH 048/324] greasemonkey: s/userscripts/greasemonkey_scripts/ No need to confuse developers as well as users. --- qutebrowser/browser/webengine/webenginetab.py | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 8734a4b04..43fecf9f1 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -859,11 +859,12 @@ class _WebEngineScripts(QObject): # response to urlChanged. if not qtutils.version_check('5.8'): self._widget.page().urlChanged.connect( - self._inject_userscripts_for_url) + self._inject_greasemonkey_scripts_for_url) else: greasemonkey = objreg.get('greasemonkey') - greasemonkey.scripts_reloaded.connect(self._inject_all_userscripts) - self._inject_all_userscripts() + greasemonkey.scripts_reloaded.connect( + self._inject_all_greasemonkey_scripts) + self._inject_all_greasemonkey_scripts() def _init_stylesheet(self): """Initialize custom stylesheets. @@ -880,23 +881,23 @@ class _WebEngineScripts(QObject): ) self._inject_early_js('stylesheet', js_code, subframes=True) - def _inject_userscripts_for_url(self, url): + def _inject_greasemonkey_scripts_for_url(self, url): greasemonkey = objreg.get('greasemonkey') matching_scripts = greasemonkey.scripts_for(url) - self._inject_userscripts( + self._inject_greasemonkey_scripts( matching_scripts.start, QWebEngineScript.DocumentCreation, True) - self._inject_userscripts( + self._inject_greasemonkey_scripts( matching_scripts.end, QWebEngineScript.DocumentReady, False) - self._inject_userscripts( + self._inject_greasemonkey_scripts( matching_scripts.idle, QWebEngineScript.Deferred, False) - def _inject_all_userscripts(self): + def _inject_all_greasemonkey_scripts(self): greasemonkey = objreg.get('greasemonkey') scripts = greasemonkey.all_scripts() - self._inject_userscripts(scripts) + self._inject_greasemonkey_scripts(scripts) - def _inject_userscripts(self, scripts=None, injection_point=None, - remove_first=True): + def _inject_greasemonkey_scripts(self, scripts=None, injection_point=None, + remove_first=True): """Register user JavaScript files with the current tab. Args: From 85a9f6a08abfdeff9d29c1cb8cd3d45ec8c5b0a5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 10:23:48 +0200 Subject: [PATCH 049/324] Fix lint --- qutebrowser/browser/webengine/webenginetab.py | 3 +-- qutebrowser/browser/webengine/webview.py | 5 ++--- tests/end2end/features/test_prompts_bdd.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 185021bfa..8e88a6efb 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -31,8 +31,7 @@ from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, from PyQt5.QtGui import QKeyEvent, QIcon from PyQt5.QtNetwork import QAuthenticator from PyQt5.QtWidgets import QApplication -from PyQt5.QtWebEngineWidgets import (QWebEnginePage, QWebEngineScript, - QWebEngineCertificateError) +from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript from qutebrowser.config import configdata, config from qutebrowser.browser import browsertab, mouse, shared diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 76007b9d9..6a854d513 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -24,13 +24,12 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette from PyQt5.QtWidgets import QWidget from PyQt5.QtWebEngineWidgets import (QWebEngineView, QWebEnginePage, - QWebEngineScript, - QWebEngineCertificateError) + QWebEngineScript) from qutebrowser.browser import shared from qutebrowser.browser.webengine import webenginesettings, certificateerror from qutebrowser.config import config -from qutebrowser.utils import log, debug, usertypes, jinja, objreg, qtutils +from qutebrowser.utils import log, debug, usertypes, objreg, qtutils from qutebrowser.misc import miscwidgets diff --git a/tests/end2end/features/test_prompts_bdd.py b/tests/end2end/features/test_prompts_bdd.py index 47b449ec1..ef55ae662 100644 --- a/tests/end2end/features/test_prompts_bdd.py +++ b/tests/end2end/features/test_prompts_bdd.py @@ -55,10 +55,10 @@ def ssl_error_page(request, quteproc): else: if not request.config.webengine: line = quteproc.wait_for(message='Error while loading *: SSL ' - 'handshake failed') + 'handshake failed') line.expected = True quteproc.wait_for(message="Changing title for idx * to 'Error " - "loading page: *'") + "loading page: *'") content = quteproc.get_content().strip() assert "Unable to load page" in content From 3312c221c4691357a8564448f4d2c0f686a4944e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 10:26:17 +0200 Subject: [PATCH 050/324] Stabilize ssl_strict test --- tests/end2end/features/test_prompts_bdd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/end2end/features/test_prompts_bdd.py b/tests/end2end/features/test_prompts_bdd.py index ef55ae662..a21c943f1 100644 --- a/tests/end2end/features/test_prompts_bdd.py +++ b/tests/end2end/features/test_prompts_bdd.py @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . +import time + import pytest_bdd as bdd bdd.scenarios('prompts.feature') @@ -50,6 +52,7 @@ def no_prompt_shown(quteproc): def ssl_error_page(request, quteproc): if request.config.webengine and qtutils.version_check('5.9'): quteproc.wait_for(message="Certificate error: *") + time.sleep(0.5) # Wait for error page to appear content = quteproc.get_content().strip() assert "ERR_INSECURE_RESPONSE" in content else: From 1536843f33d3113c1355ad7cd600dc4e7dd458c9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 10:39:04 +0200 Subject: [PATCH 051/324] Only get greasemonkey object once --- qutebrowser/browser/webengine/webenginetab.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index aa1c014ef..3fc4806cd 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -788,6 +788,7 @@ class _WebEngineScripts(QObject): super().__init__(parent) self._tab = tab self._widget = None + self._greasemonkey = objreg.get('greasemonkey') def connect_signals(self): config.instance.changed.connect(self._on_config_changed) @@ -860,8 +861,7 @@ class _WebEngineScripts(QObject): self._widget.page().urlChanged.connect( self._inject_greasemonkey_scripts_for_url) else: - greasemonkey = objreg.get('greasemonkey') - greasemonkey.scripts_reloaded.connect( + self._greasemonkey.scripts_reloaded.connect( self._inject_all_greasemonkey_scripts) self._inject_all_greasemonkey_scripts() @@ -881,8 +881,7 @@ class _WebEngineScripts(QObject): self._inject_early_js('stylesheet', js_code, subframes=True) def _inject_greasemonkey_scripts_for_url(self, url): - greasemonkey = objreg.get('greasemonkey') - matching_scripts = greasemonkey.scripts_for(url) + matching_scripts = self._greasemonkey.scripts_for(url) self._inject_greasemonkey_scripts( matching_scripts.start, QWebEngineScript.DocumentCreation, True) self._inject_greasemonkey_scripts( @@ -891,8 +890,7 @@ class _WebEngineScripts(QObject): matching_scripts.idle, QWebEngineScript.Deferred, False) def _inject_all_greasemonkey_scripts(self): - greasemonkey = objreg.get('greasemonkey') - scripts = greasemonkey.all_scripts() + scripts = self._greasemonkey.all_scripts() self._inject_greasemonkey_scripts(scripts) def _inject_greasemonkey_scripts(self, scripts=None, injection_point=None, From ea4ee6f00b35d83339becc08b4596c5e53f880a4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 10:39:33 +0200 Subject: [PATCH 052/324] Use the url_changed signal in the tab API --- qutebrowser/browser/webengine/webenginetab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 3fc4806cd..799eb7c24 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -858,7 +858,7 @@ class _WebEngineScripts(QObject): # Qt 5.8. With 5.7.1, we need to inject the scripts ourselves in # response to urlChanged. if not qtutils.version_check('5.8'): - self._widget.page().urlChanged.connect( + self._tab.url_changed.connect( self._inject_greasemonkey_scripts_for_url) else: self._greasemonkey.scripts_reloaded.connect( From 8519aa940fc51eaa666e20c8021f4c2fae13c933 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 10:40:13 +0200 Subject: [PATCH 053/324] Decorate slots properly --- qutebrowser/browser/webengine/webenginetab.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 799eb7c24..aec3783aa 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -880,6 +880,7 @@ class _WebEngineScripts(QObject): ) self._inject_early_js('stylesheet', js_code, subframes=True) + @pyqtSlot(QUrl) def _inject_greasemonkey_scripts_for_url(self, url): matching_scripts = self._greasemonkey.scripts_for(url) self._inject_greasemonkey_scripts( @@ -889,6 +890,7 @@ class _WebEngineScripts(QObject): self._inject_greasemonkey_scripts( matching_scripts.idle, QWebEngineScript.Deferred, False) + @pyqtSlot() def _inject_all_greasemonkey_scripts(self): scripts = self._greasemonkey.all_scripts() self._inject_greasemonkey_scripts(scripts) From aed964d9f567fe9ad72b595aa8c15c9a3c654c26 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 10:41:21 +0200 Subject: [PATCH 054/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b8df97ea3..f4c62a713 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -106,6 +106,8 @@ Changed logged. - On Qt 5.9 or newer, certificate errors now show Chromium's detailed error page. +- Greasemonkey scripts now support a "@qute-js-world" tag to run them in a + different JavaScript context. Fixed ~~~~~ From 2f612aa6dffb4e60d7cc62881ccfd41a2eb411d2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 15:54:56 +0200 Subject: [PATCH 055/324] Update comment --- qutebrowser/utils/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index dc5168a8d..570d1f887 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -318,7 +318,7 @@ def _chromium_version(): Qt 5.9: Chromium 56 Qt 5.10: Chromium 61 Qt 5.11: Chromium 65 - Qt 5.12: Chromium 69 (?) + Qt 5.12: Chromium 69 (? - current dev branch: 67) Also see https://www.chromium.org/developers/calendar """ From a804300dc022afc8870a0ee117cba2c32ee79890 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 26 Jun 2018 16:56:22 +0200 Subject: [PATCH 056/324] Add missing tests for spell.init() --- tests/unit/browser/webengine/test_spell.py | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/unit/browser/webengine/test_spell.py b/tests/unit/browser/webengine/test_spell.py index 1cc2c5d0f..2532eb907 100644 --- a/tests/unit/browser/webengine/test_spell.py +++ b/tests/unit/browser/webengine/test_spell.py @@ -92,3 +92,60 @@ def test_local_filename_installed_malformed(tmpdir, monkeypatch, caplog): (tmpdir / lang_file).ensure() with caplog.at_level(logging.WARNING): assert spell.local_filename('en-US') == 'en-US-11-0' + + +class TestInit: + + ENV = 'QTWEBENGINE_DICTIONARIES_PATH' + + @pytest.fixture(autouse=True) + def remove_envvar(self, monkeypatch): + monkeypatch.delenv(self.ENV, raising=False) + + @pytest.fixture + def patch_new_qt(self, monkeypatch): + monkeypatch.setattr(spell.qtutils, 'version_check', + lambda _ver, compiled: True) + + @pytest.fixture + def dict_dir(self, data_tmpdir): + return data_tmpdir / 'qtwebengine_dictionaries' + + @pytest.fixture + def old_dict_dir(self, monkeypatch, tmpdir): + data_dir = tmpdir / 'old' + dict_dir = data_dir / 'qtwebengine_dictionaries' + (dict_dir / 'somedict').ensure() + monkeypatch.setattr(spell.QLibraryInfo, 'location', + lambda _arg: data_dir) + return dict_dir + + def test_old_qt(self, monkeypatch): + monkeypatch.setattr(spell.qtutils, 'version_check', + lambda _ver, compiled: False) + spell.init() + assert self.ENV not in os.environ + + def test_new_qt(self, dict_dir, patch_new_qt): + spell.init() + assert os.environ[self.ENV] == str(dict_dir) + + def test_moving(self, old_dict_dir, dict_dir, patch_new_qt): + spell.init() + assert (dict_dir / 'somedict').exists() + + def test_moving_oserror(self, mocker, caplog, + old_dict_dir, dict_dir, patch_new_qt): + mocker.patch('shutil.copytree', side_effect=OSError) + + with caplog.at_level(logging.ERROR): + spell.init() + + record = caplog.records[0] + assert record.message == 'Failed to copy old dictionaries' + + def test_moving_existing_destdir(self, old_dict_dir, dict_dir, + patch_new_qt): + dict_dir.ensure(dir=True) + spell.init() + assert not (dict_dir / 'somedict').exists() From 96defc5dc275418c7753f93344066c68e13f69a3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 27 Jun 2018 15:53:58 +0200 Subject: [PATCH 057/324] Update PyYAML to 4.1 --- misc/requirements/requirements-tests-git.txt | 6 +----- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/misc/requirements/requirements-tests-git.txt b/misc/requirements/requirements-tests-git.txt index 6681dd15e..ce00cd31c 100644 --- a/misc/requirements/requirements-tests-git.txt +++ b/misc/requirements/requirements-tests-git.txt @@ -35,8 +35,4 @@ git+https://github.com/pallets/markupsafe.git hg+http://bitbucket.org/birkenfeld/pygments-main hg+https://bitbucket.org/fdik/pypeg git+https://github.com/python-attrs/attrs.git - -# Fails to build: -# gcc: error: ext/_yaml.c: No such file or directory -# hg+https://bitbucket.org/xi/pyyaml -PyYAML==3.12 +git+https://github.com/yaml/pyyaml.git diff --git a/requirements.txt b/requirements.txt index 2695ba55f..4d4e1972e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ Jinja2==2.10 MarkupSafe==1.0 Pygments==2.2.0 pyPEG2==2.15.2 -PyYAML==3.12 +PyYAML==4.1 From e9c78b29edf312faeb9d82bd6c0bd576df632cd5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 27 Jun 2018 15:56:31 +0200 Subject: [PATCH 058/324] Ignore Python 3.7 collections.abc warning Related issues/PRs: https://github.com/yaml/pyyaml/pull/181 https://github.com/pypa/setuptools/issues/1401 https://github.com/pallets/markupsafe/pull/98 https://github.com/yaml/pyyaml/pull/181 https://github.com/pallets/jinja/pull/867 --- pytest.ini | 3 +++ qutebrowser/utils/log.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/pytest.ini b/pytest.ini index c897f0be7..452841a6e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -64,3 +64,6 @@ qt_log_ignore = ^QSettings::value: Empty key passed ^Icon theme ".*" not found xfail_strict = true +filterwarnings = + # This happens in many qutebrowser dependencies... + ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working:DeprecationWarning diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index 30e570e16..48711614d 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -209,6 +209,11 @@ def _init_py_warnings(): """Initialize Python warning handling.""" warnings.simplefilter('default') warnings.filterwarnings('ignore', module='pdb', category=ResourceWarning) + # This happens in many qutebrowser dependencies... + warnings.filterwarnings('ignore', category=DeprecationWarning, + message="Using or importing the ABCs from " + "'collections' instead of from 'collections.abc' " + "is deprecated, and in 3.8 it will stop working") @contextlib.contextmanager From a7af5195d14a0604e6809f58e97b168b78493dda Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 28 Jun 2018 11:22:44 +0200 Subject: [PATCH 059/324] Set title when showing PDF.js error page Fixes #3894 --- doc/changelog.asciidoc | 2 ++ qutebrowser/browser/webkit/webpage.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index f4c62a713..64a051ad0 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -116,6 +116,8 @@ Fixed - The security fix in v1.3.3 caused URLs with ampersands (`www.example.com?one=1&two=2`) to send the wrong arguments when clicked on the `qute://history` page. +- Crash when opening a PDF page with PDF.js enabled (on QtWebKit), but no + PDF.js installed. Removed ~~~~~~~ diff --git a/qutebrowser/browser/webkit/webpage.py b/qutebrowser/browser/webkit/webpage.py index 853ff1b81..a6c26c8ee 100644 --- a/qutebrowser/browser/webkit/webpage.py +++ b/qutebrowser/browser/webkit/webpage.py @@ -212,7 +212,8 @@ class BrowserPage(QWebPage): page = pdfjs.generate_pdfjs_page(reply.url()) except pdfjs.PDFJSNotFound: page = jinja.render('no_pdfjs.html', - url=reply.url().toDisplayString()) + url=reply.url().toDisplayString(), + title="PDF.js not found") self.mainFrame().setContent(page.encode('utf-8'), 'text/html', reply.url()) reply.deleteLater() From dbd4ce48e656308aacef313c172b421159f21c8b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 28 Jun 2018 11:43:32 +0200 Subject: [PATCH 060/324] Downgrade and filter PyYAML 4.1 This reverts commit 96defc5dc275418c7753f93344066c68e13f69a3. With PyYAML 4.1 we don't have C extensions on Travis CI: https://github.com/yaml/pyyaml/issues/179 https://github.com/yaml/pyyaml/issues/182 Unfortunately, cython isn't in the APT whitelist either: https://github.com/travis-ci/apt-source-whitelist/issues/37 --- misc/requirements/requirements-qutebrowser.txt-raw | 4 +++- misc/requirements/requirements-tests-git.txt | 6 +++++- requirements.txt | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/misc/requirements/requirements-qutebrowser.txt-raw b/misc/requirements/requirements-qutebrowser.txt-raw index c66c65beb..506af17c0 100644 --- a/misc/requirements/requirements-qutebrowser.txt-raw +++ b/misc/requirements/requirements-qutebrowser.txt-raw @@ -1,7 +1,9 @@ Jinja2 Pygments pyPEG2 -PyYAML +PyYAML!=4.1 colorama cssutils attrs + +#@ filter: PyYAML != 4.1 diff --git a/misc/requirements/requirements-tests-git.txt b/misc/requirements/requirements-tests-git.txt index ce00cd31c..6681dd15e 100644 --- a/misc/requirements/requirements-tests-git.txt +++ b/misc/requirements/requirements-tests-git.txt @@ -35,4 +35,8 @@ git+https://github.com/pallets/markupsafe.git hg+http://bitbucket.org/birkenfeld/pygments-main hg+https://bitbucket.org/fdik/pypeg git+https://github.com/python-attrs/attrs.git -git+https://github.com/yaml/pyyaml.git + +# Fails to build: +# gcc: error: ext/_yaml.c: No such file or directory +# hg+https://bitbucket.org/xi/pyyaml +PyYAML==3.12 diff --git a/requirements.txt b/requirements.txt index 4d4e1972e..842b0c42d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ Jinja2==2.10 MarkupSafe==1.0 Pygments==2.2.0 pyPEG2==2.15.2 -PyYAML==4.1 +PyYAML==3.12 # rq.filter: != 4.1 From e857400c2cff543a67714afe163970f5b7b7fe48 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 28 Jun 2018 13:26:45 +0200 Subject: [PATCH 061/324] Add missing str() --- tests/unit/browser/webengine/test_spell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/browser/webengine/test_spell.py b/tests/unit/browser/webengine/test_spell.py index 2532eb907..14b343df5 100644 --- a/tests/unit/browser/webengine/test_spell.py +++ b/tests/unit/browser/webengine/test_spell.py @@ -117,7 +117,7 @@ class TestInit: dict_dir = data_dir / 'qtwebengine_dictionaries' (dict_dir / 'somedict').ensure() monkeypatch.setattr(spell.QLibraryInfo, 'location', - lambda _arg: data_dir) + lambda _arg: str(data_dir)) return dict_dir def test_old_qt(self, monkeypatch): From f7ae7e7d40849ea033050e43d4d8515587c3abf2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 23 Jun 2018 14:32:57 +0200 Subject: [PATCH 062/324] Update for PyQt 5.11 --- .appveyor.yml | 2 +- .travis.yml | 13 +++---------- README.asciidoc | 4 ++-- doc/contributing.asciidoc | 2 -- misc/requirements/requirements-pyqt-old.txt | 4 ---- misc/requirements/requirements-pyqt-old.txt-raw | 2 -- misc/requirements/requirements-pyqt.txt | 4 ++-- tox.ini | 7 ++++--- 8 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 misc/requirements/requirements-pyqt-old.txt delete mode 100644 misc/requirements/requirements-pyqt-old.txt-raw diff --git a/.appveyor.yml b/.appveyor.yml index f2424fc94..d336f20cc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,7 @@ environment: PYTHONUNBUFFERED: 1 PYTHON: C:\Python36\python.exe matrix: - - TESTENV: py36-pyqt510 + - TESTENV: py36-pyqt511 - TESTENV: pylint install: diff --git a/.travis.yml b/.travis.yml index 143938aef..c8732fe29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,16 +20,9 @@ matrix: - os: linux env: TESTENV=py36-pyqt59 - os: linux - env: TESTENV=py36-pyqt510-cov - # We need a newer Xvfb as a WORKAROUND for: - # https://bugreports.qt.io/browse/QTBUG-64928 - sudo: required - addons: - apt: - sources: - - sourceline: "deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe" - packages: - - xvfb + env: TESTENV=py36-pyqt510 + - os: linux + env: TESTENV=py36-pyqt511-cov - os: osx env: TESTENV=py36 OSX=sierra osx_image: xcode9.2 diff --git a/README.asciidoc b/README.asciidoc index db401d49d..2237955dd 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -97,7 +97,7 @@ Requirements The following software and libraries are required to run qutebrowser: * http://www.python.org/[Python] 3.5 or newer (3.6 recommended) -* http://qt.io/[Qt] 5.7.1 or newer (5.10 recommended) with the following modules: +* http://qt.io/[Qt] 5.7.1 or newer (5.11.1 recommended) with the following modules: - QtCore / qtbase - QtQuick (part of qtbase in some distributions) - QtSQL (part of qtbase in some distributions) @@ -107,7 +107,7 @@ The following software and libraries are required to run qutebrowser: link:https://github.com/annulen/webkit/wiki[updated fork] (5.212) is supported * http://www.riverbankcomputing.com/software/pyqt/intro[PyQt] 5.7.0 or newer - (5.10 recommended) for Python 3 + (5.11.2 recommended) for Python 3 * https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools] * http://fdik.org/pyPEG/[pyPEG2] * http://jinja.pocoo.org/[jinja2] diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index 07c2dfe25..b130825ec 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -689,8 +689,6 @@ New PyQt release ~~~~~~~~~~~~~~~~ * See above. -* Install new PyQt in Windows VM (32- and 64-bit). -* Download new installer and update PyQt installer path in `ci_install.py`. * Update `tox.ini`/`.travis.yml`/`.appveyor.yml` to test new versions. qutebrowser release diff --git a/misc/requirements/requirements-pyqt-old.txt b/misc/requirements/requirements-pyqt-old.txt deleted file mode 100644 index f0fa50ad5..000000000 --- a/misc/requirements/requirements-pyqt-old.txt +++ /dev/null @@ -1,4 +0,0 @@ -# This file is automatically generated by scripts/dev/recompile_requirements.py - -PyQt5==5.10 # rq.filter: != 5.10.1 -sip==4.19.8 diff --git a/misc/requirements/requirements-pyqt-old.txt-raw b/misc/requirements/requirements-pyqt-old.txt-raw deleted file mode 100644 index 16b82e0d5..000000000 --- a/misc/requirements/requirements-pyqt-old.txt-raw +++ /dev/null @@ -1,2 +0,0 @@ -PyQt5==5.10.0 -#@ filter: PyQt5 != 5.10.1 \ No newline at end of file diff --git a/misc/requirements/requirements-pyqt.txt b/misc/requirements/requirements-pyqt.txt index 059ff2df7..063f85122 100644 --- a/misc/requirements/requirements-pyqt.txt +++ b/misc/requirements/requirements-pyqt.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -PyQt5==5.10.1 -sip==4.19.8 +PyQt5==5.11.2 +PyQt5-sip==4.19.11 diff --git a/tox.ini b/tox.ini index 4e155df57..ab7be4d83 100644 --- a/tox.ini +++ b/tox.ini @@ -13,8 +13,8 @@ skipsdist = true setenv = QT_QPA_PLATFORM_PLUGIN_PATH={envdir}/Lib/site-packages/PyQt5/plugins/platforms PYTEST_QT_API=pyqt5 - pyqt{,56,571,59,510}: LINK_PYQT_SKIP=true - pyqt{,56,571,59,510}: QUTE_BDD_WEBENGINE=true + pyqt{,56,571,59,510,511}: LINK_PYQT_SKIP=true + pyqt{,56,571,59,510,511}: QUTE_BDD_WEBENGINE=true cov: PYTEST_ADDOPTS=--cov --cov-report xml --cov-report=html --cov-report= passenv = PYTHON DISPLAY XAUTHORITY HOME USERNAME USER CI TRAVIS XDG_* QUTE_* DOCKER basepython = @@ -28,6 +28,7 @@ deps = pyqt571: PyQt5==5.7.1 pyqt59: PyQt5==5.9.2 pyqt510: PyQt5==5.10.1 + pyqt511: PyQt5==5.11.2 commands = {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} -bb -m pytest {posargs:tests} @@ -59,7 +60,7 @@ commands = {envpython} -c "" usedevelop = true deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/misc/requirements/requirements-pyqt-old.txt + -r{toxinidir}/misc/requirements/requirements-pyqt.txt [testenv:misc] ignore_errors = true From c3455d9082bf7c32ed3932c9d4ad5edef1c51f0f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 23 Jun 2018 15:57:30 +0200 Subject: [PATCH 063/324] Add a wrapper around sip Starting with PyQt 5.11, the sip module now is bundled with PyQt as PyQt.sip. Having a qutebrowser.qt also helps with #3625, see #995 --- doc/changelog.asciidoc | 1 + qutebrowser/browser/browsertab.py | 2 +- qutebrowser/browser/downloads.py | 2 +- qutebrowser/browser/downloadview.py | 2 +- qutebrowser/browser/qutescheme.py | 2 +- qutebrowser/browser/webengine/webenginetab.py | 2 +- qutebrowser/browser/webengine/webview.py | 2 +- qutebrowser/browser/webkit/webkittab.py | 2 +- qutebrowser/browser/webkit/webpage.py | 2 +- qutebrowser/mainwindow/prompt.py | 2 +- qutebrowser/misc/earlyinit.py | 2 +- qutebrowser/misc/sessions.py | 2 +- qutebrowser/misc/utilcmds.py | 2 +- qutebrowser/qt.py | 28 +++++++++++++++++++ scripts/dev/ci/travis_install.sh | 5 +++- tests/conftest.py | 2 +- tests/unit/utils/test_version.py | 2 +- 17 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 qutebrowser/qt.py diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 64a051ad0..07b11207a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -21,6 +21,7 @@ v1.4.0 (unreleased) Added ~~~~~ +- Support for the bundled `sip` module in PyQt 5.11. - New `--debug-flag log-requests` to log requests to the debug log for debugging. - New `--first` flag for `:hint` (bound to `gi` for inputs) which automatically diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 9f2e891c5..0170b4627 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -22,7 +22,6 @@ import enum import itertools -import sip import attr from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, QObject, QSizeF, Qt from PyQt5.QtGui import QIcon @@ -38,6 +37,7 @@ from qutebrowser.utils import (utils, objreg, usertypes, log, qtutils, urlutils, message) from qutebrowser.misc import miscwidgets, objects from qutebrowser.browser import mouse, hints +from qutebrowser.qt import sip tab_id_gen = itertools.count(0) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index dd112e00a..2e30c26c2 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -29,7 +29,6 @@ import pathlib import tempfile import enum -import sip from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QObject, QModelIndex, QTimer, QAbstractListModel, QUrl) @@ -37,6 +36,7 @@ from qutebrowser.commands import cmdexc, cmdutils from qutebrowser.config import config from qutebrowser.utils import (usertypes, standarddir, utils, message, log, qtutils) +from qutebrowser.qt import sip ModelRole = enum.IntEnum('ModelRole', ['item'], start=Qt.UserRole) diff --git a/qutebrowser/browser/downloadview.py b/qutebrowser/browser/downloadview.py index 80da117d2..e90e37509 100644 --- a/qutebrowser/browser/downloadview.py +++ b/qutebrowser/browser/downloadview.py @@ -21,13 +21,13 @@ import functools -import sip from PyQt5.QtCore import pyqtSlot, QSize, Qt, QTimer from PyQt5.QtWidgets import QListView, QSizePolicy, QMenu, QStyleFactory from qutebrowser.browser import downloads from qutebrowser.config import config from qutebrowser.utils import qtutils, utils, objreg +from qutebrowser.qt import sip def update_geometry(obj): diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index e3483bac0..b3787e5d0 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -34,7 +34,6 @@ import urllib import collections import pkg_resources -import sip from PyQt5.QtCore import QUrlQuery, QUrl import qutebrowser @@ -42,6 +41,7 @@ from qutebrowser.config import config, configdata, configexc, configdiff from qutebrowser.utils import (version, utils, jinja, log, message, docutils, objreg, urlutils) from qutebrowser.misc import objects +from qutebrowser.qt import sip pyeval_output = ":pyeval was never called" diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index aec3783aa..6254dd191 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -25,7 +25,6 @@ import sys import re import html as html_utils -import sip from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, QUrl, QTimer, QObject, qVersion) from PyQt5.QtGui import QKeyEvent, QIcon @@ -42,6 +41,7 @@ from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory, from qutebrowser.misc import miscwidgets from qutebrowser.utils import (usertypes, qtutils, log, javascript, utils, message, objreg, jinja, debug) +from qutebrowser.qt import sip _qute_scheme_handler = None diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index ca4126833..b10cc5f9a 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -19,7 +19,6 @@ """The main browser widget for QtWebEngine.""" -import sip from PyQt5.QtCore import pyqtSignal, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette from PyQt5.QtWidgets import QWidget @@ -30,6 +29,7 @@ from qutebrowser.browser.webengine import webenginesettings, certificateerror from qutebrowser.config import config from qutebrowser.utils import log, debug, usertypes, objreg, qtutils from qutebrowser.misc import miscwidgets +from qutebrowser.qt import sip class WebEngineView(QWebEngineView): diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 8039eb5eb..31cb82f29 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -23,7 +23,6 @@ import re import functools import xml.etree.ElementTree -import sip from PyQt5.QtCore import (pyqtSlot, Qt, QEvent, QUrl, QPoint, QTimer, QSizeF, QSize) from PyQt5.QtGui import QKeyEvent, QIcon @@ -35,6 +34,7 @@ from qutebrowser.browser import browsertab, shared from qutebrowser.browser.webkit import (webview, tabhistory, webkitelem, webkitsettings) from qutebrowser.utils import qtutils, usertypes, utils, log, debug +from qutebrowser.qt import sip class WebKitAction(browsertab.AbstractAction): diff --git a/qutebrowser/browser/webkit/webpage.py b/qutebrowser/browser/webkit/webpage.py index a6c26c8ee..4e0701329 100644 --- a/qutebrowser/browser/webkit/webpage.py +++ b/qutebrowser/browser/webkit/webpage.py @@ -22,7 +22,6 @@ import html import functools -import sip from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QUrl, QPoint from PyQt5.QtGui import QDesktopServices from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest @@ -35,6 +34,7 @@ from qutebrowser.browser import pdfjs, shared from qutebrowser.browser.webkit import http from qutebrowser.browser.webkit.network import networkmanager from qutebrowser.utils import message, usertypes, log, jinja, objreg +from qutebrowser.qt import sip class BrowserPage(QWebPage): diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index f7af28440..357f63dd7 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -24,7 +24,6 @@ import html import collections import attr -import sip from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QTimer, QDir, QModelIndex, QItemSelectionModel, QObject, QEventLoop) from PyQt5.QtWidgets import (QWidget, QGridLayout, QVBoxLayout, QLineEdit, @@ -36,6 +35,7 @@ from qutebrowser.config import config from qutebrowser.utils import usertypes, log, utils, qtutils, objreg, message from qutebrowser.keyinput import modeman from qutebrowser.commands import cmdutils, cmdexc +from qutebrowser.qt import sip prompt_queue = None diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 9649d27cc..92e3a9731 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -246,7 +246,7 @@ def configure_pyqt(): from PyQt5.QtCore import pyqtRemoveInputHook pyqtRemoveInputHook() - import sip + from qutebrowser.qt import sip try: # Added in sip 4.19.4 sip.enableoverflowchecking(True) diff --git a/qutebrowser/misc/sessions.py b/qutebrowser/misc/sessions.py index dddf48b05..358ab0c53 100644 --- a/qutebrowser/misc/sessions.py +++ b/qutebrowser/misc/sessions.py @@ -24,7 +24,6 @@ import os.path import itertools import urllib -import sip from PyQt5.QtCore import QUrl, QObject, QPoint, QTimer from PyQt5.QtWidgets import QApplication import yaml @@ -35,6 +34,7 @@ from qutebrowser.commands import cmdexc, cmdutils from qutebrowser.config import config, configfiles from qutebrowser.completion.models import miscmodels from qutebrowser.mainwindow import mainwindow +from qutebrowser.qt import sip default = object() # Sentinel value diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 5d987afa3..66483e09a 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -29,7 +29,6 @@ try: except ImportError: hunter = None -import sip from PyQt5.QtCore import QUrl # so it's available for :debug-pyeval from PyQt5.QtWidgets import QApplication # pylint: disable=unused-import @@ -40,6 +39,7 @@ from qutebrowser.commands import cmdutils, runners, cmdexc from qutebrowser.config import config, configdata from qutebrowser.misc import consolewidget from qutebrowser.utils.version import pastebin_version +from qutebrowser.qt import sip @cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True) diff --git a/qutebrowser/qt.py b/qutebrowser/qt.py new file mode 100644 index 000000000..2878bbe98 --- /dev/null +++ b/qutebrowser/qt.py @@ -0,0 +1,28 @@ +# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: + +# Copyright 2018 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +"""Wrappers around Qt/PyQt code.""" + +# pylint: disable=unused-import +# PyQt 5.11 comes with a bundled sip, +# for older PyQt versions it's a separate module. +try: + from PyQt5 import sip +except ImportError: + import sip diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 20aa1c12d..29711a11b 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -62,7 +62,10 @@ check_pyqt() { python3 < Date: Sat, 23 Jun 2018 17:21:55 +0200 Subject: [PATCH 064/324] Add workaround for PyQt 5.11 headerDataChanged bug https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html --- doc/changelog.asciidoc | 3 ++- qutebrowser/browser/downloads.py | 7 ++++++- qutebrowser/completion/models/completionmodel.py | 8 +++++++- qutebrowser/completion/models/histcategory.py | 6 ++++++ qutebrowser/completion/models/listcategory.py | 8 +++++++- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 07b11207a..1b97a906b 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -21,7 +21,8 @@ v1.4.0 (unreleased) Added ~~~~~ -- Support for the bundled `sip` module in PyQt 5.11. +- Support for the bundled `sip` module in PyQt 5.11 and workarounds for + PyQt 5.11 bugs. - New `--debug-flag log-requests` to log requests to the debug log for debugging. - New `--first` flag for `:hint` (bound to `gi` for inputs) which automatically diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 2e30c26c2..b06cedbfd 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -30,7 +30,7 @@ import tempfile import enum from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QObject, QModelIndex, - QTimer, QAbstractListModel, QUrl) + QTimer, QAbstractListModel, QUrl, PYQT_VERSION) from qutebrowser.commands import cmdexc, cmdutils from qutebrowser.config import config @@ -878,6 +878,11 @@ class DownloadModel(QAbstractListModel): """A list model showing downloads.""" + if PYQT_VERSION == 0x050b00: + # WORKAROUND for PyQt 5.11 bug: + # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html + headerDataChanged = pyqtSignal(Qt.Orientation, int, int) + def __init__(self, qtnetwork_manager, webengine_manager=None, parent=None): super().__init__(parent) self._qtnetwork_manager = qtnetwork_manager diff --git a/qutebrowser/completion/models/completionmodel.py b/qutebrowser/completion/models/completionmodel.py index 1c77e1d31..633d425d9 100644 --- a/qutebrowser/completion/models/completionmodel.py +++ b/qutebrowser/completion/models/completionmodel.py @@ -19,7 +19,8 @@ """A model that proxies access to one or more completion categories.""" -from PyQt5.QtCore import Qt, QModelIndex, QAbstractItemModel +from PyQt5.QtCore import (Qt, QModelIndex, QAbstractItemModel, pyqtSignal, + PYQT_VERSION) from qutebrowser.utils import log, qtutils from qutebrowser.commands import cmdexc @@ -38,6 +39,11 @@ class CompletionModel(QAbstractItemModel): _categories: The sub-categories. """ + if PYQT_VERSION == 0x050b00: + # WORKAROUND for PyQt 5.11 bug: + # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html + headerDataChanged = pyqtSignal(Qt.Orientation, int, int) + def __init__(self, *, column_widths=(30, 70, 0), parent=None): super().__init__(parent) self.column_widths = column_widths diff --git a/qutebrowser/completion/models/histcategory.py b/qutebrowser/completion/models/histcategory.py index 60f801492..06fa487ed 100644 --- a/qutebrowser/completion/models/histcategory.py +++ b/qutebrowser/completion/models/histcategory.py @@ -19,6 +19,7 @@ """A completion category that queries the SQL History store.""" +from PyQt5.QtCore import pyqtSignal, Qt, PYQT_VERSION from PyQt5.QtSql import QSqlQueryModel from qutebrowser.misc import sql @@ -30,6 +31,11 @@ class HistoryCategory(QSqlQueryModel): """A completion category that queries the SQL History store.""" + if PYQT_VERSION == 0x050b00: + # WORKAROUND for PyQt 5.11 bug: + # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html + headerDataChanged = pyqtSignal(Qt.Orientation, int, int) + def __init__(self, *, delete_func=None, parent=None): """Create a new History completion category.""" super().__init__(parent=parent) diff --git a/qutebrowser/completion/models/listcategory.py b/qutebrowser/completion/models/listcategory.py index 13bc1e6b2..1d0c41e99 100644 --- a/qutebrowser/completion/models/listcategory.py +++ b/qutebrowser/completion/models/listcategory.py @@ -21,7 +21,8 @@ import re -from PyQt5.QtCore import Qt, QSortFilterProxyModel, QRegExp +from PyQt5.QtCore import (Qt, QSortFilterProxyModel, QRegExp, PYQT_VERSION, + pyqtSignal) from PyQt5.QtGui import QStandardItem, QStandardItemModel from qutebrowser.utils import qtutils @@ -31,6 +32,11 @@ class ListCategory(QSortFilterProxyModel): """Expose a list of items as a category for the CompletionModel.""" + if PYQT_VERSION == 0x050b00: + # WORKAROUND for PyQt 5.11 bug: + # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html + headerDataChanged = pyqtSignal(Qt.Orientation, int, int) + def __init__(self, name, items, sort=True, delete_func=None, parent=None): super().__init__(parent) self.name = name From ad19833e34796fe72a2d3e5c948b623c1dd1e92a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 24 Jun 2018 08:49:51 +0200 Subject: [PATCH 065/324] Revert "Add workaround for PyQt 5.11 headerDataChanged bug" PyQt 5.11.1 has already been released, with the bug fixed. This reverts commit 291763a55643342a6f977ce2a12dcc6f4badbe8a. --- doc/changelog.asciidoc | 3 +-- qutebrowser/browser/downloads.py | 7 +------ qutebrowser/completion/models/completionmodel.py | 8 +------- qutebrowser/completion/models/histcategory.py | 6 ------ qutebrowser/completion/models/listcategory.py | 8 +------- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 1b97a906b..07b11207a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -21,8 +21,7 @@ v1.4.0 (unreleased) Added ~~~~~ -- Support for the bundled `sip` module in PyQt 5.11 and workarounds for - PyQt 5.11 bugs. +- Support for the bundled `sip` module in PyQt 5.11. - New `--debug-flag log-requests` to log requests to the debug log for debugging. - New `--first` flag for `:hint` (bound to `gi` for inputs) which automatically diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index b06cedbfd..2e30c26c2 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -30,7 +30,7 @@ import tempfile import enum from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QObject, QModelIndex, - QTimer, QAbstractListModel, QUrl, PYQT_VERSION) + QTimer, QAbstractListModel, QUrl) from qutebrowser.commands import cmdexc, cmdutils from qutebrowser.config import config @@ -878,11 +878,6 @@ class DownloadModel(QAbstractListModel): """A list model showing downloads.""" - if PYQT_VERSION == 0x050b00: - # WORKAROUND for PyQt 5.11 bug: - # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html - headerDataChanged = pyqtSignal(Qt.Orientation, int, int) - def __init__(self, qtnetwork_manager, webengine_manager=None, parent=None): super().__init__(parent) self._qtnetwork_manager = qtnetwork_manager diff --git a/qutebrowser/completion/models/completionmodel.py b/qutebrowser/completion/models/completionmodel.py index 633d425d9..1c77e1d31 100644 --- a/qutebrowser/completion/models/completionmodel.py +++ b/qutebrowser/completion/models/completionmodel.py @@ -19,8 +19,7 @@ """A model that proxies access to one or more completion categories.""" -from PyQt5.QtCore import (Qt, QModelIndex, QAbstractItemModel, pyqtSignal, - PYQT_VERSION) +from PyQt5.QtCore import Qt, QModelIndex, QAbstractItemModel from qutebrowser.utils import log, qtutils from qutebrowser.commands import cmdexc @@ -39,11 +38,6 @@ class CompletionModel(QAbstractItemModel): _categories: The sub-categories. """ - if PYQT_VERSION == 0x050b00: - # WORKAROUND for PyQt 5.11 bug: - # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html - headerDataChanged = pyqtSignal(Qt.Orientation, int, int) - def __init__(self, *, column_widths=(30, 70, 0), parent=None): super().__init__(parent) self.column_widths = column_widths diff --git a/qutebrowser/completion/models/histcategory.py b/qutebrowser/completion/models/histcategory.py index 06fa487ed..60f801492 100644 --- a/qutebrowser/completion/models/histcategory.py +++ b/qutebrowser/completion/models/histcategory.py @@ -19,7 +19,6 @@ """A completion category that queries the SQL History store.""" -from PyQt5.QtCore import pyqtSignal, Qt, PYQT_VERSION from PyQt5.QtSql import QSqlQueryModel from qutebrowser.misc import sql @@ -31,11 +30,6 @@ class HistoryCategory(QSqlQueryModel): """A completion category that queries the SQL History store.""" - if PYQT_VERSION == 0x050b00: - # WORKAROUND for PyQt 5.11 bug: - # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html - headerDataChanged = pyqtSignal(Qt.Orientation, int, int) - def __init__(self, *, delete_func=None, parent=None): """Create a new History completion category.""" super().__init__(parent=parent) diff --git a/qutebrowser/completion/models/listcategory.py b/qutebrowser/completion/models/listcategory.py index 1d0c41e99..13bc1e6b2 100644 --- a/qutebrowser/completion/models/listcategory.py +++ b/qutebrowser/completion/models/listcategory.py @@ -21,8 +21,7 @@ import re -from PyQt5.QtCore import (Qt, QSortFilterProxyModel, QRegExp, PYQT_VERSION, - pyqtSignal) +from PyQt5.QtCore import Qt, QSortFilterProxyModel, QRegExp from PyQt5.QtGui import QStandardItem, QStandardItemModel from qutebrowser.utils import qtutils @@ -32,11 +31,6 @@ class ListCategory(QSortFilterProxyModel): """Expose a list of items as a category for the CompletionModel.""" - if PYQT_VERSION == 0x050b00: - # WORKAROUND for PyQt 5.11 bug: - # https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html - headerDataChanged = pyqtSignal(Qt.Orientation, int, int) - def __init__(self, name, items, sort=True, delete_func=None, parent=None): super().__init__(parent) self.name = name From 77fe2e1c859c3b74905aa05746f48d36e7d6312a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 23 Jun 2018 17:25:30 +0200 Subject: [PATCH 066/324] Fix test_set_wrong_backend --- tests/unit/config/test_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index e1ef7ef94..bf4f7c02d 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -642,8 +642,8 @@ class TestConfig: meth = getattr(conf, method) with pytest.raises(configexc.BackendError): with qtbot.assert_not_emitted(conf.changed): - meth('content.cookies.accept', 'all') - assert not conf._values['content.cookies.accept'] + meth('hints.find_implementation', 'javascript') + assert not conf._values['hints.find_implementation'] @pytest.mark.parametrize('method, value', [ ('set_obj', {}), From d861c097b157a88d69dd54b0ab7e428c91977270 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 23 Jun 2018 18:10:00 +0200 Subject: [PATCH 067/324] Support new dead keys added in Qt 5.11 properly See https://codereview.qt-project.org/#/c/207231/ --- qutebrowser/keyinput/keyutils.py | 31 ++++++++++++++++ tests/unit/keyinput/key_data.py | 61 ++++++++++++++++---------------- 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index f0cf9c22a..e22e24f77 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -138,6 +138,37 @@ def _key_to_string(key): 'Dead_Hook': 'Hook', 'Dead_Horn': 'Horn', + 'Dead_Stroke': '̵', + 'Dead_Abovecomma': '̓', + 'Dead_Abovereversedcomma': '̔', + 'Dead_Doublegrave': '̏', + 'Dead_Belowring': '̥', + 'Dead_Belowmacron': '̱', + 'Dead_Belowcircumflex': '̭', + 'Dead_Belowtilde': '̰', + 'Dead_Belowbreve': '̮', + 'Dead_Belowdiaeresis': '̤', + 'Dead_Invertedbreve': '̑', + 'Dead_Belowcomma': '̦', + 'Dead_Currency': '¤', + 'Dead_a': 'a', + 'Dead_A': 'A', + 'Dead_e': 'e', + 'Dead_E': 'E', + 'Dead_i': 'i', + 'Dead_I': 'I', + 'Dead_o': 'o', + 'Dead_O': 'O', + 'Dead_u': 'u', + 'Dead_U': 'U', + 'Dead_Small_Schwa': 'ə', + 'Dead_Capital_Schwa': 'Ə', + 'Dead_Greek': 'Greek', + 'Dead_Lowline': '̲', + 'Dead_Aboveverticalline': '̍', + 'Dead_Belowverticalline': '\u0329', + 'Dead_Longsolidusoverlay': '̸', + 'Memo': 'Memo', 'ToDoList': 'To Do List', 'Calendar': 'Calendar', diff --git a/tests/unit/keyinput/key_data.py b/tests/unit/keyinput/key_data.py index bf1ccdede..48b5c8c56 100644 --- a/tests/unit/keyinput/key_data.py +++ b/tests/unit/keyinput/key_data.py @@ -374,37 +374,36 @@ KEYS = [ Key('Dead_Hook', 'Hook', qtest=False), Key('Dead_Horn', 'Horn', qtest=False), - # Not in Qt 5.10, so data may be wrong! - Key('Dead_Stroke', qtest=False), - Key('Dead_Abovecomma', qtest=False), - Key('Dead_Abovereversedcomma', qtest=False), - Key('Dead_Doublegrave', qtest=False), - Key('Dead_Belowring', qtest=False), - Key('Dead_Belowmacron', qtest=False), - Key('Dead_Belowcircumflex', qtest=False), - Key('Dead_Belowtilde', qtest=False), - Key('Dead_Belowbreve', qtest=False), - Key('Dead_Belowdiaeresis', qtest=False), - Key('Dead_Invertedbreve', qtest=False), - Key('Dead_Belowcomma', qtest=False), - Key('Dead_Currency', qtest=False), - Key('Dead_a', qtest=False), - Key('Dead_A', qtest=False), - Key('Dead_e', qtest=False), - Key('Dead_E', qtest=False), - Key('Dead_i', qtest=False), - Key('Dead_I', qtest=False), - Key('Dead_o', qtest=False), - Key('Dead_O', qtest=False), - Key('Dead_u', qtest=False), - Key('Dead_U', qtest=False), - Key('Dead_Small_Schwa', qtest=False), - Key('Dead_Capital_Schwa', qtest=False), - Key('Dead_Greek', qtest=False), - Key('Dead_Lowline', qtest=False), - Key('Dead_Aboveverticalline', qtest=False), - Key('Dead_Belowverticalline', qtest=False), - Key('Dead_Longsolidusoverlay', qtest=False), + Key('Dead_Stroke', '̵', qtest=False), + Key('Dead_Abovecomma', '̓', qtest=False), + Key('Dead_Abovereversedcomma', '̔', qtest=False), + Key('Dead_Doublegrave', '̏', qtest=False), + Key('Dead_Belowring', '̥', qtest=False), + Key('Dead_Belowmacron', '̱', qtest=False), + Key('Dead_Belowcircumflex', '̭', qtest=False), + Key('Dead_Belowtilde', '̰', qtest=False), + Key('Dead_Belowbreve', '̮', qtest=False), + Key('Dead_Belowdiaeresis', '̤', qtest=False), + Key('Dead_Invertedbreve', '̑', qtest=False), + Key('Dead_Belowcomma', '̦', qtest=False), + Key('Dead_Currency', '¤', qtest=False), + Key('Dead_a', 'a', qtest=False), + Key('Dead_A', 'A', qtest=False), + Key('Dead_e', 'e', qtest=False), + Key('Dead_E', 'E', qtest=False), + Key('Dead_i', 'i', qtest=False), + Key('Dead_I', 'I', qtest=False), + Key('Dead_o', 'o', qtest=False), + Key('Dead_O', 'O', qtest=False), + Key('Dead_u', 'u', qtest=False), + Key('Dead_U', 'U', qtest=False), + Key('Dead_Small_Schwa', 'ə', qtest=False), + Key('Dead_Capital_Schwa', 'Ə', qtest=False), + Key('Dead_Greek', 'Greek', qtest=False), + Key('Dead_Lowline', '̲', qtest=False), + Key('Dead_Aboveverticalline', '̍', qtest=False), + Key('Dead_Belowverticalline', '\u0329', qtest=False), + Key('Dead_Longsolidusoverlay', '̸', qtest=False), ### multimedia/internet keys - ignored by default - see QKeyEvent c'tor Key('Back'), From 9a14574c9f87d3e8937b513746bd222b5e5e319c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 23 Jun 2018 18:31:01 +0200 Subject: [PATCH 068/324] Skip invalid links on any Qt 5.11 version See #3661 --- tests/end2end/features/hints.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index e33b16f68..3a0cb1da0 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -165,13 +165,13 @@ Feature: Using hints And I hint with args "all run message-info {hint-url}" and follow a Then the message "http://localhost:(port)/data/hello.txt" should be shown - @qt!=5.11.0 + @qt<5.11 Scenario: Clicking an invalid link When I open data/invalid_link.html And I hint with args "all" and follow a Then the error "Invalid link clicked - *" should be shown - @qt!=5.11.0 + @qt<5.11 Scenario: Clicking an invalid link opening in a new tab When I open data/invalid_link.html And I hint with args "all tab" and follow a From 41303ecfcfad4d8c054cc113c0065ff016033d24 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 27 Jun 2018 12:53:29 +0200 Subject: [PATCH 069/324] Make sure temporary dir exists This seems to be enforced with Qt 5.12 See #4025 --- tests/unit/utils/test_standarddir.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/utils/test_standarddir.py b/tests/unit/utils/test_standarddir.py index a483ede64..b9777f670 100644 --- a/tests/unit/utils/test_standarddir.py +++ b/tests/unit/utils/test_standarddir.py @@ -183,10 +183,13 @@ class TestStandardDir: @pytest.mark.qt_log_ignore(r'^QStandardPaths: ') def test_linux_invalid_runtimedir(self, monkeypatch, tmpdir): """With invalid XDG_RUNTIME_DIR, fall back to TempLocation.""" + tmpdir_env = tmpdir / 'temp' + tmpdir_env.ensure(dir=True) monkeypatch.setenv('XDG_RUNTIME_DIR', str(tmpdir / 'does-not-exist')) - monkeypatch.setenv('TMPDIR', str(tmpdir / 'temp')) + monkeypatch.setenv('TMPDIR', tmpdir_env) + standarddir._init_dirs() - assert standarddir.runtime() == str(tmpdir / 'temp' / APPNAME) + assert standarddir.runtime() == str(tmpdir_env / APPNAME) @pytest.mark.fake_os('windows') def test_runtimedir_empty_tempdir(self, monkeypatch, tmpdir): From 6ca11ed95bd68b0b296bcdb7dbe0c750f8baf9d5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 2 Jul 2018 23:15:04 +0200 Subject: [PATCH 070/324] Adjust SSL test for Qt 5.11 --- tests/end2end/features/test_prompts_bdd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/end2end/features/test_prompts_bdd.py b/tests/end2end/features/test_prompts_bdd.py index a21c943f1..0d74700b4 100644 --- a/tests/end2end/features/test_prompts_bdd.py +++ b/tests/end2end/features/test_prompts_bdd.py @@ -54,7 +54,8 @@ def ssl_error_page(request, quteproc): quteproc.wait_for(message="Certificate error: *") time.sleep(0.5) # Wait for error page to appear content = quteproc.get_content().strip() - assert "ERR_INSECURE_RESPONSE" in content + assert ("ERR_INSECURE_RESPONSE" in content or # Qt <= 5.10 + "ERR_CERT_AUTHORITY_INVALID" in content) # Qt 5.11 else: if not request.config.webengine: line = quteproc.wait_for(message='Error while loading *: SSL ' From f6f713bbfe58f428432a3f10d4d00f5b1cedcf1b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 2 Jul 2018 23:19:57 +0200 Subject: [PATCH 071/324] Skip key forwarding tests on Qt 5.11.1 See #4036 --- tests/end2end/features/keyinput.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/end2end/features/keyinput.feature b/tests/end2end/features/keyinput.feature index f681012f1..5456b6739 100644 --- a/tests/end2end/features/keyinput.feature +++ b/tests/end2end/features/keyinput.feature @@ -18,6 +18,7 @@ Feature: Keyboard input # input.forward_unbound_keys + @qt<5.11.1 Scenario: Forwarding all keys When I open data/keyinput/log.html And I set input.forward_unbound_keys to all @@ -30,6 +31,7 @@ Feature: Keyboard input And the javascript message "key press: 112" should be logged And the javascript message "key release: 112" should be logged + @qt<5.11.1 Scenario: Forwarding special keys When I open data/keyinput/log.html And I set input.forward_unbound_keys to auto From 1d91a3ac66953b1cd1a2214a71be71dc0575052f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 2 Jul 2018 19:21:17 +0200 Subject: [PATCH 072/324] Update hypothesis from 3.61.0 to 3.65.0 (cherry picked from commit 98ecc7e77b7dd21037224a4f3b51d0cb654610e6) --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index d48f5b21a..2fa63dced 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -11,7 +11,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.61.0 +hypothesis==3.65.0 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 564cd3732bdd8cefa2bdf6d6fb5ed9a8f98fdffe Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 2 Jul 2018 19:21:19 +0200 Subject: [PATCH 073/324] Update py from 1.5.3 to 1.5.4 (cherry picked from commit 2006ad70e88cf5fffec75aa465f968ebba722758) --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 2fa63dced..4475def05 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -20,7 +20,7 @@ more-itertools==4.2.0 parse==1.8.4 parse-type==0.4.2 pluggy==0.6.0 -py==1.5.3 +py==1.5.4 py-cpuinfo==4.0.0 pytest==3.6.2 pytest-bdd==2.21.0 From c33c01907503f73c0c8838ebeabbf77997c5b01e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 2 Jul 2018 19:21:20 +0200 Subject: [PATCH 074/324] Update py from 1.5.3 to 1.5.4 (cherry picked from commit fa9698564af184e6e7cdddc96c9906442031197e) --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index e8b3de2b1..64ab8bf68 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py pluggy==0.6.0 -py==1.5.3 +py==1.5.4 six==1.11.0 tox==3.0.0 virtualenv==16.0.0 From 1c8917b10e7561d286bfce51bad3d2c76b3f2e00 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 10:27:10 +0200 Subject: [PATCH 075/324] Remove old brew_install line --- scripts/dev/ci/travis_install.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 29711a11b..20dc2da8d 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -43,11 +43,6 @@ travis_retry() { return $result } -brew_install() { - brew update - brew install "$@" -} - pip_install() { travis_retry python3 -m pip install "$@" } From 05531ddcf097cdbe1e4a6dc2a154fecdf0930e12 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 10:27:38 +0200 Subject: [PATCH 076/324] brew: Update instead of install libyaml --- scripts/dev/ci/travis_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 20dc2da8d..18f5aa9ec 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -82,8 +82,8 @@ elif [[ $TRAVIS_OS_NAME == osx ]]; then brew --version brew update - brew upgrade python - brew install qt5 pyqt5 libyaml + brew upgrade python libyaml + brew install qt5 pyqt5 pip_install -r misc/requirements/requirements-tox.txt python3 -m pip --version From 26d6cf8ef60dd21e63f44ce281830ee08d8d5c7b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 10:29:28 +0200 Subject: [PATCH 077/324] Stabilize URL escaping test --- tests/end2end/features/history.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index e1a7d3326..c3791945e 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -118,10 +118,11 @@ Feature: Page history And I open qute://history Then the javascript message "XSS" should not be logged + @flaky Scenario: Escaping of URLs in :history When I open query?one=1&two=2 And I open qute://history - And I wait 0.5s # JS loads the history async + And I wait 1s # JS loads the history async And I hint with args "links normal" and follow a And I wait until query?one=1&two=2 is loaded Then the query parameter two should be set to 2 From efc4eb906954ff6eb40cd675060fc9ed3f632401 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 10:30:30 +0200 Subject: [PATCH 078/324] Use PyYAML from git for requirements-tests-git --- misc/requirements/requirements-tests-git.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/misc/requirements/requirements-tests-git.txt b/misc/requirements/requirements-tests-git.txt index 6681dd15e..ce00cd31c 100644 --- a/misc/requirements/requirements-tests-git.txt +++ b/misc/requirements/requirements-tests-git.txt @@ -35,8 +35,4 @@ git+https://github.com/pallets/markupsafe.git hg+http://bitbucket.org/birkenfeld/pygments-main hg+https://bitbucket.org/fdik/pypeg git+https://github.com/python-attrs/attrs.git - -# Fails to build: -# gcc: error: ext/_yaml.c: No such file or directory -# hg+https://bitbucket.org/xi/pyyaml -PyYAML==3.12 +git+https://github.com/yaml/pyyaml.git From e6e28c846f97535f489ad55b29516e1b5c8bef73 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 10:30:59 +0200 Subject: [PATCH 079/324] Use PyYAML 3.13b1 It seems to be finished except for a missing wheel we don't need, and it makes things work on Python 3.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 842b0c42d..4516340d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ Jinja2==2.10 MarkupSafe==1.0 Pygments==2.2.0 pyPEG2==2.15.2 -PyYAML==3.12 # rq.filter: != 4.1 +PyYAML==3.13b1 # rq.filter: != 4.1 From ec0bbe67f8b67c8419a0e6b815bcf979a38310af Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:00:33 +0200 Subject: [PATCH 080/324] travis: Test with Python 3.7 See https://github.com/travis-ci/travis-ci/issues/9069 --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index c8732fe29..87605f873 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,12 @@ matrix: env: TESTENV=py36-pyqt510 - os: linux env: TESTENV=py36-pyqt511-cov + # https://github.com/travis-ci/travis-ci/issues/9069 + - os: linux + python: 3.7 + sudo: required + dist: xenial + env: TESTENV=py37-pyqt511 - os: osx env: TESTENV=py36 OSX=sierra osx_image: xcode9.2 From 49be92e047a96a7fc2c7c23a269292e560701299 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:06:31 +0200 Subject: [PATCH 081/324] Use 64-bit Python on AppVeyor QtWebEngine isn't available in the 32-bit build. --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d336f20cc..70e51fa42 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,7 +5,7 @@ cache: build: off environment: PYTHONUNBUFFERED: 1 - PYTHON: C:\Python36\python.exe + PYTHON: C:\Python36-x64\python.exe matrix: - TESTENV: py36-pyqt511 - TESTENV: pylint @@ -13,7 +13,7 @@ environment: install: - '%PYTHON% -m pip install -U pip' - '%PYTHON% -m pip install -r misc\requirements\requirements-tox.txt' - - 'set PATH=%PATH%;C:\Python36' + - 'set PATH=%PATH%;C:\Python36-x64' test_script: - '%PYTHON% -m tox -e %TESTENV%' From 0af8eec73a8a4290b0a0348f3ad8d8295e17deaa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:08:56 +0200 Subject: [PATCH 082/324] build_release: Remove 32-bit support for Windows QtWebEngine isn't available for 32-bit anymore: https://blog.qt.io/blog/2018/05/22/qt-5-11-released/ (comments) --- scripts/dev/build_release.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 146b7a462..366c6f393 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -239,17 +239,7 @@ def build_windows(): except FileNotFoundError: python_x64 = r'C:\Python{}\python.exe'.format(ver) - try: - reg32_key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, - r'SOFTWARE\WOW6432Node\Python\PythonCore' - r'\{}-32\InstallPath'.format(dot_ver)) - python_x86 = winreg.QueryValueEx(reg32_key, 'ExecutablePath')[0] - except FileNotFoundError: - python_x86 = r'C:\Python{}-32\python.exe'.format(ver) - out_pyinstaller = os.path.join('dist', 'qutebrowser') - out_32 = os.path.join('dist', - 'qutebrowser-{}-x86'.format(qutebrowser.__version__)) out_64 = os.path.join('dist', 'qutebrowser-{}-x64'.format(qutebrowser.__version__)) @@ -258,12 +248,6 @@ def build_windows(): utils.print_title("Updating VersionInfo file") gen_versioninfo.main() - utils.print_title("Running pyinstaller 32bit") - _maybe_remove(out_32) - call_tox('pyinstaller', '-r', python=python_x86) - shutil.move(out_pyinstaller, out_32) - patch_windows(out_32) - utils.print_title("Running pyinstaller 64bit") _maybe_remove(out_64) call_tox('pyinstaller', '-r', python=python_x64) @@ -279,31 +263,17 @@ def build_windows(): '/DVERSION={}'.format(qutebrowser.__version__), 'misc/qutebrowser.nsi'], check=True) - name_32 = 'qutebrowser-{}-win32.exe'.format(qutebrowser.__version__) name_64 = 'qutebrowser-{}-amd64.exe'.format(qutebrowser.__version__) artifacts += [ - (os.path.join('dist', name_32), - 'application/vnd.microsoft.portable-executable', - 'Windows 32bit installer'), (os.path.join('dist', name_64), 'application/vnd.microsoft.portable-executable', 'Windows 64bit installer'), ] - utils.print_title("Running 32bit smoke test") - smoke_test(os.path.join(out_32, 'qutebrowser.exe')) utils.print_title("Running 64bit smoke test") smoke_test(os.path.join(out_64, 'qutebrowser.exe')) - utils.print_title("Zipping 32bit standalone...") - name = 'qutebrowser-{}-windows-standalone-win32'.format( - qutebrowser.__version__) - shutil.make_archive(name, 'zip', 'dist', os.path.basename(out_32)) - artifacts.append(('{}.zip'.format(name), - 'application/zip', - 'Windows 32bit standalone')) - utils.print_title("Zipping 64bit standalone...") name = 'qutebrowser-{}-windows-standalone-amd64'.format( qutebrowser.__version__) From 5add2cd9302bf4c116f2fc4443d5627b192f045b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:15:59 +0200 Subject: [PATCH 083/324] Update changelog --- doc/changelog.asciidoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 07b11207a..79a75f49f 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -123,6 +123,10 @@ Fixed Removed ~~~~~~~ +- No prebuilt binaries for 32-bit Windows are supplied anymore. This is due to + Qt removing QtWebEngine support for those upstream. It might be possible to + distribute 32-bit binaries again with Qt 5.12 in December, but that will only + happen if it turns out enough people actually need 32-bit support. - `:tab-detach` which has been deprecated in v1.1.0 has been removed. - The `content.developer_extras` setting got removed. On QtWebKit, developer extras are now automatically enabled when opening the inspector. From f65f3db747b862d0acb6838dbd915febac99f155 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:17:27 +0200 Subject: [PATCH 084/324] appveyor: Make sure we get the Python we want --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 70e51fa42..92a20c0bd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,7 +13,7 @@ environment: install: - '%PYTHON% -m pip install -U pip' - '%PYTHON% -m pip install -r misc\requirements\requirements-tox.txt' - - 'set PATH=%PATH%;C:\Python36-x64' + - 'set PATH=C:\Python36-x64;%PATH' test_script: - '%PYTHON% -m tox -e %TESTENV%' From b8fb5d45909780a8c51c0706673eeea6fe186470 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:37:26 +0200 Subject: [PATCH 085/324] Make sure we're using Python 3.6 in release instructions --- doc/contributing.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index b130825ec..26ff12a15 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -710,8 +710,8 @@ qutebrowser release as closed. * Linux: Run `git checkout v1.$x.$y && ./.venv/bin/python3 scripts/dev/build_release.py --upload v1.$x.$y`. -* Windows: Run `git checkout v1.X.Y; C:\Python36-32\python scripts\dev\build_release.py --asciidoc C:\Python27\python C:\asciidoc-8.6.9\asciidoc.py --upload v1.X.Y` (replace X/Y by hand). -* macOS: Run `git checkout v1.X.Y && python3 scripts/dev/build_release.py --upload v1.X.Y` (replace X/Y by hand). +* Windows: Run `git checkout v1.X.Y; py -3.6 scripts\dev\build_release.py --asciidoc C:\Python27\python C:\asciidoc-8.6.9\asciidoc.py --upload v1.X.Y` (replace X/Y by hand). +* macOS: Run `pyenv shell 3.6.6 && git checkout v1.X.Y && python3 scripts/dev/build_release.py --upload v1.X.Y` (replace X/Y by hand). * On server: - Run `python3 scripts/dev/download_release.py v1.X.Y` (replace X/Y by hand). - Run `git pull github master && sudo python3 scripts/asciidoc2html.py --website /srv/http/qutebrowser` From 38791a2386e273193b33c2a6d1abf82709242382 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 11:38:48 +0200 Subject: [PATCH 086/324] Only import gen_versioninfo on Windows --- scripts/dev/build_release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 366c6f393..689bd49fc 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -45,7 +45,6 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, import qutebrowser from scripts import utils # from scripts.dev import update_3rdparty -from scripts.dev import gen_versioninfo def call_script(name, *args, python=sys.executable): @@ -245,6 +244,7 @@ def build_windows(): artifacts = [] + from scripts.dev import gen_versioninfo utils.print_title("Updating VersionInfo file") gen_versioninfo.main() From 641f7eb3c56a4c5a089700a91b413d462dfb1855 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:08:54 +0200 Subject: [PATCH 087/324] Don't import test_file on Windows See https://github.com/pytest-dev/pytest/issues/3650 --- tests/unit/utils/test_qtutils.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index 6de085b25..3a848474f 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -25,13 +25,6 @@ import os import os.path import unittest import unittest.mock -try: - # pylint: disable=no-name-in-module,useless-suppression - from test import test_file - # pylint: enable=no-name-in-module,useless-suppression -except ImportError: - # Debian patches Python to remove the tests... - test_file = None import pytest from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice, @@ -40,6 +33,20 @@ from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice, from qutebrowser.utils import qtutils, utils import overflow_test_cases +if utils.is_linux: + # Those are not run on macOS because that seems to cause a hang sometimes. + # On Windows, we don't run them either because of + # https://github.com/pytest-dev/pytest/issues/3650 + try: + # pylint: disable=no-name-in-module,useless-suppression + from test import test_file + # pylint: enable=no-name-in-module,useless-suppression + except ImportError: + # Debian patches Python to remove the tests... + test_file = None +else: + test_file = None + # pylint: disable=bad-continuation @pytest.mark.parametrize(['qversion', 'compiled', 'pyqt', 'version', 'exact', @@ -476,13 +483,11 @@ class TestSavefileOpen: assert data == b'foo\nbar\nbaz' -if test_file is not None and not utils.is_mac: +if test_file is not None: # If we were able to import Python's test_file module, we run some code # here which defines unittest TestCases to run the python tests over # PyQIODevice. - # Those are not run on macOS because that seems to cause a hang sometimes. - @pytest.fixture(scope='session', autouse=True) def clean_up_python_testfile(): """Clean up the python testfile after tests if tests didn't.""" From 7e8c741937fc9e34946bf3d6c54436899bf391e9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:10:15 +0200 Subject: [PATCH 088/324] Set compiled=False for BDD Qt comparisons We often check for bugs and not APIs there. --- tests/end2end/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/end2end/conftest.py b/tests/end2end/conftest.py index 136d6eb67..3240cc7b8 100644 --- a/tests/end2end/conftest.py +++ b/tests/end2end/conftest.py @@ -85,8 +85,8 @@ def _get_version_tag(tag): do_skip = { '==': not qtutils.version_check(version, exact=True, compiled=False), - '>=': not qtutils.version_check(version), - '<': qtutils.version_check(version), + '>=': not qtutils.version_check(version, compiled=False), + '<': qtutils.version_check(version, compiled=False), '!=': qtutils.version_check(version, exact=True, compiled=False), } return pytest.mark.skipif(do_skip[op], reason='Needs ' + tag) From d03b03f7cb46a9833477e3bd50f5a582ca9ef20a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:13:58 +0200 Subject: [PATCH 089/324] Use Python 3.7 on macOS --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 87605f873..81a5d6fbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ matrix: dist: xenial env: TESTENV=py37-pyqt511 - os: osx - env: TESTENV=py36 OSX=sierra + env: TESTENV=py37 OSX=sierra osx_image: xcode9.2 language: generic # https://github.com/qutebrowser/qutebrowser/issues/2013 From ba362de2c0209a0f860b3c7cf64fe35cbd56f7f0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:15:07 +0200 Subject: [PATCH 090/324] Turn on AppVeyor debugging --- .appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 92a20c0bd..bab5a5e73 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,3 +17,6 @@ install: test_script: - '%PYTHON% -m tox -e %TESTENV%' + +on_finish: + - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 7a9183d0b718c158dd0bbe456a72623f1e69d5b8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:17:15 +0200 Subject: [PATCH 091/324] Remove 32-bit makensis call I forgot to remove this in 0af8eec73a8a4290b0a0348f3ad8d8295e17deaa --- scripts/dev/build_release.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 689bd49fc..254132b3c 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -255,9 +255,6 @@ def build_windows(): patch_windows(out_64) utils.print_title("Building installers") - subprocess.run(['makensis.exe', - '/DVERSION={}'.format(qutebrowser.__version__), - 'misc/qutebrowser.nsi'], check=True) subprocess.run(['makensis.exe', '/DX64', '/DVERSION={}'.format(qutebrowser.__version__), From 6abe8f2c978f6ef774a7970fbd32ee8882aa785f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:22:05 +0200 Subject: [PATCH 092/324] Ignore QtNetwork warning on macOS --- pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest.ini b/pytest.ini index 452841a6e..1b5016321 100644 --- a/pytest.ini +++ b/pytest.ini @@ -63,6 +63,7 @@ qt_log_ignore = ^inotify_add_watch\(".*"\) failed: "No space left on device" ^QSettings::value: Empty key passed ^Icon theme ".*" not found + ^Error receiving trust for a CA certificate xfail_strict = true filterwarnings = # This happens in many qutebrowser dependencies... From 8115e109db295e4e1d342312ac1766f988c14265 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:27:18 +0200 Subject: [PATCH 093/324] Update default env in tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ab7be4d83..c3b8a258b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py36-pyqt59-cov,misc,vulture,flake8,pylint,pyroma,check-manifest,eslint +envlist = py36-pyqt511-cov,misc,vulture,flake8,pylint,pyroma,check-manifest,eslint distshare = {toxworkdir} skipsdist = true From 24e93fe02371ee9d64b673a0e7ff0f535a1a7a24 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:27:31 +0200 Subject: [PATCH 094/324] Remove AppVeyor debugging --- .appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bab5a5e73..92a20c0bd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,6 +17,3 @@ install: test_script: - '%PYTHON% -m tox -e %TESTENV%' - -on_finish: - - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 857288b283075940b25c29f6beb01ccd5d548139 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:28:18 +0200 Subject: [PATCH 095/324] Try importing QtWebEngine from AppVeyor --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 92a20c0bd..f51b5e727 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -16,4 +16,5 @@ install: - 'set PATH=C:\Python36-x64;%PATH' test_script: + - '%PYTHON% -c "from PyQt5 import QtWebEngineWidgets"' - '%PYTHON% -m tox -e %TESTENV%' From 8c11c516b48412787bec4dd0c639bed72bc8d33c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:32:53 +0200 Subject: [PATCH 096/324] tox: Always allow setting python via envvar --- .appveyor.yml | 1 - tox.ini | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f51b5e727..92a20c0bd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -16,5 +16,4 @@ install: - 'set PATH=C:\Python36-x64;%PATH' test_script: - - '%PYTHON% -c "from PyQt5 import QtWebEngineWidgets"' - '%PYTHON% -m tox -e %TESTENV%' diff --git a/tox.ini b/tox.ini index c3b8a258b..21baa7be5 100644 --- a/tox.ini +++ b/tox.ini @@ -18,9 +18,9 @@ setenv = cov: PYTEST_ADDOPTS=--cov --cov-report xml --cov-report=html --cov-report= passenv = PYTHON DISPLAY XAUTHORITY HOME USERNAME USER CI TRAVIS XDG_* QUTE_* DOCKER basepython = - py35: python3.5 - py36: python3.6 - py37: python3.7 + py35: {env:PYTHON:python3.5} + py36: {env:PYTHON:python3.6} + py37: {env:PYTHON:python3.7} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/misc/requirements/requirements-tests.txt From 4d1e56a8c621126c7fd5375e4d7a635c7293aeba Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:39:34 +0200 Subject: [PATCH 097/324] Ignore "Lost UI shared context" error happening on AppVeyor --- tests/end2end/fixtures/quteprocess.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 4101e6142..01cca1ee1 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -204,6 +204,10 @@ def is_ignored_chromium_message(line): # [30412:30412:0323/074933.387250:ERROR:node_channel.cc(899)] Dropping # message on closed channel. 'Dropping message on closed channel.', + # [2204:1408:0703/113804.788:ERROR: + # gpu_process_transport_factory.cc(1019)] Lost UI shared context. + 'Lost UI shared context.', + ] return any(testutils.pattern_match(pattern=pattern, value=message) for pattern in ignored_messages) From dfafab4cff5fe564297fdcef907b4dac03c0b116 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 13:52:50 +0200 Subject: [PATCH 098/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 79a75f49f..68f2684f3 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -119,6 +119,7 @@ Fixed the `qute://history` page. - Crash when opening a PDF page with PDF.js enabled (on QtWebKit), but no PDF.js installed. +- Crash when closing a tab shortly after opening it. Removed ~~~~~~~ From a0f36c5cbf6b9557313f082a837ac599ba88d4fc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 14:15:08 +0200 Subject: [PATCH 099/324] Skip JS test which is too flaky --- tests/end2end/features/javascript.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index 8c4348e5f..0239f7bb5 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -8,7 +8,7 @@ Feature: Javascript stuff When I open data/javascript/consolelog.html Then the javascript message "console.log works!" should be logged - @flaky + @skip # Too flaky Scenario: Opening/Closing a window via JS When I open data/javascript/window_open.html And I run :tab-only From 42a3622906117b4dbb38ab843cf71309f6f5f688 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 15:38:29 +0200 Subject: [PATCH 100/324] Ignore a new Qt 5.11 lowlevel message --- tests/end2end/fixtures/quteprocess.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 01cca1ee1..e0ba4e00d 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -104,6 +104,15 @@ def is_ignored_lowlevel_message(message): # Qt 5.11 # DevTools listening on ws://127.0.0.1:37945/devtools/browser/... 'DevTools listening on *', + # /home/travis/build/qutebrowser/qutebrowser/.tox/py36-pyqt511-cov/lib/ + # python3.6/site-packages/PyQt5/Qt/libexec/QtWebEngineProcess: + # /lib/x86_64-linux-gnu/libdbus-1.so.3: no version information + # available (required by /home/travis/build/qutebrowser/qutebrowser/ + # .tox/py36-pyqt511-cov/lib/python3.6/site-packages/PyQt5/Qt/libexec/ + # ../lib/libQt5WebEngineCore.so.5) + '*/QtWebEngineProcess: /lib/x86_64-linux-gnu/libdbus-1.so.3: no ' + 'version information available (required by ' + '*/libQt5WebEngineCore.so.5)', ] return any(testutils.pattern_match(pattern=pattern, value=message) for pattern in ignored_messages) From 85cc1e4f849d60aa5cb1d4ebb037637c517aae28 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 15:44:25 +0200 Subject: [PATCH 101/324] Update changelog for v1.4.0 --- doc/changelog.asciidoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 68f2684f3..f550f2ef1 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -15,13 +15,14 @@ breaking changes (such as renamed commands) can happen in minor releases. // `Fixed` for any bug fixes. // `Security` to invite users to upgrade in case of vulnerabilities. -v1.4.0 (unreleased) -------------------- +v1.4.0 +------ Added ~~~~~ -- Support for the bundled `sip` module in PyQt 5.11. +- Support for the bundled `sip` module in PyQt 5.11 and other changes in + Qt/PyQt 5.11.x. - New `--debug-flag log-requests` to log requests to the debug log for debugging. - New `--first` flag for `:hint` (bound to `gi` for inputs) which automatically From 0f037fb415581283074dff8b2d090cefcd337602 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 15:44:44 +0200 Subject: [PATCH 102/324] Release v1.4.0 --- qutebrowser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/__init__.py b/qutebrowser/__init__.py index da982a7de..9061290ae 100644 --- a/qutebrowser/__init__.py +++ b/qutebrowser/__init__.py @@ -26,7 +26,7 @@ __copyright__ = "Copyright 2014-2018 Florian Bruhin (The Compiler)" __license__ = "GPL" __maintainer__ = __author__ __email__ = "mail@qutebrowser.org" -__version_info__ = (1, 3, 3) +__version_info__ = (1, 4, 0) __version__ = '.'.join(str(e) for e in __version_info__) __description__ = "A keyboard-driven, vim-like browser based on PyQt5." From 0a31e19eda91fbb4d5e6a333591cd0b028e7c25a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Jul 2018 17:14:34 +0200 Subject: [PATCH 103/324] Handle download errors when the reply is already gone Fixes #1270 --- doc/changelog.asciidoc | 8 ++++++++ qutebrowser/browser/qtnetworkdownloads.py | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index f550f2ef1..28a7d89ea 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -15,6 +15,14 @@ breaking changes (such as renamed commands) can happen in minor releases. // `Fixed` for any bug fixes. // `Security` to invite users to upgrade in case of vulnerabilities. +v1.5.0 (unreleased) +------------------- + +Fixed +~~~~~ + +- Rare crash when an error occurs in downloads. + v1.4.0 ------ diff --git a/qutebrowser/browser/qtnetworkdownloads.py b/qutebrowser/browser/qtnetworkdownloads.py index 4e992b172..bdd2b280a 100644 --- a/qutebrowser/browser/qtnetworkdownloads.py +++ b/qutebrowser/browser/qtnetworkdownloads.py @@ -29,7 +29,7 @@ from PyQt5.QtCore import pyqtSlot, pyqtSignal, QTimer from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply from qutebrowser.config import config -from qutebrowser.utils import message, usertypes, log, urlutils, utils +from qutebrowser.utils import message, usertypes, log, urlutils, utils, debug from qutebrowser.browser import downloads from qutebrowser.browser.webkit import http from qutebrowser.browser.webkit.network import networkmanager @@ -307,7 +307,14 @@ class DownloadItem(downloads.AbstractDownloadItem): """Handle QNetworkReply errors.""" if code == QNetworkReply.OperationCanceledError: return - self._die(self._reply.errorString()) + + if self._reply is None: + error = "Unknown error: {}".format( + debug.qenum_key(QNetworkReply, code)) + else: + error = self._reply.errorString() + + self._die(error) @pyqtSlot() def _on_read_timer_timeout(self): From e80e695a56516de6bea435345f2ae3589c42d127 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 4 Jul 2018 14:08:04 +0200 Subject: [PATCH 104/324] Add a mkvenv-pypi-old environment Fixes #4038 See #3662 --- doc/install.asciidoc | 4 ++++ tox.ini | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/install.asciidoc b/doc/install.asciidoc index ddf1cd120..f5fccb32e 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -392,6 +392,10 @@ https://docs.python.org/3/library/venv.html[virtual environment]: $ tox -e mkvenv-pypi ---- +If your system comes with Python 3.5.3 or older (such as Ubuntu 16.04 LTS), use +`tox -e mkvenv-pypi-old` instead. This installs an older Qt version (5.10) due +to bugs in newer versions. + This installs all needed Python dependencies in a `.venv` subfolder. This comes with an up-to-date Qt/PyQt including QtWebEngine, but has a few diff --git a/tox.ini b/tox.ini index 21baa7be5..02f3ae729 100644 --- a/tox.ini +++ b/tox.ini @@ -62,6 +62,19 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/misc/requirements/requirements-pyqt.txt +# Older PyQt for Python 3.5 +# 5.11.2: https://www.riverbankcomputing.com/pipermail/pyqt/2018-July/040511.html +# 5.10.1: https://github.com/qutebrowser/qutebrowser/issues/3662 +[testenv:mkvenv-pypi-old] +basepython = {env:PYTHON:python3.5} +envdir = {toxinidir}/.venv +commands = {envpython} -c "" +usedevelop = true +deps = + -r{toxinidir}/requirements.txt + PyQt5==5.10 + sip==4.19.8 + [testenv:misc] ignore_errors = true basepython = {env:PYTHON:python3} From ae32b79d54fa70dff5f948d49371bc1648ba2fe8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 4 Jul 2018 15:37:50 +0200 Subject: [PATCH 105/324] Add exam comments to contributing docs --- .github/CONTRIBUTING.asciidoc | 5 +++++ doc/contributing.asciidoc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/CONTRIBUTING.asciidoc b/.github/CONTRIBUTING.asciidoc index 6449c6323..4421f071a 100644 --- a/.github/CONTRIBUTING.asciidoc +++ b/.github/CONTRIBUTING.asciidoc @@ -1,3 +1,8 @@ +IMPORTANT: I'm currently (July 2018) more busy than usual until September, +because of exams coming up. Review of non-trivial pull requests will thus be +delayed until then. If you're reading this note after mid-September, please +open an issue. + - Before you start to work on something, please leave a comment on the relevant issue (or open one). This makes sure there is no duplicate work done. diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index 26ff12a15..47ecfd9ff 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -5,6 +5,11 @@ The Compiler :data-uri: :toc: +IMPORTANT: I'm currently (July 2018) more busy than usual until September, +because of exams coming up. Review of non-trivial pull requests will thus be +delayed until then. If you're reading this note after mid-September, please +open an issue. + I `<3` footnote:[Of course, that says `<3` in HTML.] contributors! This document contains guidelines for contributing to qutebrowser, as well as From 274b66ec46799799fc4e8cc4015a6369ac3e4042 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 8 Jul 2018 22:09:56 +0200 Subject: [PATCH 106/324] Strip trailing newlines from pastebin URL --- qutebrowser/utils/version.py | 1 + tests/unit/utils/test_version.py | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 570d1f887..a2d949635 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -484,6 +484,7 @@ def pastebin_version(pbclient=None): def _on_paste_version_success(url): global pastebin_url + url = url.strip() _yank_url(url) pbclient.deleteLater() pastebin_url = url diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index e2fbf8f1c..2120a4b97 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -987,11 +987,12 @@ def test_pastebin_version(pbclient, message_mock, monkeypatch, qtbot): monkeypatch.setattr('qutebrowser.utils.utils.log_clipboard', True) version.pastebin_version(pbclient) - pbclient.success.emit("test") + pbclient.success.emit("https://www.example.com/\n") msg = message_mock.getmsg(usertypes.MessageLevel.info) - assert msg.text == "Version url test yanked to clipboard." - assert version.pastebin_url == "test" + expected_text = "Version url https://www.example.com/ yanked to clipboard." + assert msg.text == expected_text + assert version.pastebin_url == "https://www.example.com/" def test_pastebin_version_twice(pbclient, monkeypatch): @@ -1000,16 +1001,16 @@ def test_pastebin_version_twice(pbclient, monkeypatch): lambda: "dummy") version.pastebin_version(pbclient) - pbclient.success.emit("test") + pbclient.success.emit("https://www.example.com/\n") pbclient.url = None pbclient.data = None - version.pastebin_url = "test2" + version.pastebin_url = "https://www.example.org/" version.pastebin_version(pbclient) assert pbclient.url is None assert pbclient.data is None - assert version.pastebin_url == "test2" + assert version.pastebin_url == "https://www.example.org/" def test_pastebin_version_error(pbclient, caplog, message_mock, monkeypatch): From b9e3d3cab905b629f07696e69bcd7a20d1feceef Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 9 Jul 2018 12:29:35 +0200 Subject: [PATCH 107/324] Add workaround for chrome-extension:// URLs Fixes #4049 --- qutebrowser/browser/webengine/webenginequtescheme.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webengine/webenginequtescheme.py b/qutebrowser/browser/webengine/webenginequtescheme.py index 12ab6af31..2434a8889 100644 --- a/qutebrowser/browser/webengine/webenginequtescheme.py +++ b/qutebrowser/browser/webengine/webenginequtescheme.py @@ -37,6 +37,7 @@ class QuteSchemeHandler(QWebEngineUrlSchemeHandler): if qtutils.version_check('5.11', compiled=False): # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-63378 profile.installUrlSchemeHandler(b'chrome-error', self) + profile.installUrlSchemeHandler(b'chrome-extension', self) def requestStarted(self, job): """Handle a request for a qute: scheme. @@ -49,7 +50,7 @@ class QuteSchemeHandler(QWebEngineUrlSchemeHandler): """ url = job.requestUrl() - if url.scheme() == 'chrome-error': + if url.scheme() in ['chrome-error', 'chrome-extension']: # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-63378 job.fail(QWebEngineUrlRequestJob.UrlInvalid) return From e102551f9fc63c6354fb585009ffbbc539b0e4bd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:12 +0200 Subject: [PATCH 108/324] Update setuptools from 39.2.0 to 40.0.0 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 64b096747..bf003fc8f 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==17.1 pyparsing==2.2.0 -setuptools==39.2.0 +setuptools==40.0.0 six==1.11.0 wheel==0.31.1 From ea026b5ecb3f09b6af8ad05530838e09019ff673 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:14 +0200 Subject: [PATCH 109/324] Update cheroot from 6.3.2 to 6.3.2.post0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 4475def05..523443b9e 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -2,7 +2,7 @@ attrs==18.1.0 beautifulsoup4==4.6.0 -cheroot==6.3.2 +cheroot==6.3.2.post0 click==6.7 # colorama==0.3.9 coverage==4.5.1 From d1093d1c1df0ad2849e54f6d97d055ae8abe21f4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:15 +0200 Subject: [PATCH 110/324] Update hypothesis from 3.65.0 to 3.66.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 523443b9e..7df0ba6b9 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -11,7 +11,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.65.0 +hypothesis==3.66.1 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 45da910d23fd6c5c8ecaf379eb6275a4ae20f54f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:17 +0200 Subject: [PATCH 111/324] Update pytest from 3.6.2 to 3.6.3 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 7df0ba6b9..d043d2d19 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -22,7 +22,7 @@ parse-type==0.4.2 pluggy==0.6.0 py==1.5.4 py-cpuinfo==4.0.0 -pytest==3.6.2 +pytest==3.6.3 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 From d817818fb8af41295324779b5e8384f71c6468cd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:18 +0200 Subject: [PATCH 112/324] Update vulture from 0.27 to 0.28 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index d043d2d19..5e66fef82 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -36,5 +36,5 @@ pytest-travis-fold==1.3.0 pytest-xvfb==1.1.0 PyVirtualDisplay==0.2.1 six==1.11.0 -vulture==0.27 +vulture==0.28 Werkzeug==0.14.1 From df3e41db9ba13b16070882fc13b7e7888be3bf98 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:20 +0200 Subject: [PATCH 113/324] Update vulture from 0.27 to 0.28 --- misc/requirements/requirements-vulture.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-vulture.txt b/misc/requirements/requirements-vulture.txt index f1db23e5f..c8a26e83c 100644 --- a/misc/requirements/requirements-vulture.txt +++ b/misc/requirements/requirements-vulture.txt @@ -1,3 +1,3 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -vulture==0.27 +vulture==0.28 From 94f2b6bdb8c894f4d700e646018930ad039a2cc1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:21 +0200 Subject: [PATCH 114/324] Update tox from 3.0.0 to 3.1.1 --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index 64ab8bf68..b40750369 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -3,5 +3,5 @@ pluggy==0.6.0 py==1.5.4 six==1.11.0 -tox==3.0.0 +tox==3.1.1 virtualenv==16.0.0 From 40057c26f5bf1f83e1139fbc2965bcbc40230101 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 9 Jul 2018 19:25:23 +0200 Subject: [PATCH 115/324] Update pyyaml from 3.13b1 to 4.2b4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4516340d7..fe8da411c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ Jinja2==2.10 MarkupSafe==1.0 Pygments==2.2.0 pyPEG2==2.15.2 -PyYAML==3.13b1 # rq.filter: != 4.1 +PyYAML==4.2b4 # rq.filter: != 4.1 From a5c1903247529078299634f0b517416978b13ab3 Mon Sep 17 00:00:00 2001 From: murchik Date: Mon, 9 Jul 2018 11:00:36 +0800 Subject: [PATCH 116/324] OTP for qute-pass. --- misc/userscripts/qute-pass | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass index 892f9c5da..2d6198d92 100755 --- a/misc/userscripts/qute-pass +++ b/misc/userscripts/qute-pass @@ -25,9 +25,17 @@ demonstration can be seen here: https://i.imgur.com/KN3XuZP.gif. USAGE = """The domain of the site has to appear as a segment in the pass path, for example: "github.com/cryzed" or "websites/github.com". How the username and password are determined is freely configurable using the CLI arguments. The login information is inserted by emulating key events using qutebrowser's fake-key command in this manner: -[USERNAME][PASSWORD], which is compatible with almost all login forms.""" +[USERNAME][PASSWORD], which is compatible with almost all login forms. -EPILOG = """Dependencies: tldextract (Python 3 module), pass. +Suggested bindings similar to Uzbl's `formfiller` script: + + config.bind('', 'spawn --userscript qute-pass') + config.bind('', 'spawn --userscript qute-pass --username-only') + config.bind('

', 'spawn --userscript qute-pass --password-only') + config.bind('', 'spawn --userscript qute-pass --otp-only') +""" + +EPILOG = """Dependencies: tldextract (Python 3 module), pass, pass-otp (optional). For issues and feedback please use: https://github.com/cryzed/qutebrowser-userscripts. WARNING: The login details are viewable as plaintext in qutebrowser's debug log (qute://log) and might be shared if @@ -66,6 +74,7 @@ argument_parser.add_argument('--merge-candidates', '-m', action='store_true', group = argument_parser.add_mutually_exclusive_group() group.add_argument('--username-only', '-e', action='store_true', help='Only insert username') group.add_argument('--password-only', '-w', action='store_true', help='Only insert password') +group.add_argument('--otp-only', '-o', action='store_true', help='Only insert OTP code') stderr = functools.partial(print, file=sys.stderr) @@ -98,11 +107,19 @@ def find_pass_candidates(domain, password_store_path): return candidates -def pass_(path, encoding): - process = subprocess.run(['pass', path], stdout=subprocess.PIPE) +def _run_pass(command, encoding): + process = subprocess.run(command, stdout=subprocess.PIPE) return process.stdout.decode(encoding).strip() +def pass_(path, encoding): + return _run_pass(['pass', path], encoding) + + +def pass_otp(path, encoding): + return _run_pass(['pass', 'otp', path], encoding) + + def dmenu(items, invocation, encoding): command = shlex.split(invocation) process = subprocess.run(command, input='\n'.join(items).encode(encoding), stdout=subprocess.PIPE) @@ -169,6 +186,9 @@ def main(arguments): fake_key_raw(username) elif arguments.password_only: fake_key_raw(password) + elif arguments.otp_only: + otp = pass_otp(selection, arguments.io_encoding) + fake_key_raw(otp) else: # Enter username and password using fake-key and (which seems to work almost universally), then switch # back into insert-mode, so the form can be directly submitted by hitting enter afterwards From e24c723700d3eec2b50d9d5e5514c3793223f952 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 15:16:33 +0200 Subject: [PATCH 117/324] Update changelog --- doc/changelog.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 28a7d89ea..b3212ec61 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -18,10 +18,23 @@ breaking changes (such as renamed commands) can happen in minor releases. v1.5.0 (unreleased) ------------------- +Added +~~~~~ + +- The qute-pass userscript now has optional OTP support. + +v1.4.1 (unreleased) +------------------- + Fixed ~~~~~ - Rare crash when an error occurs in downloads. +- Newlines are now stripped from the :version pastebin URL. +- There's a new `mkvenv-pypi-old` environment in `tox.ini` which installs an + older Qt, which is needed on Ubuntu 16.04. +- Worked around a Qt issue which redirects to a `chrome-error://` page when + trying to use U2F. v1.4.0 ------ From 048d8ef794af29e85d33e105d16870dd82b7e5ed Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 15:22:51 +0200 Subject: [PATCH 118/324] Go back to a release version of PyYAML There's 3.13 now which supports Python 3.7 --- misc/requirements/requirements-qutebrowser.txt-raw | 4 +--- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/misc/requirements/requirements-qutebrowser.txt-raw b/misc/requirements/requirements-qutebrowser.txt-raw index 506af17c0..c66c65beb 100644 --- a/misc/requirements/requirements-qutebrowser.txt-raw +++ b/misc/requirements/requirements-qutebrowser.txt-raw @@ -1,9 +1,7 @@ Jinja2 Pygments pyPEG2 -PyYAML!=4.1 +PyYAML colorama cssutils attrs - -#@ filter: PyYAML != 4.1 diff --git a/requirements.txt b/requirements.txt index fe8da411c..b5328b5da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ Jinja2==2.10 MarkupSafe==1.0 Pygments==2.2.0 pyPEG2==2.15.2 -PyYAML==4.2b4 # rq.filter: != 4.1 +PyYAML==3.13 From 689f87d596ad56346167a48e0054be65b3f32a25 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 15:25:13 +0200 Subject: [PATCH 119/324] travis: Try to install a font for PyQt 5.10 For some reason, since a while this fails with a font related assertion error... --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 81a5d6fbb..d2ec181b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ matrix: env: TESTENV=py36-pyqt59 - os: linux env: TESTENV=py36-pyqt510 + addons: + apt: + packages: + - ttf-dejavu-core - os: linux env: TESTENV=py36-pyqt511-cov # https://github.com/travis-ci/travis-ci/issues/9069 From b3adbec23edf5051659d074bdd0385500233c655 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 15:55:53 +0200 Subject: [PATCH 120/324] Revert "travis: Try to install a font for PyQt 5.10" This reverts commit 689f87d596ad56346167a48e0054be65b3f32a25. Doesn't seem to help... --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2ec181b3..81a5d6fbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,6 @@ matrix: env: TESTENV=py36-pyqt59 - os: linux env: TESTENV=py36-pyqt510 - addons: - apt: - packages: - - ttf-dejavu-core - os: linux env: TESTENV=py36-pyqt511-cov # https://github.com/travis-ci/travis-ci/issues/9069 From 727b418d8b25d2af832ca43fe243f5f1b24bac01 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 16:01:25 +0200 Subject: [PATCH 121/324] Allow PyQt 5.10 to fail on Travis See #4055 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 81a5d6fbb..91c34b665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,6 +65,10 @@ matrix: env: TESTENV=shellcheck services: docker fast_finish: true + allow_failures: + # https://github.com/qutebrowser/qutebrowser/issues/4055 + - os: linux + env: TESTENV=py36-pyqt510 cache: directories: From 14205ae14f29fd9c1eadeeaf2d2f5bbf9718c573 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 16:07:58 +0200 Subject: [PATCH 122/324] Make link_pyqt work with PyQt 5.11 --- scripts/link_pyqt.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/link_pyqt.py b/scripts/link_pyqt.py index e29a69c3a..ae7eaa622 100644 --- a/scripts/link_pyqt.py +++ b/scripts/link_pyqt.py @@ -136,7 +136,15 @@ def link_pyqt(executable, venv_path): executable: The python executable where the source files are present. venv_path: The path to the virtualenv site-packages. """ - sip_file = get_lib_path(executable, 'sip') + try: + get_lib_path(executable, 'PyQt5.sip') + except Error: + # There is no PyQt5.sip, so we need to copy the toplevel sip. + sip_file = get_lib_path(executable, 'sip') + else: + # There is a PyQt5.sip, it'll get copied with the PyQt5 dir. + sip_file = None + sipconfig_file = get_lib_path(executable, 'sipconfig', required=False) pyqt_dir = os.path.dirname(get_lib_path(executable, 'PyQt5.QtCore')) From 0a882739c8c692f866282dc565287bd2d3ef0b17 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 16:08:32 +0200 Subject: [PATCH 123/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b3212ec61..cf012c5d1 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -35,6 +35,7 @@ Fixed older Qt, which is needed on Ubuntu 16.04. - Worked around a Qt issue which redirects to a `chrome-error://` page when trying to use U2F. +- The `link_pyqt.py` script now works correctly with PyQt 5.11. v1.4.0 ------ From 0b9855598742e09853efff798a4f61cbc86fded5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Jul 2018 14:09:24 +0200 Subject: [PATCH 124/324] NSIS: Uninstall old version before installing Supersedes #4054 --- misc/qutebrowser.nsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/qutebrowser.nsi b/misc/qutebrowser.nsi index 8da9834b3..2c66cfba7 100644 --- a/misc/qutebrowser.nsi +++ b/misc/qutebrowser.nsi @@ -40,6 +40,9 @@ Section "Install" ; Uninstall old versions ExecWait 'MsiExec.exe /quiet /qn /norestart /X{633F41F9-FE9B-42D1-9CC4-718CBD01EE11}' ExecWait 'MsiExec.exe /quiet /qn /norestart /X{9331D947-AC86-4542-A755-A833429C6E69}' + IfFileExists "$INSTDIR\uninst.exe" 0 +2 + ExecWait "$INSTDIR\uninst.exe /S _?=$INSTDIR" + CreateDirectory "$INSTDIR SetOutPath "$INSTDIR" From 4c2d69ccaf9f3abd47fe5b2c80b16ee5ab3ea92e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Jul 2018 14:10:38 +0200 Subject: [PATCH 125/324] Update changelog --- doc/changelog.asciidoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index cf012c5d1..90df1235a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -36,6 +36,9 @@ Fixed - Worked around a Qt issue which redirects to a `chrome-error://` page when trying to use U2F. - The `link_pyqt.py` script now works correctly with PyQt 5.11. +- The Windows installer now uninstalls the old version before installing the + new one, fixing issues with qutebrowser not starting after installing v1.4.0 + over v1.3.3. v1.4.0 ------ From a8e96bc81d34c36436817a84e36c40c510bb07c8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Jul 2018 14:11:42 +0200 Subject: [PATCH 126/324] Update asciidoc path in release checklist --- doc/contributing.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index 47ecfd9ff..fa69bf256 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -715,7 +715,7 @@ qutebrowser release as closed. * Linux: Run `git checkout v1.$x.$y && ./.venv/bin/python3 scripts/dev/build_release.py --upload v1.$x.$y`. -* Windows: Run `git checkout v1.X.Y; py -3.6 scripts\dev\build_release.py --asciidoc C:\Python27\python C:\asciidoc-8.6.9\asciidoc.py --upload v1.X.Y` (replace X/Y by hand). +* Windows: Run `git checkout v1.X.Y; py -3.6 scripts\dev\build_release.py --asciidoc C:\Python27\python %userprofile%\bin\asciidoc-8.6.10\asciidoc.py --upload v1.X.Y` (replace X/Y by hand). * macOS: Run `pyenv shell 3.6.6 && git checkout v1.X.Y && python3 scripts/dev/build_release.py --upload v1.X.Y` (replace X/Y by hand). * On server: - Run `python3 scripts/dev/download_release.py v1.X.Y` (replace X/Y by hand). From 3b9b2bc30ec759c4b978d705a467ef32e32a2bbb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Jul 2018 15:35:58 +0200 Subject: [PATCH 127/324] NSIS: Add missing quote --- misc/qutebrowser.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/qutebrowser.nsi b/misc/qutebrowser.nsi index 2c66cfba7..76f459a78 100644 --- a/misc/qutebrowser.nsi +++ b/misc/qutebrowser.nsi @@ -42,7 +42,7 @@ Section "Install" ExecWait 'MsiExec.exe /quiet /qn /norestart /X{9331D947-AC86-4542-A755-A833429C6E69}' IfFileExists "$INSTDIR\uninst.exe" 0 +2 ExecWait "$INSTDIR\uninst.exe /S _?=$INSTDIR" - CreateDirectory "$INSTDIR + CreateDirectory "$INSTDIR" SetOutPath "$INSTDIR" From 43e58ac865ff862c2008c510fc5f7627e10b4660 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 9 Jul 2018 23:38:47 +0200 Subject: [PATCH 128/324] CVE-2018-10895: Fix CSRF issues with qute://settings/set URL In ffc29ee043ae7336d9b9dcc029a05bf7a3f994e8 (part of v1.0.0), a qute://settings/set URL was added to change settings. Contrary to what I apparently believed at the time, it *is* possible for websites to access `qute://*` URLs (i.e., neither QtWebKit nor QtWebEngine prohibit such requests, other than the usual cross-origin rules). In other words, this means a website can e.g. have an `` tag which loads a `qute://settings/set` URL, which then sets `editor.command` to a bash script. The result of that is arbitrary code execution. Fixes #4060 See #2332 --- qutebrowser/browser/qutescheme.py | 28 ++++++++- qutebrowser/browser/webengine/interceptor.py | 13 +++++ .../browser/webengine/webenginequtescheme.py | 22 ++++++- .../browser/webkit/network/filescheme.py | 4 +- .../browser/webkit/network/networkmanager.py | 14 ++--- .../webkit/network/webkitqutescheme.py | 29 ++++++++-- qutebrowser/html/settings.html | 3 +- tests/end2end/data/misc/qutescheme_csrf.html | 20 +++++++ tests/end2end/features/qutescheme.feature | 57 +++++++++++++++++++ tests/end2end/test_invocations.py | 6 +- .../browser/webkit/network/test_filescheme.py | 6 +- 11 files changed, 181 insertions(+), 21 deletions(-) create mode 100644 tests/end2end/data/misc/qutescheme_csrf.html diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index b3787e5d0..05a708336 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -32,9 +32,17 @@ import textwrap import mimetypes import urllib import collections +import base64 + +try: + import secrets +except ImportError: + # New in Python 3.6 + secrets = None import pkg_resources from PyQt5.QtCore import QUrlQuery, QUrl +from PyQt5.QtNetwork import QNetworkReply import qutebrowser from qutebrowser.config import config, configdata, configexc, configdiff @@ -46,6 +54,7 @@ from qutebrowser.qt import sip pyeval_output = ":pyeval was never called" spawn_output = ":spawn was never called" +csrf_token = None _HANDLERS = {} @@ -449,12 +458,29 @@ def _qute_settings_set(url): @add_handler('settings') def qute_settings(url): """Handler for qute://settings. View/change qute configuration.""" + global csrf_token + if url.path() == '/set': + if url.password() != csrf_token: + message.error("Invalid CSRF token for qute://settings!") + raise QuteSchemeError("Invalid CSRF token!", + QNetworkReply.ContentAccessDenied) return _qute_settings_set(url) + # Requests to qute://settings/set should only be allowed from + # qute://settings. As an additional security precaution, we generate a CSRF + # token to use here. + if secrets: + csrf_token = secrets.token_urlsafe() + else: + # On Python < 3.6, from secrets.py + token = base64.urlsafe_b64encode(os.urandom(32)) + csrf_token = token.rstrip(b'=').decode('ascii') + src = jinja.render('settings.html', title='settings', configdata=configdata, - confget=config.instance.get_str) + confget=config.instance.get_str, + csrf_token=csrf_token) return 'text/html', src diff --git a/qutebrowser/browser/webengine/interceptor.py b/qutebrowser/browser/webengine/interceptor.py index 18386eed8..4ea27adf3 100644 --- a/qutebrowser/browser/webengine/interceptor.py +++ b/qutebrowser/browser/webengine/interceptor.py @@ -19,6 +19,7 @@ """A request interceptor taking care of adblocking and custom headers.""" +from PyQt5.QtCore import QUrl from PyQt5.QtWebEngineCore import (QWebEngineUrlRequestInterceptor, QWebEngineUrlRequestInfo) @@ -69,6 +70,18 @@ class RequestInterceptor(QWebEngineUrlRequestInterceptor): resource_type, navigation_type)) url = info.requestUrl() + firstparty = info.firstPartyUrl() + + if ((url.scheme(), url.host(), url.path()) == + ('qute', 'settings', '/set')): + if (firstparty != QUrl('qute://settings/') or + info.resourceType() != + QWebEngineUrlRequestInfo.ResourceTypeXhr): + log.webview.warning("Blocking malicious request from {} to {}" + .format(firstparty.toDisplayString(), + url.toDisplayString())) + info.block(True) + return # FIXME:qtwebengine only block ads for NavigationTypeOther? if self._host_blocker.is_blocked(url): diff --git a/qutebrowser/browser/webengine/webenginequtescheme.py b/qutebrowser/browser/webengine/webenginequtescheme.py index 2434a8889..3eb7c7df1 100644 --- a/qutebrowser/browser/webengine/webenginequtescheme.py +++ b/qutebrowser/browser/webengine/webenginequtescheme.py @@ -55,8 +55,28 @@ class QuteSchemeHandler(QWebEngineUrlSchemeHandler): job.fail(QWebEngineUrlRequestJob.UrlInvalid) return - assert job.requestMethod() == b'GET' + # Only the browser itself or qute:// pages should access any of those + # URLs. + # The request interceptor further locks down qute://settings/set. + try: + initiator = job.initiator() + except AttributeError: + # Added in Qt 5.11 + pass + else: + if initiator.isValid() and initiator.scheme() != 'qute': + log.misc.warning("Blocking malicious request from {} to {}" + .format(initiator.toDisplayString(), + url.toDisplayString())) + job.fail(QWebEngineUrlRequestJob.RequestDenied) + return + + if job.requestMethod() != b'GET': + job.fail(QWebEngineUrlRequestJob.RequestDenied) + return + assert url.scheme() == 'qute' + log.misc.debug("Got request for {}".format(url.toDisplayString())) try: mimetype, data = qutescheme.data_for_url(url) diff --git a/qutebrowser/browser/webkit/network/filescheme.py b/qutebrowser/browser/webkit/network/filescheme.py index 840ed6a4a..a29674e25 100644 --- a/qutebrowser/browser/webkit/network/filescheme.py +++ b/qutebrowser/browser/webkit/network/filescheme.py @@ -111,11 +111,13 @@ def dirbrowser_html(path): return html.encode('UTF-8', errors='xmlcharrefreplace') -def handler(request): +def handler(request, _operation, _current_url): """Handler for a file:// URL. Args: request: QNetworkRequest to answer to. + _operation: The HTTP operation being done. + _current_url: The page we're on currently. Return: A QNetworkReply for directories, None for files. diff --git a/qutebrowser/browser/webkit/network/networkmanager.py b/qutebrowser/browser/webkit/network/networkmanager.py index ad58cc984..0406f8bdf 100644 --- a/qutebrowser/browser/webkit/network/networkmanager.py +++ b/qutebrowser/browser/webkit/network/networkmanager.py @@ -373,13 +373,6 @@ class NetworkManager(QNetworkAccessManager): req, proxy_error, QNetworkReply.UnknownProxyError, self) - scheme = req.url().scheme() - if scheme in self._scheme_handlers: - result = self._scheme_handlers[scheme](req) - if result is not None: - result.setParent(self) - return result - for header, value in shared.custom_headers(url=req.url()): req.setRawHeader(header, value) @@ -416,5 +409,12 @@ class NetworkManager(QNetworkAccessManager): req.url().toDisplayString(), current_url.toDisplayString())) + scheme = req.url().scheme() + if scheme in self._scheme_handlers: + result = self._scheme_handlers[scheme](req, op, current_url) + if result is not None: + result.setParent(self) + return result + self.set_referer(req, current_url) return super().createRequest(op, req, outgoing_data) diff --git a/qutebrowser/browser/webkit/network/webkitqutescheme.py b/qutebrowser/browser/webkit/network/webkitqutescheme.py index d732b6ab0..b6f99437a 100644 --- a/qutebrowser/browser/webkit/network/webkitqutescheme.py +++ b/qutebrowser/browser/webkit/network/webkitqutescheme.py @@ -21,27 +21,46 @@ import mimetypes -from PyQt5.QtNetwork import QNetworkReply +from PyQt5.QtCore import QUrl +from PyQt5.QtNetwork import QNetworkReply, QNetworkAccessManager from qutebrowser.browser import pdfjs, qutescheme from qutebrowser.browser.webkit.network import networkreply from qutebrowser.utils import log, usertypes, qtutils -def handler(request): +def handler(request, operation, current_url): """Scheme handler for qute:// URLs. Args: request: QNetworkRequest to answer to. + operation: The HTTP operation being done. + current_url: The page we're on currently. Return: A QNetworkReply. """ + if operation != QNetworkAccessManager.GetOperation: + return networkreply.ErrorNetworkReply( + request, "Unsupported request type", + QNetworkReply.ContentOperationNotPermittedError) + + url = request.url() + + if ((url.scheme(), url.host(), url.path()) == + ('qute', 'settings', '/set')): + if current_url != QUrl('qute://settings/'): + log.webview.warning("Blocking malicious request from {} to {}" + .format(current_url.toDisplayString(), + url.toDisplayString())) + return networkreply.ErrorNetworkReply( + request, "Invalid qute://settings request", + QNetworkReply.ContentAccessDenied) + try: - mimetype, data = qutescheme.data_for_url(request.url()) + mimetype, data = qutescheme.data_for_url(url) except qutescheme.NoHandlerFound: - errorstr = "No handler found for {}!".format( - request.url().toDisplayString()) + errorstr = "No handler found for {}!".format(url.toDisplayString()) return networkreply.ErrorNetworkReply( request, errorstr, QNetworkReply.ContentNotFoundError) except qutescheme.QuteSchemeOSError as e: diff --git a/qutebrowser/html/settings.html b/qutebrowser/html/settings.html index 62b424a59..d4ff4ce34 100644 --- a/qutebrowser/html/settings.html +++ b/qutebrowser/html/settings.html @@ -3,7 +3,8 @@ {% block script %} var cset = function(option, value) { // FIXME:conf we might want some error handling here? - var url = "qute://settings/set?option=" + encodeURIComponent(option); + var url = "qute://user:{{csrf_token}}@settings/set" + url += "?option=" + encodeURIComponent(option); url += "&value=" + encodeURIComponent(value); var xhr = new XMLHttpRequest(); xhr.open("GET", url); diff --git a/tests/end2end/data/misc/qutescheme_csrf.html b/tests/end2end/data/misc/qutescheme_csrf.html new file mode 100644 index 000000000..66c8fe240 --- /dev/null +++ b/tests/end2end/data/misc/qutescheme_csrf.html @@ -0,0 +1,20 @@ + + + + + CSRF issues with qute://settings + + + +

+ + Via link + Via redirect + + diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index 1abaadd87..74b11b344 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -130,6 +130,63 @@ Feature: Special qute:// pages And I press the key "" Then "Invalid value 'foo' *" should be logged + @qtwebkit_skip + Scenario: qute://settings CSRF via img (webengine) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-img + Then "Blocking malicious request from http://localhost:*/data/misc/qutescheme_csrf.html to qute://settings/set?*" should be logged + + @qtwebkit_skip + Scenario: qute://settings CSRF via link (webengine) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-link + Then "Blocking malicious request from qute://settings/set?* to qute://settings/set?*" should be logged + + @qtwebkit_skip + Scenario: qute://settings CSRF via redirect (webengine) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-redirect + Then "Blocking malicious request from qute://settings/set?* to qute://settings/set?*" should be logged + + @qtwebkit_skip + Scenario: qute://settings CSRF via form (webengine) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-form + Then "Blocking malicious request from qute://settings/set?* to qute://settings/set?*" should be logged + + @qtwebkit_skip + Scenario: qute://settings CSRF token (webengine) + When I open qute://settings + And I run :jseval const xhr = new XMLHttpRequest(); xhr.open("GET", "qute://settings/set"); xhr.send() + Then "Error while handling qute://* URL" should be logged + And the error "Invalid CSRF token for qute://settings!" should be shown + + @qtwebengine_skip + Scenario: qute://settings CSRF via img (webkit) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-img + Then "Blocking malicious request from http://localhost:*/data/misc/qutescheme_csrf.html to qute://settings/set?*" should be logged + + @qtwebengine_skip + Scenario: qute://settings CSRF via link (webkit) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-link + Then "Blocking malicious request from http://localhost:*/data/misc/qutescheme_csrf.html to qute://settings/set?*" should be logged + And "Error while loading qute://settings/set?*: Invalid qute://settings request" should be logged + + @qtwebengine_skip + Scenario: qute://settings CSRF via redirect (webkit) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-redirect + Then "Blocking malicious request from http://localhost:*/data/misc/qutescheme_csrf.html to qute://settings/set?*" should be logged + And "Error while loading qute://settings/set?*: Invalid qute://settings request" should be logged + + @qtwebengine_skip + Scenario: qute://settings CSRF via form (webkit) + When I open data/misc/qutescheme_csrf.html + And I run :click-element id via-form + Then "Error while loading qute://settings/set?*: Unsupported request type" should be logged + # pdfjs support @qtwebengine_skip: pdfjs is not implemented yet diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index fbab681a4..5a2e15048 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -368,8 +368,10 @@ def test_qute_settings_persistence(short_tmpdir, request, quteproc_new): """Make sure settings from qute://settings are persistent.""" args = _base_args(request.config) + ['--basedir', str(short_tmpdir)] quteproc_new.start(args) - quteproc_new.open_path( - 'qute://settings/set?option=search.ignore_case&value=always') + quteproc_new.open_path('qute://settings/') + quteproc_new.send_cmd(':jseval --world main ' + 'cset("search.ignore_case", "always")') + assert quteproc_new.get_setting('search.ignore_case') == 'always' quteproc_new.send_cmd(':quit') diff --git a/tests/unit/browser/webkit/network/test_filescheme.py b/tests/unit/browser/webkit/network/test_filescheme.py index 5bdbb47cc..2654097ea 100644 --- a/tests/unit/browser/webkit/network/test_filescheme.py +++ b/tests/unit/browser/webkit/network/test_filescheme.py @@ -248,7 +248,7 @@ class TestFileSchemeHandler: def test_dir(self, tmpdir): url = QUrl.fromLocalFile(str(tmpdir)) req = QNetworkRequest(url) - reply = filescheme.handler(req) + reply = filescheme.handler(req, None, None) # The URL will always use /, even on Windows - so we force this here # too. tmpdir_path = str(tmpdir).replace(os.sep, '/') @@ -259,7 +259,7 @@ class TestFileSchemeHandler: filename.ensure() url = QUrl.fromLocalFile(str(filename)) req = QNetworkRequest(url) - reply = filescheme.handler(req) + reply = filescheme.handler(req, None, None) assert reply is None def test_unicode_encode_error(self, mocker): @@ -269,5 +269,5 @@ class TestFileSchemeHandler: err = UnicodeEncodeError('ascii', '', 0, 2, 'foo') mocker.patch('os.path.isdir', side_effect=err) - reply = filescheme.handler(req) + reply = filescheme.handler(req, None, None) assert reply is None From ae0df2093b3799e9ea2647eddf95b759be6bacce Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Jul 2018 17:15:32 +0200 Subject: [PATCH 129/324] Update changelog for v1.4.1 --- doc/changelog.asciidoc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 90df1235a..53dd96401 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -23,8 +23,15 @@ Added - The qute-pass userscript now has optional OTP support. -v1.4.1 (unreleased) -------------------- +v1.4.1 +------ + +Security +~~~~~~~~ + +- CVE-2018-10895: Fix CSRF issue on the qute://settings page, leading to + possible arbitrary code execution. See the related GitHub issue for details: + https://github.com/qutebrowser/qutebrowser/issues/4060 Fixed ~~~~~ From d1a25b6c3fc247259f5a2b14bfaca7d21e2118f9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Jul 2018 17:16:50 +0200 Subject: [PATCH 130/324] Release v1.4.1 --- qutebrowser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/__init__.py b/qutebrowser/__init__.py index 9061290ae..fab8a5fae 100644 --- a/qutebrowser/__init__.py +++ b/qutebrowser/__init__.py @@ -26,7 +26,7 @@ __copyright__ = "Copyright 2014-2018 Florian Bruhin (The Compiler)" __license__ = "GPL" __maintainer__ = __author__ __email__ = "mail@qutebrowser.org" -__version_info__ = (1, 4, 0) +__version_info__ = (1, 4, 1) __version__ = '.'.join(str(e) for e in __version_info__) __description__ = "A keyboard-driven, vim-like browser based on PyQt5." From b1a060fb717865c338af5b4f5063bfb31e8ef74f Mon Sep 17 00:00:00 2001 From: Hendrik R Date: Sun, 15 Jul 2018 14:31:03 +0200 Subject: [PATCH 131/324] Process all events before issuing an alert Fixes #2603 The call to processEvents fixes an apparent race condition with some window managers, e.g. i3. QT seems to be thinking, that the window is not marked as urgent and toggles it twice, so synchronizing before issuing the alert makes QT behave correctly. This change should not change the behaviour on other systems only correct the fault reported in #2603. --- qutebrowser/mainwindow/mainwindow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 4cfee7eff..b95de54fc 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -24,7 +24,8 @@ import base64 import itertools import functools -from PyQt5.QtCore import pyqtSlot, QRect, QPoint, QTimer, Qt +from PyQt5.QtCore import (pyqtSlot, QRect, QPoint, QTimer, Qt, + QCoreApplication, QEventLoop) from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication, QSizePolicy from qutebrowser.commands import runners, cmdutils @@ -98,6 +99,8 @@ def raise_window(window, alert=True): window.setWindowState(window.windowState() & ~Qt.WindowMinimized) window.setWindowState(window.windowState() | Qt.WindowActive) window.raise_() + QCoreApplication.processEvents( + QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers) window.activateWindow() if alert: From 9298f3d055d6cfa73fba9f326ca7d80520276899 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 08:16:18 +0200 Subject: [PATCH 132/324] Refactor print handling and fix window.print On Qt 5.7.1, window.print() caused a CommandError which wasn't handled as the command was called from accept_navigation_request. Instead, we now show the dialog in AbstractPrinting and use that directly. --- qutebrowser/browser/browsertab.py | 29 ++++++++++++- qutebrowser/browser/commands.py | 42 ++++--------------- qutebrowser/browser/webengine/webenginetab.py | 10 ++--- qutebrowser/browser/webkit/webkittab.py | 2 +- 4 files changed, 40 insertions(+), 43 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 0170b4627..9a2d13242 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -25,7 +25,8 @@ import itertools import attr from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, QObject, QSizeF, Qt from PyQt5.QtGui import QIcon -from PyQt5.QtWidgets import QWidget, QApplication +from PyQt5.QtWidgets import QWidget, QApplication, QDialog +from PyQt5.QtPrintSupport import QPrintDialog import pygments import pygments.lexers @@ -187,8 +188,9 @@ class AbstractPrinting: """Attribute of AbstractTab for printing the page.""" - def __init__(self): + def __init__(self, tab): self._widget = None + self._tab = tab def check_pdf_support(self): raise NotImplementedError @@ -212,6 +214,29 @@ class AbstractPrinting: """ raise NotImplementedError + def show_dialog(self): + """Print with a QPrintDialog.""" + self.check_printer_support() + + def print_callback(ok): + """Called when printing finished.""" + if not ok: + message.error("Printing failed!") + diag.deleteLater() + + def do_print(): + """Called when the dialog was closed.""" + self.to_printer(diag.printer(), print_callback) + + diag = QPrintDialog(self._tab) + if utils.is_mac: + # For some reason we get a segfault when using open() on macOS + ret = diag.exec_() + if ret == QDialog.Accepted: + do_print() + else: + diag.open(do_print) + class AbstractSearch(QObject): diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 0fddcd1e7..6578e4bb7 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -25,9 +25,9 @@ import shlex import functools import typing -from PyQt5.QtWidgets import QApplication, QTabBar, QDialog +from PyQt5.QtWidgets import QApplication, QTabBar from PyQt5.QtCore import pyqtSlot, Qt, QUrl, QEvent, QUrlQuery -from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog +from PyQt5.QtPrintSupport import QPrintPreviewDialog from qutebrowser.commands import userscripts, cmdexc, cmdutils, runners from qutebrowser.config import config, configdata @@ -415,27 +415,6 @@ class CommandDispatcher: tab.printing.to_pdf(filename) log.misc.debug("Print to file: {}".format(filename)) - def _print(self, tab): - """Print with a QPrintDialog.""" - def print_callback(ok): - """Called when printing finished.""" - if not ok: - message.error("Printing failed!") - diag.deleteLater() - - def do_print(): - """Called when the dialog was closed.""" - tab.printing.to_printer(diag.printer(), print_callback) - - diag = QPrintDialog(tab) - if utils.is_mac: - # For some reason we get a segfault when using open() on macOS - ret = diag.exec_() - if ret == QDialog.Accepted: - do_print() - else: - diag.open(do_print) - @cmdutils.register(instance='command-dispatcher', name='print', scope='window') @cmdutils.argument('count', count=True) @@ -453,22 +432,15 @@ class CommandDispatcher: return try: - if pdf: - tab.printing.check_pdf_support() - else: - tab.printing.check_printer_support() if preview: - tab.printing.check_preview_support() + self._print_preview(tab) + elif pdf: + self._print_pdf(tab, pdf) + else: + tab.printing.show_dialog() except browsertab.WebTabError as e: raise cmdexc.CommandError(e) - if preview: - self._print_preview(tab) - elif pdf: - self._print_pdf(tab, pdf) - else: - self._print(tab) - @cmdutils.register(instance='command-dispatcher', scope='window') def tab_clone(self, bg=False, window=False): """Duplicate the current tab. diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 9f840b715..9bc246107 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -976,7 +976,7 @@ class WebEngineTab(browsertab.AbstractTab): tab=self, parent=self) self.zoom = WebEngineZoom(tab=self, parent=self) self.search = WebEngineSearch(parent=self) - self.printing = WebEnginePrinting() + self.printing = WebEnginePrinting(tab=self) self.elements = WebEngineElements(tab=self) self.action = WebEngineAction(tab=self) self.audio = WebEngineAudio(parent=self) @@ -1315,10 +1315,10 @@ class WebEngineTab(browsertab.AbstractTab): super()._on_navigation_request(navigation) if navigation.url == QUrl('qute://print'): - command_dispatcher = objreg.get('command-dispatcher', - scope='window', - window=self.win_id) - command_dispatcher.printpage() + try: + self.printing.show_dialog() + except browsertab.WebTabError as e: + message.error(str(e)) navigation.accepted = False if not navigation.accepted or not navigation.is_main_frame: diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 31cb82f29..7b7ad0c7d 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -658,7 +658,7 @@ class WebKitTab(browsertab.AbstractTab): tab=self, parent=self) self.zoom = WebKitZoom(tab=self, parent=self) self.search = WebKitSearch(parent=self) - self.printing = WebKitPrinting() + self.printing = WebKitPrinting(tab=self) self.elements = WebKitElements(tab=self) self.action = WebKitAction(tab=self) self.audio = WebKitAudio(parent=self) From 570fe3ed1aeda1ff39ff8a5cc78690e1b096c1b8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 08:17:24 +0200 Subject: [PATCH 133/324] Update changelog --- doc/changelog.asciidoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 53dd96401..54d066fed 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -23,6 +23,11 @@ Added - The qute-pass userscript now has optional OTP support. +Fixed +~~~~~ + +- Crash in Qt 5.7.1 when a website uses `window.print()`. + v1.4.1 ------ From b1d508a3afa16c10f8ac9ea1caaf1756a2aaed3b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:15:00 +0200 Subject: [PATCH 134/324] Rewrite pseudo "type:" comments for pylint 2.0 See https://github.com/PyCQA/pylint/issues/2299 --- qutebrowser/browser/webkit/mhtml.py | 2 +- qutebrowser/misc/sql.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/webkit/mhtml.py b/qutebrowser/browser/webkit/mhtml.py index 5f495274a..b59148d43 100644 --- a/qutebrowser/browser/webkit/mhtml.py +++ b/qutebrowser/browser/webkit/mhtml.py @@ -312,7 +312,7 @@ class _Downloader: for style in styles: style = webkitelem.WebKitElement(style, tab=self.tab) # The Mozilla Developer Network says: - # type: This attribute defines the styling language as a MIME type + # type - This attribute defines the styling language as a MIME type # (charset should not be specified). This attribute is optional and # default to text/css if it's missing. # https://developer.mozilla.org/en/docs/Web/HTML/Element/style diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py index 9b09fb132..54c142313 100644 --- a/qutebrowser/misc/sql.py +++ b/qutebrowser/misc/sql.py @@ -74,7 +74,7 @@ class SqliteError(SqlError): '13', # SQLITE_FULL ] # At least in init(), we can get errors like this: - # type: ConnectionError + # type - ConnectionError # database text: out of memory # driver text: Error opening database # error code: -1 From e50b6912a728ea219d85485ca1bb6395c33be9e9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:33:11 +0200 Subject: [PATCH 135/324] Fix pylint 2.0 useless-return cases See https://github.com/PyCQA/pylint/issues/2300 --- qutebrowser/browser/webengine/webenginetab.py | 4 ++-- qutebrowser/misc/miscwidgets.py | 4 ++-- qutebrowser/misc/utilcmds.py | 2 +- tests/end2end/fixtures/test_quteprocess.py | 2 +- tests/helpers/stubs.py | 4 ++-- tests/unit/utils/test_qtutils.py | 2 +- tests/unit/utils/test_utils.py | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 9bc246107..dcde5c434 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1086,10 +1086,10 @@ class WebEngineTab(browsertab.AbstractTab): # percent encoded content is 2 megabytes minus 30 bytes. self._widget.setHtml(html, base_url) - def networkaccessmanager(self): + def networkaccessmanager(self): # pylint: disable=useless-return return None - def user_agent(self): + def user_agent(self): # pylint: disable=useless-return return None def clear_ssl_errors(self): diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index eef127cf2..bc0afea24 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -246,7 +246,7 @@ class WrapperLayout(QLayout): def sizeHint(self): return self._widget.sizeHint() - def itemAt(self, _index): + def itemAt(self, _index): # pylint: disable=useless-return return None def takeAt(self, _index): @@ -287,7 +287,7 @@ class PseudoLayout(QLayout): def count(self): return 0 - def itemAt(self, _pos): + def itemAt(self, _pos): # pylint: disable=useless-return return None def widget(self): diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 66483e09a..702c62cac 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -365,7 +365,7 @@ def window_only(current_win_id): @cmdutils.register() def nop(): """Do nothing.""" - return + pass @cmdutils.register() diff --git a/tests/end2end/fixtures/test_quteprocess.py b/tests/end2end/fixtures/test_quteprocess.py index a0dcaf5ce..9a6f5b19d 100644 --- a/tests/end2end/fixtures/test_quteprocess.py +++ b/tests/end2end/fixtures/test_quteprocess.py @@ -68,7 +68,7 @@ class FakeNode: def __init__(self, call): self.rep_call = call - def get_closest_marker(self, _name): + def get_closest_marker(self, _name): # pylint: disable=useless-return return None diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index 84e5b0125..808061976 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -44,7 +44,7 @@ class FakeNetworkCache(QAbstractNetworkCache): def cacheSize(self): return 0 - def data(self, _url): + def data(self, _url): # pylint: disable=useless-return return None def insert(self, _dev): @@ -53,7 +53,7 @@ class FakeNetworkCache(QAbstractNetworkCache): def metaData(self, _url): return QNetworkCacheMetaData() - def prepare(self, _metadata): + def prepare(self, _metadata): # pylint: disable=useless-return return None def remove(self, _url): diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index 3a848474f..0825d1fb3 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -575,7 +575,7 @@ class FailingQIODevice(QIODevice): self.setErrorString("Writing failed") return -1 - def read(self, _maxsize): + def read(self, _maxsize): # pylint: disable=useless-return """Simulate failed read.""" self.setErrorString("Reading failed") return None diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index ef2b6c8d4..54ea07a69 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -410,11 +410,11 @@ class GotException(Exception): def excepthook(_exc, _val, _tb): - return + pass def excepthook_2(_exc, _val, _tb): - return + pass class TestDisabledExcepthook: From e0f3285f05eca778a93dc83f55f88a20cf9054cc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:41:18 +0200 Subject: [PATCH 136/324] Fix bad-indentation issues for pylint 2.0 See https://github.com/PyCQA/pylint/issues/2301 --- qutebrowser/misc/earlyinit.py | 2 ++ qutebrowser/misc/editor.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 92e3a9731..b29e1508f 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -206,6 +206,7 @@ def _check_modules(modules): # https://bitbucket.org/fdik/pypeg/commits/dd15ca462b532019c0a3be1d39b8ee2f3fa32f4e messages = ['invalid escape sequence', 'Flags not at the start of the expression'] + # pylint: disable=bad-continuation with log.ignore_py_warnings( category=DeprecationWarning, message=r'({})'.format('|'.join(messages)) @@ -216,6 +217,7 @@ def _check_modules(modules): category=ImportWarning, message=r'Not importing directory .*: missing __init__' ): + # pylint: enable=bad-continuation importlib.import_module(name) except ImportError as e: _die(text, e) diff --git a/qutebrowser/misc/editor.py b/qutebrowser/misc/editor.py index 473f67c3e..038331c9b 100644 --- a/qutebrowser/misc/editor.py +++ b/qutebrowser/misc/editor.py @@ -140,11 +140,9 @@ class ExternalEditor(QObject): # the file from the external editor, see # https://github.com/qutebrowser/qutebrowser/issues/1767 with tempfile.NamedTemporaryFile( - # pylint: disable=bad-continuation mode='w', prefix=prefix, encoding=config.val.editor.encoding, delete=False) as fobj: - # pylint: enable=bad-continuation if text: fobj.write(text) return fobj.name From e4a772c61ca84619501cf0740ef70788008cf134 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:44:07 +0200 Subject: [PATCH 137/324] Fix try-except-raise for pylint 2.0 See https://github.com/PyCQA/pylint/issues/2302 --- qutebrowser/browser/qutescheme.py | 2 -- qutebrowser/config/configfiles.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 05a708336..ee33d7897 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -187,8 +187,6 @@ def data_for_url(url): except OSError as e: # FIXME:qtwebengine how to handle this? raise QuteSchemeOSError(e) - except QuteSchemeError: - raise assert mimetype is not None, url if mimetype == 'text/html' and isinstance(data, str): diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index a2c88d311..d0830dd72 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -576,7 +576,7 @@ def read_autoconfig(): """Read the autoconfig.yml file.""" try: config.instance.read_yaml() - except configexc.ConfigFileErrors: + except configexc.ConfigFileErrors: # pylint: disable=try-except-raise raise # caught in outer block except configexc.Error as e: desc = configexc.ConfigErrorDesc("Error", e) From 2d65f25a04c732ec0653cf53096320a74541c92e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:44:31 +0200 Subject: [PATCH 138/324] Remove unnecessary object inheritance --- qutebrowser/browser/greasemonkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/greasemonkey.py b/qutebrowser/browser/greasemonkey.py index cff45f3ac..7e5ff7f5b 100644 --- a/qutebrowser/browser/greasemonkey.py +++ b/qutebrowser/browser/greasemonkey.py @@ -145,7 +145,7 @@ class GreasemonkeyScript: @attr.s -class MatchingScripts(object): +class MatchingScripts: """All userscripts registered to run on a particular url.""" From 8e6aa9e3e14438f7123d17882c96d771e56fe729 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:53:30 +0200 Subject: [PATCH 139/324] Locally disable assignment-from-no-return for pylint 2.0 --- tests/unit/utils/test_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index 54ea07a69..550213386 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -462,7 +462,9 @@ class TestPreventExceptions: def test_raising(self, caplog): """Test with a raising function.""" with caplog.at_level(logging.ERROR, 'misc'): + # pylint: disable=assignment-from-no-return ret = self.func_raising() + # pylint: enable=assignment-from-no-return assert ret == 42 assert len(caplog.records) == 1 expected = 'Error in test_utils.TestPreventExceptions.func_raising' @@ -487,7 +489,9 @@ class TestPreventExceptions: def test_predicate_true(self, caplog): """Test with a True predicate.""" with caplog.at_level(logging.ERROR, 'misc'): + # pylint: disable=assignment-from-no-return ret = self.func_predicate_true() + # enable: disable=assignment-from-no-return assert ret == 42 assert len(caplog.records) == 1 From 03ac3b4d7db0795abe1c2f851e3e7c9f865d98ab Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 15:09:06 +0200 Subject: [PATCH 140/324] Update to pylint 2.0 --- misc/requirements/requirements-pylint.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 018d5a427..02af7a5f0 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -astroid==1.6.5 +astroid==2.0 certifi==2018.4.16 chardet==3.0.4 github3.py==1.1.0 @@ -8,11 +8,12 @@ idna==2.7 isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 -pylint==1.9.2 +pylint==2.0.0 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.19.1 six==1.11.0 +typed-ast==1.1.0 uritemplate==3.0.0 -urllib3==1.22 +urllib3==1.23 wrapt==1.10.11 From b8c70e5986d82da758651c166a725f112383afeb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 22:35:40 +0200 Subject: [PATCH 141/324] Rewrite type comments again --- qutebrowser/browser/webkit/mhtml.py | 6 +++--- qutebrowser/misc/sql.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qutebrowser/browser/webkit/mhtml.py b/qutebrowser/browser/webkit/mhtml.py index b59148d43..9339df9ce 100644 --- a/qutebrowser/browser/webkit/mhtml.py +++ b/qutebrowser/browser/webkit/mhtml.py @@ -312,9 +312,9 @@ class _Downloader: for style in styles: style = webkitelem.WebKitElement(style, tab=self.tab) # The Mozilla Developer Network says: - # type - This attribute defines the styling language as a MIME type - # (charset should not be specified). This attribute is optional and - # default to text/css if it's missing. + # > type: This attribute defines the styling language as a MIME + # > type (charset should not be specified). This attribute is + # > optional and default to text/css if it's missing. # https://developer.mozilla.org/en/docs/Web/HTML/Element/style if 'type' in style and style['type'] != 'text/css': continue diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py index 54c142313..bf47bea5a 100644 --- a/qutebrowser/misc/sql.py +++ b/qutebrowser/misc/sql.py @@ -74,10 +74,10 @@ class SqliteError(SqlError): '13', # SQLITE_FULL ] # At least in init(), we can get errors like this: - # type - ConnectionError - # database text: out of memory - # driver text: Error opening database - # error code: -1 + # > type: ConnectionError + # > database text: out of memory + # > driver text: Error opening database + # > error code: -1 environmental_strings = [ "out of memory", ] From a72eee8e39b6d982d936cad999d9f50cd20dc5ce Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 17 Jul 2018 12:01:17 +0200 Subject: [PATCH 142/324] Enable XSS auditing by default Qt disables this by default, but Chromium does have it enabled. I also submitted a change to Qt to hopefully enable it by default there starting with Qt 5.12: https://codereview.qt-project.org/#/c/198354/15 This also removes the claim of having a (big) performance impact, as Chromium's XSS design doc says the opposite: https://www.chromium.org/developers/design-documents/xss-auditor --- doc/changelog.asciidoc | 6 ++++++ doc/help/settings.asciidoc | 4 ++-- qutebrowser/config/configdata.yml | 5 ++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 54d066fed..d4c30689a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -23,6 +23,12 @@ Added - The qute-pass userscript now has optional OTP support. +Changed +~~~~~~~ + +- The `content.xss_auditing` setting is now enabled by default, to mirror + Chromium's rather than Qt's default behavior. + Fixed ~~~~~ diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 75e684ffc..dbb03ef0d 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -2061,13 +2061,13 @@ Default: +pass:[false]+ [[content.xss_auditing]] === content.xss_auditing Monitor load requests for cross-site scripting attempts. -Suspicious scripts will be blocked and reported in the inspector's JavaScript console. Enabling this feature might have an impact on performance. +Suspicious scripts will be blocked and reported in the inspector's JavaScript console. This setting supports URL patterns. Type: <> -Default: +pass:[false]+ +Default: +pass:[true]+ [[downloads.location.directory]] === downloads.location.directory diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 2698c34b1..e57459f64 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -729,14 +729,13 @@ content.webrtc_public_interfaces_only: content.xss_auditing: type: Bool - default: false + default: true supports_pattern: true desc: >- Monitor load requests for cross-site scripting attempts. Suspicious scripts will be blocked and reported in the inspector's - JavaScript console. Enabling this feature might have an impact on - performance. + JavaScript console. # emacs: ' From 1d9ee2c11d9f0aaf93b9490e1de839f32b4e2d11 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 18 Jul 2018 09:58:49 +0200 Subject: [PATCH 143/324] Recompile requirements files --- misc/requirements/requirements-codecov.txt | 2 +- misc/requirements/requirements-flake8.txt | 2 +- misc/requirements/requirements-pylint-master.txt | 3 ++- misc/requirements/requirements-pylint-master.txt-raw | 2 +- misc/requirements/requirements-pyqt.txt | 2 +- misc/requirements/requirements-tests.txt | 6 ++++-- misc/requirements/requirements-tox.txt | 4 +++- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/misc/requirements/requirements-codecov.txt b/misc/requirements/requirements-codecov.txt index 6920af52c..9fed7b300 100644 --- a/misc/requirements/requirements-codecov.txt +++ b/misc/requirements/requirements-codecov.txt @@ -6,4 +6,4 @@ codecov==2.0.15 coverage==4.5.1 idna==2.7 requests==2.19.1 -urllib3==1.22 +urllib3==1.23 diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index 879f24cd0..b4f004522 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -9,7 +9,7 @@ flake8-copyright==0.2.0 flake8-debugger==3.1.0 flake8-deprecated==1.3 flake8-docstrings==1.3.0 -flake8-future-import==0.4.4 +flake8-future-import==0.4.5 flake8-mock==0.3 flake8-per-file-ignores==0.6 flake8-polyfill==1.0.2 diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index e31217497..2df073620 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -13,6 +13,7 @@ python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.19.1 six==1.11.0 +typed-ast==1.1.0 uritemplate==3.0.0 -urllib3==1.22 +urllib3==1.23 wrapt==1.10.11 diff --git a/misc/requirements/requirements-pylint-master.txt-raw b/misc/requirements/requirements-pylint-master.txt-raw index a963803d3..405b0ab8f 100644 --- a/misc/requirements/requirements-pylint-master.txt-raw +++ b/misc/requirements/requirements-pylint-master.txt-raw @@ -8,4 +8,4 @@ github3.py #@ replace: @.*# # # fix qute-pylint location -#@ replace: qute-pylint==.* ./scripts/dev/pylint_checkers \ No newline at end of file +#@ replace: qute-pylint==.* ./scripts/dev/pylint_checkers diff --git a/misc/requirements/requirements-pyqt.txt b/misc/requirements/requirements-pyqt.txt index 063f85122..2878a55f8 100644 --- a/misc/requirements/requirements-pyqt.txt +++ b/misc/requirements/requirements-pyqt.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py PyQt5==5.11.2 -PyQt5-sip==4.19.11 +PyQt5-sip==4.19.12 diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 5e66fef82..c6fa6cb4e 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -1,8 +1,10 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +atomicwrites==1.1.5 attrs==18.1.0 +backports.functools-lru-cache==1.5 beautifulsoup4==4.6.0 -cheroot==6.3.2.post0 +cheroot==6.3.3 click==6.7 # colorama==0.3.9 coverage==4.5.1 @@ -29,7 +31,7 @@ pytest-cov==2.5.1 pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 -pytest-qt==2.4.1 +pytest-qt==3.0.0 pytest-repeat==0.4.1 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index b40750369..e8c660eab 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -1,7 +1,9 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +packaging==17.1 pluggy==0.6.0 py==1.5.4 +pyparsing==2.2.0 six==1.11.0 -tox==3.1.1 +tox==3.1.2 virtualenv==16.0.0 From 9ea6f4acf4e4212684a896167f3c629c21db699c Mon Sep 17 00:00:00 2001 From: cryzed Date: Wed, 18 Jul 2018 16:18:56 +0200 Subject: [PATCH 144/324] Follow symlinks when finding pass candidates --- misc/userscripts/qute-pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass index 2d6198d92..4f79e1115 100755 --- a/misc/userscripts/qute-pass +++ b/misc/userscripts/qute-pass @@ -96,7 +96,7 @@ def qute_command(command): def find_pass_candidates(domain, password_store_path): candidates = [] - for path, directories, file_names in os.walk(password_store_path): + for path, directories, file_names in os.walk(password_store_path, followlinks=True): if directories or domain not in path.split(os.path.sep): continue From 8a748741ba3fa3214a1e4c7f3c250ff275392102 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Jul 2018 00:28:12 +0200 Subject: [PATCH 145/324] Fix checks for Nouveau workaround --- qutebrowser/config/configinit.py | 2 ++ qutebrowser/misc/backendproblem.py | 11 ++++++++++- tests/unit/config/test_configinit.py | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qutebrowser/config/configinit.py b/qutebrowser/config/configinit.py index c4418a17c..99a3ff91c 100644 --- a/qutebrowser/config/configinit.py +++ b/qutebrowser/config/configinit.py @@ -89,6 +89,8 @@ def _init_envvars(): os.environ['QT_XCB_FORCE_SOFTWARE_OPENGL'] = '1' elif software_rendering == 'qt-quick': os.environ['QT_QUICK_BACKEND'] = 'software' + elif software_rendering == 'chromium': + os.environ['QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND'] = '1' if config.val.qt.force_platform is not None: os.environ['QT_QPA_PLATFORM'] = config.val.qt.force_platform diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index b2d6f71bb..363f7f23c 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -172,6 +172,11 @@ def _nvidia_shader_workaround(): def _handle_nouveau_graphics(): + """Force software rendering when using the Nouveau driver. + + WORKAROUND for https://bugreports.qt.io/browse/QTBUG-41242 + Should be fixed in Qt 5.10 via https://codereview.qt-project.org/#/c/208664/ + """ assert objects.backend == usertypes.Backend.QtWebEngine, objects.backend if os.environ.get('QUTE_SKIP_NOUVEAU_CHECK'): @@ -181,7 +186,11 @@ def _handle_nouveau_graphics(): return if (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or - 'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ): + # qt.force_software_rendering = 'software-opengl' + 'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ or + # qt.force_software_rendering = 'chromium', also see: + # https://build.opensuse.org/package/view_file/openSUSE:Factory/libqt5-qtwebengine/disable-gpu-when-using-nouveau-boo-1005323.diff?expand=1 + 'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND' in os.environ): return button = _Button("Force software rendering", 'qt.force_software_rendering', diff --git a/tests/unit/config/test_configinit.py b/tests/unit/config/test_configinit.py index cb32d3761..56f2a3c90 100644 --- a/tests/unit/config/test_configinit.py +++ b/tests/unit/config/test_configinit.py @@ -293,6 +293,8 @@ class TestEarlyInit: 'QT_XCB_FORCE_SOFTWARE_OPENGL', '1'), ('qt.force_software_rendering', 'qt-quick', 'QT_QUICK_BACKEND', 'software'), + ('qt.force_software_rendering', 'chromium', + 'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND', '1'), ('qt.force_platform', 'toaster', 'QT_QPA_PLATFORM', 'toaster'), ('qt.highdpi', True, 'QT_AUTO_SCREEN_SCALE_FACTOR', '1'), ('window.hide_decoration', True, From a8e2a046482de004c0f43611d8bf52d4d60bc0c8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Jul 2018 00:28:51 +0200 Subject: [PATCH 146/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index d4c30689a..9bc787f99 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -33,6 +33,7 @@ Fixed ~~~~~ - Crash in Qt 5.7.1 when a website uses `window.print()`. +- The workaround for Nouveau graphic drivers now works properly again. v1.4.1 ------ From 7d695d40b9adab8ebc31dca2ec151e19b522e473 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Jul 2018 00:30:12 +0200 Subject: [PATCH 147/324] Add a QUTE_FAKE_OPENGL_VENDOR envvar --- qutebrowser/utils/version.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index a2d949635..6ec4e133d 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -433,6 +433,11 @@ def opengl_vendor(): # pragma: no cover """ assert QApplication.instance() + override = os.environ.get('QUTE_FAKE_OPENGL_VENDOR') + if override is not None: + log.init.debug("Using override {}".format(override)) + return override + old_context = QOpenGLContext.currentContext() old_surface = None if old_context is None else old_context.surface() From 3b6c4d4b85afbf8ff605a35f9127aeacedcdd7c4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Jul 2018 00:31:40 +0200 Subject: [PATCH 148/324] Remove unneeded log prefix We see the function anyways --- qutebrowser/utils/version.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 6ec4e133d..3b72ee71f 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -447,12 +447,12 @@ def opengl_vendor(): # pragma: no cover ctx = QOpenGLContext() ok = ctx.create() if not ok: - log.init.debug("opengl_vendor: Creating context failed!") + log.init.debug("Creating context failed!") return None ok = ctx.makeCurrent(surface) if not ok: - log.init.debug("opengl_vendor: Making context current failed!") + log.init.debug("Making context current failed!") return None try: @@ -466,12 +466,11 @@ def opengl_vendor(): # pragma: no cover try: vf = ctx.versionFunctions(vp) except ImportError as e: - log.init.debug("opengl_vendor: Importing version functions " - "failed: {}".format(e)) + log.init.debug("Importing version functions failed: {}".format(e)) return None if vf is None: - log.init.debug("opengl_vendor: Getting version functions failed!") + log.init.debug("Getting version functions failed!") return None return vf.glGetString(vf.GL_VENDOR) From 2b8068f6dafe9d5479381fda02a17647f197b1a9 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 21 Jul 2018 12:50:45 -0700 Subject: [PATCH 149/324] Move audible strings into class variables --- qutebrowser/mainwindow/tabwidget.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index ac81eba29..02934a532 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -54,6 +54,10 @@ class TabWidget(QTabWidget): tab_index_changed = pyqtSignal(int, int) new_tab_requested = pyqtSignal('QUrl', bool, bool) + # Strings for controlling the mute/audible text + MUTE_STRING = '[M] ' + AUDIBLE_STRING = '[A] ' + def __init__(self, win_id, parent=None): super().__init__(parent) bar = TabBar(win_id, self) @@ -175,9 +179,9 @@ class TabWidget(QTabWidget): fields['private'] = ' [Private Mode] ' if tab.private else '' try: if tab.audio.is_muted(): - fields['audio'] = '[M] ' + fields['audio'] = TabWidget.MUTE_STRING elif tab.audio.is_recently_audible(): - fields['audio'] = '[A] ' + fields['audio'] = TabWidget.AUDIBLE_STRING else: fields['audio'] = '' except browsertab.WebTabError: From 31d318ee0a3b9328e20cffcc8d410928fb40e3ac Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 21 Jul 2018 13:58:41 -0700 Subject: [PATCH 150/324] Add catch and error handling for errors in follow_selected click --- qutebrowser/browser/webengine/webenginetab.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index dcde5c434..2ccb7d950 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -33,7 +33,7 @@ from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript from qutebrowser.config import configdata, config -from qutebrowser.browser import browsertab, mouse, shared +from qutebrowser.browser import browsertab, mouse, shared, webelem from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory, interceptor, webenginequtescheme, cookies, webenginedownloads, @@ -360,7 +360,11 @@ class WebEngineCaret(browsertab.AbstractCaret): if elem.is_link(): log.webview.debug("Found link in selection, clicking. ClickTarget " "{}, elem {}".format(click_type, elem)) - elem.click(click_type) + try: + elem.click(click_type) + except webelem.Error as e: + message.error(str(e)) + return def follow_selected(self, *, tab=False): if self._tab.search.search_displayed: From 733625e140c5f4fa1657ac93d7b0439c849ad17f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 21 Jul 2018 23:33:23 +0200 Subject: [PATCH 151/324] Stabilize test_qute_settings_persistence --- tests/end2end/test_invocations.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index 5a2e15048..341088db8 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -371,6 +371,7 @@ def test_qute_settings_persistence(short_tmpdir, request, quteproc_new): quteproc_new.open_path('qute://settings/') quteproc_new.send_cmd(':jseval --world main ' 'cset("search.ignore_case", "always")') + quteproc_new.wait_for(message='No output or error') assert quteproc_new.get_setting('search.ignore_case') == 'always' From 31a6374e0e04c17440bcb50ceccb38ed86ac7d65 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 21 Jul 2018 23:36:21 +0200 Subject: [PATCH 152/324] Mark some more flaky tests as flaky I really want end2end tests to die... --- tests/end2end/features/backforward.feature | 1 + tests/end2end/features/history.feature | 2 +- tests/end2end/test_hints_html.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/end2end/features/backforward.feature b/tests/end2end/features/backforward.feature index 413ee9d95..cd356a831 100644 --- a/tests/end2end/features/backforward.feature +++ b/tests/end2end/features/backforward.feature @@ -74,6 +74,7 @@ Feature: Going back and forward. url: http://localhost:*/data/backforward/1.txt - url: http://localhost:*/data/backforward/2.txt + @flaky Scenario: Going back with count. Given I open data/backforward/1.txt When I open data/backforward/2.txt diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index c3791945e..d095d23dc 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -104,7 +104,7 @@ Feature: Page history Then the page should contain the plaintext "4.txt" # Hangs a lot on AppVeyor - @posix + @posix @flaky Scenario: Listing history with qute:history redirect When I open data/numbers/3.txt And I open data/numbers/4.txt diff --git a/tests/end2end/test_hints_html.py b/tests/end2end/test_hints_html.py index abc94d70d..36c76fe4f 100644 --- a/tests/end2end/test_hints_html.py +++ b/tests/end2end/test_hints_html.py @@ -117,6 +117,7 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation, quteproc.set_setting('hints.find_implementation', 'javascript') +@pytest.mark.flaky def test_word_hints_issue1393(quteproc, tmpdir): dict_file = tmpdir / 'dict' dict_file.write(textwrap.dedent(""" From a7170fefe952b0a355a5e63995106723acb990c3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 10:04:42 +0200 Subject: [PATCH 153/324] Turn off hypothesis deadline if on CI --- tests/conftest.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 595c2940e..7168cd812 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -42,10 +42,15 @@ from qutebrowser.qt import sip import qutebrowser.app # To register commands +ON_CI = 'CI' in os.environ + + # Set hypothesis settings hypothesis.settings.register_profile('default', hypothesis.settings(deadline=600)) -hypothesis.settings.load_profile('default') +hypothesis.settings.register_profile('ci', + hypothesis.settings(deadline=None)) +hypothesis.settings.load_profile('ci' if ON_CI else 'default') def _apply_platform_markers(config, item): @@ -60,8 +65,8 @@ def _apply_platform_markers(config, item): "Can't be run when frozen"), ('frozen', not getattr(sys, 'frozen', False), "Can only run when frozen"), - ('ci', 'CI' not in os.environ, "Only runs on CI."), - ('no_ci', 'CI' in os.environ, "Skipped on CI."), + ('ci', not ON_CI, "Only runs on CI."), + ('no_ci', ON_CI, "Skipped on CI."), ('issue2478', utils.is_windows and config.webengine, "Broken with QtWebEngine on Windows"), ('issue3572', From 13f688eeb8cf82237a38ea36abdd795084c54be9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 11:24:06 +0200 Subject: [PATCH 154/324] "Fix" more flaky tests --- tests/end2end/features/history.feature | 1 + tests/end2end/features/search.feature | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index d095d23dc..7bcf65c61 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -110,6 +110,7 @@ Feature: Page history And I open data/numbers/4.txt And I open qute:history without waiting And I wait until qute://history is loaded + And I wait 1s Then the page should contain the plaintext "3.txt" Then the page should contain the plaintext "4.txt" diff --git a/tests/end2end/features/search.feature b/tests/end2end/features/search.feature index 568831c0d..96ef5212b 100644 --- a/tests/end2end/features/search.feature +++ b/tests/end2end/features/search.feature @@ -260,7 +260,7 @@ Feature: Searching on a page - data/search.html - data/hello.txt (active) - @qtwebkit_skip: Not supported in qtwebkit + @qtwebkit_skip: Not supported in qtwebkit @flaky Scenario: Follow a searched link in an iframe When I open data/iframe_search.html And I run :tab-only @@ -269,7 +269,7 @@ Feature: Searching on a page And I run :follow-selected Then "navigation request: url http://localhost:*/data/hello.txt, type Type.link_clicked, is_main_frame False" should be logged - @qtwebkit_skip: Not supported in qtwebkit + @qtwebkit_skip: Not supported in qtwebkit @flaky Scenario: Follow a tabbed searched link in an iframe When I open data/iframe_search.html And I run :tab-only From 0304036d7dafad4a9e081aded4015adab043bb13 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 12:05:55 +0200 Subject: [PATCH 155/324] Skip test which is too flaky --- tests/end2end/features/javascript.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index 0239f7bb5..ed1333525 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -21,7 +21,7 @@ Feature: Javascript stuff And the following tabs should be open: - data/javascript/window_open.html (active) - @qtwebkit_skip @flaky + @skip # Too flaky Scenario: Opening/closing a modal window via JS When I open data/javascript/window_open.html And I run :tab-only From c1c182d958a47c9d65da5f962890347f3f7cf3ba Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 13:03:25 +0200 Subject: [PATCH 156/324] Mark more tests as flaky --- tests/end2end/features/backforward.feature | 1 + tests/end2end/features/tabs.feature | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/end2end/features/backforward.feature b/tests/end2end/features/backforward.feature index cd356a831..271f4d6cd 100644 --- a/tests/end2end/features/backforward.feature +++ b/tests/end2end/features/backforward.feature @@ -3,6 +3,7 @@ Feature: Going back and forward. Testing the :back/:forward commands. + @flaky Scenario: Going back/forward Given I open data/backforward/1.txt When I open data/backforward/2.txt diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 5f5ae5d29..3f1be405a 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -915,6 +915,7 @@ Feature: Tab management When I run :buffer invalid title Then the error "No matching tab for: invalid title" should be shown + @flaky Scenario: :buffer with matching title and two windows When I open data/title.html And I open data/search.html in a new tab From 40e58126aaf74f878ea37fe2b940615b32877392 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 13:07:06 +0200 Subject: [PATCH 157/324] About everything is flaky Did I already mention that I'm starting to hate those tests I wrote in the past with a passion? --- tests/end2end/features/downloads.feature | 1 + tests/end2end/features/history.feature | 2 ++ tests/end2end/features/qutescheme.feature | 3 ++- tests/end2end/features/scroll.feature | 4 +++- tests/end2end/features/search.feature | 1 + tests/end2end/features/urlmarks.feature | 1 + 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index 7aa92abe0..e62c7a030 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -211,6 +211,7 @@ Feature: Downloading things from a website. # works e.g. on a connection loss, which we can't test automatically. Then "Retrying downloads is unsupported *" should not be logged + @flaky Scenario: Retrying with count When I run :download http://localhost:(port)/data/downloads/download.bin And I run :download http://localhost:(port)/does-not-exist diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 7bcf65c61..d3e3a815b 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -96,10 +96,12 @@ Feature: Page history http://localhost:(port)/data/hints/html/simple.html Simple link http://localhost:(port)/data/hello.txt + @flaky Scenario: Listing history When I open data/numbers/3.txt And I open data/numbers/4.txt And I open qute://history + And I wait 1s Then the page should contain the plaintext "3.txt" Then the page should contain the plaintext "4.txt" diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index 74b11b344..ddb3fa2e5 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -116,7 +116,8 @@ Feature: Special qute:// pages Then the option search.ignore_case should be set to always # Sometimes, an unrelated value gets set - @flaky + # Too flaky... + @skip Scenario: Focusing input fields in qute://settings and entering invalid value When I open qute://settings # scroll to the right - the table does not fit in the default screen diff --git a/tests/end2end/features/scroll.feature b/tests/end2end/features/scroll.feature index 83eef16ab..f615be39a 100644 --- a/tests/end2end/features/scroll.feature +++ b/tests/end2end/features/scroll.feature @@ -173,10 +173,12 @@ Feature: Scrolling When I run :scroll-to-perc 50 Then the page should be scrolled vertically + @flaky Scenario: Scrolling to middle with :scroll-to-perc (float) When I run :scroll-to-perc 50.5 Then the page should be scrolled vertically + @flaky Scenario: Scrolling to middle and to top with :scroll-to-perc When I run :scroll-to-perc 50 And I wait until the scroll position changed @@ -231,7 +233,7 @@ Feature: Scrolling Scenario: :scroll-to-perc with count and argument When I run :scroll-to-perc 0 with count 50 Then the page should be scrolled vertically - + # https://github.com/qutebrowser/qutebrowser/issues/1821 @issue3572 Scenario: :scroll-to-perc without doctype diff --git a/tests/end2end/features/search.feature b/tests/end2end/features/search.feature index 96ef5212b..e404ea773 100644 --- a/tests/end2end/features/search.feature +++ b/tests/end2end/features/search.feature @@ -214,6 +214,7 @@ Feature: Searching on a page # TODO: wrapping message without scrolling ## follow searched links + @flaky Scenario: Follow a searched link When I run :search follow And I wait for "search found follow" in the log diff --git a/tests/end2end/features/urlmarks.feature b/tests/end2end/features/urlmarks.feature index 836af5c4f..ec38116c3 100644 --- a/tests/end2end/features/urlmarks.feature +++ b/tests/end2end/features/urlmarks.feature @@ -116,6 +116,7 @@ Feature: quickmarks and bookmarks When I run :quickmark-add http://localhost:(port)/data/numbers/9.txt nine Then the quickmark file should contain "nine http://localhost:*/data/numbers/9.txt" + @flaky Scenario: Saving a quickmark (:quickmark-save) When I open data/numbers/10.txt And I run :quickmark-save From 463dd911a3af577785e352511253309a1d7cbed7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 15:46:24 +0200 Subject: [PATCH 158/324] More flaky tests --- tests/end2end/features/scroll.feature | 1 + tests/end2end/features/search.feature | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/end2end/features/scroll.feature b/tests/end2end/features/scroll.feature index f615be39a..20156de2b 100644 --- a/tests/end2end/features/scroll.feature +++ b/tests/end2end/features/scroll.feature @@ -145,6 +145,7 @@ Feature: Scrolling And I wait until the scroll position changed to 0/0 Then the page should not be scrolled + @flaky Scenario: Scrolling down with a very big count When I run :scroll down with count 99999999999 # Make sure it doesn't hang diff --git a/tests/end2end/features/search.feature b/tests/end2end/features/search.feature index e404ea773..e9d71f779 100644 --- a/tests/end2end/features/search.feature +++ b/tests/end2end/features/search.feature @@ -221,6 +221,7 @@ Feature: Searching on a page And I run :follow-selected Then data/hello.txt should be loaded + @flaky Scenario: Follow a searched link in a new tab When I run :window-only And I run :search follow From 98cf1e5b2c034cb5c710ac98ef05306403a6b24d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 22 Jul 2018 17:19:12 +0200 Subject: [PATCH 159/324] Kill some more tests --- tests/end2end/features/qutescheme.feature | 4 ++-- tests/end2end/features/scroll.feature | 1 + tests/end2end/features/search.feature | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index ddb3fa2e5..150f74988 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -98,8 +98,8 @@ Feature: Special qute:// pages # qute://settings - # Sometimes, an unrelated value gets set - @flaky + # Sometimes, an unrelated value gets set, which also breaks other tests + @skip Scenario: Focusing input fields in qute://settings and entering valid value When I set search.ignore_case to never And I open qute://settings diff --git a/tests/end2end/features/scroll.feature b/tests/end2end/features/scroll.feature index 20156de2b..2e0414037 100644 --- a/tests/end2end/features/scroll.feature +++ b/tests/end2end/features/scroll.feature @@ -163,6 +163,7 @@ Feature: Scrolling When I run :scroll-to-perc 100 Then the page should be scrolled vertically + @flaky Scenario: Scrolling to bottom and to top with :scroll-to-perc When I run :scroll-to-perc 100 And I wait until the scroll position changed diff --git a/tests/end2end/features/search.feature b/tests/end2end/features/search.feature index e9d71f779..f6c12e98d 100644 --- a/tests/end2end/features/search.feature +++ b/tests/end2end/features/search.feature @@ -262,7 +262,8 @@ Feature: Searching on a page - data/search.html - data/hello.txt (active) - @qtwebkit_skip: Not supported in qtwebkit @flaky + # Too flaky + @qtwebkit_skip: Not supported in qtwebkit @skip Scenario: Follow a searched link in an iframe When I open data/iframe_search.html And I run :tab-only From 4c8e163166b6d397004770eab655807fa0b7804b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Jul 2018 19:34:12 +0200 Subject: [PATCH 160/324] Update astroid from 2.0 to 2.0.1 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 02af7a5f0..ee674a733 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -astroid==2.0 +astroid==2.0.1 certifi==2018.4.16 chardet==3.0.4 github3.py==1.1.0 From f5649730ce85c149ce5460361073348e8e715fcc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Jul 2018 19:34:14 +0200 Subject: [PATCH 161/324] Update pylint from 2.0.0 to 2.0.1 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index ee674a733..e78dfe2cc 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -8,7 +8,7 @@ idna==2.7 isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 -pylint==2.0.0 +pylint==2.0.1 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.19.1 From a8974e1f04a809c2d0c65709201ce8cef9590b5e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Jul 2018 19:34:15 +0200 Subject: [PATCH 162/324] Update hypothesis from 3.66.1 to 3.66.6 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index c6fa6cb4e..0c609c1c3 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.66.1 +hypothesis==3.66.6 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 05bf5a7ce8cf2451a7f0fa7c6bd445408c85c664 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Jul 2018 19:34:17 +0200 Subject: [PATCH 163/324] Update pytest-repeat from 0.4.1 to 0.5.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 0c609c1c3..07b037819 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -32,7 +32,7 @@ pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 pytest-qt==3.0.0 -pytest-repeat==0.4.1 +pytest-repeat==0.5.0 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 pytest-xvfb==1.1.0 From 6c353a140f7ac3e419b66bc4ddc40f02ea720e72 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 23 Jul 2018 21:32:09 +0200 Subject: [PATCH 164/324] Bump up yaml_load deadline on CI --- qutebrowser/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index 4554aef2e..fe255331d 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -645,7 +645,7 @@ def yaml_load(f): end = datetime.datetime.now() delta = (end - start).total_seconds() - deadline = 5 if 'CI' in os.environ else 2 + deadline = 10 if 'CI' in os.environ else 2 if delta > deadline: # pragma: no cover log.misc.warning( "YAML load took unusually long, please report this at " From 1413c910c68e8eef30bef955592f5bcfb393c9f2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 15:42:14 +0200 Subject: [PATCH 165/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 9bc787f99..cbf531ce4 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -34,6 +34,7 @@ Fixed - Crash in Qt 5.7.1 when a website uses `window.print()`. - The workaround for Nouveau graphic drivers now works properly again. +- Crash when using `:follow-selected` with a link which is outside of the view. v1.4.1 ------ From f69cd2259e0ffc1d4e93078059b4229b81862bb4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 15:44:27 +0200 Subject: [PATCH 166/324] Don't require user interaction for clicking qute:// links See #4090, #4073 --- qutebrowser/browser/webengine/webengineelem.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qutebrowser/browser/webengine/webengineelem.py b/qutebrowser/browser/webengine/webengineelem.py index 01ec7b687..aefa51f5a 100644 --- a/qutebrowser/browser/webengine/webengineelem.py +++ b/qutebrowser/browser/webengine/webengineelem.py @@ -203,6 +203,8 @@ class WebEngineElement(webelem.AbstractWebElement): url = self.resolve_url(baseurl) if url is None: return True + if baseurl.scheme() == url.scheme(): # e.g. a qute:// link + return False return url.scheme() not in urlutils.WEBENGINE_SCHEMES def _click_editable(self, click_target): From d830dd69a46149ad37779975374d2a0c2025f5ef Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 16:04:28 +0200 Subject: [PATCH 167/324] Add workaround comment --- qutebrowser/mainwindow/mainwindow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index b95de54fc..3fdad13d1 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -99,6 +99,7 @@ def raise_window(window, alert=True): window.setWindowState(window.windowState() & ~Qt.WindowMinimized) window.setWindowState(window.windowState() | Qt.WindowActive) window.raise_() + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-69568 QCoreApplication.processEvents( QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers) window.activateWindow() From d62a70267e15a7bd04317e5c71da68ae73932182 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 16:05:03 +0200 Subject: [PATCH 168/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index cbf531ce4..2652cc588 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -35,6 +35,8 @@ Fixed - Crash in Qt 5.7.1 when a website uses `window.print()`. - The workaround for Nouveau graphic drivers now works properly again. - Crash when using `:follow-selected` with a link which is outside of the view. +- Workaround for windows not showing as urgent with some window managers + (like i3). v1.4.1 ------ From 32e957dfbd7134df759c573d71b5009aba45363e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 16:15:54 +0200 Subject: [PATCH 169/324] Update security FAQ entry --- doc/faq.asciidoc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 5fd36d67b..7225f0f4e 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -87,12 +87,14 @@ features are also enabled as a second line of defense. http://wiki.qt.io/QtWebKit[QtWebKit] is also supported as an alternative backend, but hasn't seen new releases https://github.com/annulen/webkit/releases[in a while]. It also doesn't have any -process isolation or sandboxing. +process isolation or sandboxing. See +https://github.com/qutebrowser/qutebrowser/issues/4039[#4039] for more details. + -Security issues in qutebrowser's code happen very rarely (as per March 2018, -there has been one security issue caused by qutebrowser in over four years) and -are fixed timely. To report security bugs, please contact me directly at -mail@qutebrowser.org, GPG ID +Security issues in qutebrowser's code happen very rarely (as per July 2018, +there have been three security issues caused by qutebrowser in over 4.5 years). +Those were handled appropriately +(http://seclists.org/oss-sec/2018/q3/29[example]) and fixed timely. To report +security bugs, please contact me directly at mail@qutebrowser.org, GPG ID https://www.the-compiler.org/pubkey.asc[0x916eb0c8fd55a072]. Is there an adblocker?:: From 8b814e3072534a231d9207f39d2d2a408023ab85 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 16:51:36 +0200 Subject: [PATCH 170/324] Increase qute://history delay in tests --- tests/end2end/features/history.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index d3e3a815b..3f5aa1025 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -101,7 +101,7 @@ Feature: Page history When I open data/numbers/3.txt And I open data/numbers/4.txt And I open qute://history - And I wait 1s + And I wait 2s Then the page should contain the plaintext "3.txt" Then the page should contain the plaintext "4.txt" @@ -112,7 +112,7 @@ Feature: Page history And I open data/numbers/4.txt And I open qute:history without waiting And I wait until qute://history is loaded - And I wait 1s + And I wait 2s Then the page should contain the plaintext "3.txt" Then the page should contain the plaintext "4.txt" @@ -125,7 +125,7 @@ Feature: Page history Scenario: Escaping of URLs in :history When I open query?one=1&two=2 And I open qute://history - And I wait 1s # JS loads the history async + And I wait 2s # JS loads the history async And I hint with args "links normal" and follow a And I wait until query?one=1&two=2 is loaded Then the query parameter two should be set to 2 From 12e537593179cab96c27eb184ed7719184ea205f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 17:36:01 +0200 Subject: [PATCH 171/324] Handle more test flakiness --- tests/end2end/features/backforward.feature | 2 +- tests/end2end/features/editor.feature | 1 + tests/end2end/features/misc.feature | 4 ++-- tests/end2end/features/sessions.feature | 4 ++-- tests/end2end/test_hints_html.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/end2end/features/backforward.feature b/tests/end2end/features/backforward.feature index 271f4d6cd..4de785517 100644 --- a/tests/end2end/features/backforward.feature +++ b/tests/end2end/features/backforward.feature @@ -3,7 +3,7 @@ Feature: Going back and forward. Testing the :back/:forward commands. - @flaky + @skip # Too flaky Scenario: Going back/forward Given I open data/backforward/1.txt When I open data/backforward/2.txt diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature index 33535856c..ada688903 100644 --- a/tests/end2end/features/editor.feature +++ b/tests/end2end/features/editor.feature @@ -86,6 +86,7 @@ Feature: Opening external editors When I run :edit-url -t -b Then the error "Only one of -t/-b/-w can be given!" should be shown + @flaky Scenario: Editing a URL with invalid URL When I set url.auto_search to never And I open data/hello.txt diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index f3b5ac47a..5f0035b8b 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -533,14 +533,14 @@ Feature: Various utility commands. Then "Renderer process crashed" should be logged And "* 'Error loading chrome://crash/'" should be logged - @qtwebkit_skip @no_invalid_lines @qt>=5.9 + @qtwebkit_skip @no_invalid_lines @qt>=5.9 @flaky Scenario: Renderer kill (5.9) When I run :open -t chrome://kill Then "Renderer process was killed" should be logged And "* 'Error loading chrome://kill/'" should be logged # https://github.com/qutebrowser/qutebrowser/issues/2290 - @qtwebkit_skip @no_invalid_lines + @qtwebkit_skip @no_invalid_lines @flaky Scenario: Navigating to URL after renderer process is gone When I run :tab-only And I open data/numbers/1.txt diff --git a/tests/end2end/features/sessions.feature b/tests/end2end/features/sessions.feature index cb54e34cf..626a88ba8 100644 --- a/tests/end2end/features/sessions.feature +++ b/tests/end2end/features/sessions.feature @@ -228,7 +228,7 @@ Feature: Saving and loading sessions url: http://localhost:*/data/hello.txt # Seems like that bug is fixed upstream in QtWebEngine - @qtwebkit_skip + @qtwebkit_skip @flaky Scenario: Saving a session with a page using history.replaceState() and navigating away When I open data/sessions/history_replace_state.html without waiting And I wait for "* Called history.replaceState" in the log @@ -363,7 +363,7 @@ Feature: Saving and loading sessions And I replace "about:blank" by "http://localhost:(port)/data/numbers/2.txt" in the "loaded_session" session file And I run :session-load loaded_session Then data/numbers/2.txt should be loaded - + @qtwebengine_flaky Scenario: Loading and deleting a session When I open about:blank diff --git a/tests/end2end/test_hints_html.py b/tests/end2end/test_hints_html.py index 36c76fe4f..9dee23c53 100644 --- a/tests/end2end/test_hints_html.py +++ b/tests/end2end/test_hints_html.py @@ -117,7 +117,7 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation, quteproc.set_setting('hints.find_implementation', 'javascript') -@pytest.mark.flaky +@pytest.mark.skip # Too flaky def test_word_hints_issue1393(quteproc, tmpdir): dict_file = tmpdir / 'dict' dict_file.write(textwrap.dedent(""" From 6fa07703dbf7f3be6f8365be7a4a4adf527e0b41 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Jul 2018 19:56:34 +0200 Subject: [PATCH 172/324] More flaky tests --- tests/end2end/features/caret.feature | 1 + tests/end2end/features/history.feature | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/end2end/features/caret.feature b/tests/end2end/features/caret.feature index 268828edd..1d1f84270 100644 --- a/tests/end2end/features/caret.feature +++ b/tests/end2end/features/caret.feature @@ -345,6 +345,7 @@ Feature: Caret mode And I run :follow-selected --tab Then data/hello.txt should be loaded + @flaky Scenario: :follow-selected with link tabbing in a tab (with JS) When I set content.javascript.enabled to true And I run :leave-mode diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 3f5aa1025..0706fde17 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -121,7 +121,7 @@ Feature: Page history And I open qute://history Then the javascript message "XSS" should not be logged - @flaky + @skip # Too flaky Scenario: Escaping of URLs in :history When I open query?one=1&two=2 And I open qute://history From 7ac7ccc2967d19cae332e7082e380e7df27d1e75 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 28 Jul 2018 09:18:50 +0200 Subject: [PATCH 173/324] Ignore invalid URLs in acceptNavigationRequest --- doc/changelog.asciidoc | 2 ++ qutebrowser/browser/webengine/webview.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 2652cc588..8b180cf2a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -37,6 +37,8 @@ Fixed - Crash when using `:follow-selected` with a link which is outside of the view. - Workaround for windows not showing as urgent with some window managers (like i3). +- Crash when opening URLs with some unicode characters (IDNA 2008). Those URLs + still won't open though, due to missing support in Qt. v1.4.1 ------ diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index b10cc5f9a..784bc57d6 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -242,6 +242,14 @@ class WebEnginePage(QWebEnginePage): typ: QWebEnginePage.NavigationType, is_main_frame: bool): """Override acceptNavigationRequest to forward it to the tab API.""" + if not url.isValid(): + # WORKAROUND for missing IDNA 2008 support in QUrl + # see https://bugreports.qt.io/browse/QTBUG-60364 + log.webview.debug("Ignoring invalid URL {} in " + "acceptNavigationRequest: {}".format( + url.toDisplayString(), url.errorString())) + return True + type_map = { QWebEnginePage.NavigationTypeLinkClicked: usertypes.NavigationRequest.Type.link_clicked, From 5269c5ac2bcdac23bd7c0a0257915b28c8f1d9df Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 28 Jul 2018 09:52:45 +0200 Subject: [PATCH 174/324] Another flaky test --- tests/end2end/features/caret.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/end2end/features/caret.feature b/tests/end2end/features/caret.feature index 1d1f84270..a6fd671bf 100644 --- a/tests/end2end/features/caret.feature +++ b/tests/end2end/features/caret.feature @@ -321,6 +321,7 @@ Feature: Caret mode - data/caret.html - data/hello.txt (active) + @flaky Scenario: :follow-selected with link tabbing (without JS) When I set content.javascript.enabled to false And I run :leave-mode From 4c23fb9e2f94b00cb25dfb5ffcc7dcc4e4541c4f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 28 Jul 2018 09:57:42 +0200 Subject: [PATCH 175/324] Another flaky test --- tests/end2end/features/javascript.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index ed1333525..72318ba15 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -131,6 +131,7 @@ Feature: Javascript stuff And I run :tab-next Then the window sizes should be the same + @flaky Scenario: Checking visible/invisible window size with vertical tabbar When I run :tab-only And I set tabs.position to left From ee06ba0140ef5867abaae94b8270ea12960c10a9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 28 Jul 2018 11:54:58 +0200 Subject: [PATCH 176/324] Handle invalid URLs in acceptNavigationRequest in the tab API --- qutebrowser/browser/browsertab.py | 20 ++++++++++++++------ qutebrowser/browser/webengine/webview.py | 8 -------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 9a2d13242..4bf744624 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -854,12 +854,20 @@ class AbstractTab(QWidget): navigation.navigation_type, navigation.is_main_frame)) - if (navigation.navigation_type == navigation.Type.link_clicked and - not navigation.url.isValid()): - msg = urlutils.get_errstring(navigation.url, - "Invalid link clicked") - message.error(msg) - self.data.open_target = usertypes.ClickTarget.normal + if not navigation.url.isValid(): + # Also a WORKAROUND for missing IDNA 2008 support in QUrl, see + # https://bugreports.qt.io/browse/QTBUG-60364 + + if navigation.navigation_type == navigation.Type.link_clicked: + msg = urlutils.get_errstring(navigation.url, + "Invalid link clicked") + message.error(msg) + self.data.open_target = usertypes.ClickTarget.normal + + log.webview.debug("Ignoring invalid URL {} in " + "acceptNavigationRequest: {}".format( + navigation.url.toDisplayString(), + navigation.url.errorString())) navigation.accepted = False def handle_auto_insert_mode(self, ok): diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 784bc57d6..b10cc5f9a 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -242,14 +242,6 @@ class WebEnginePage(QWebEnginePage): typ: QWebEnginePage.NavigationType, is_main_frame: bool): """Override acceptNavigationRequest to forward it to the tab API.""" - if not url.isValid(): - # WORKAROUND for missing IDNA 2008 support in QUrl - # see https://bugreports.qt.io/browse/QTBUG-60364 - log.webview.debug("Ignoring invalid URL {} in " - "acceptNavigationRequest: {}".format( - url.toDisplayString(), url.errorString())) - return True - type_map = { QWebEnginePage.NavigationTypeLinkClicked: usertypes.NavigationRequest.Type.link_clicked, From 6b044d4affe2929bcf01911811d9ebb29dcf9ad4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 28 Jul 2018 14:47:01 +0200 Subject: [PATCH 177/324] Fix indent --- qutebrowser/browser/browsertab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 4bf744624..087834e53 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -860,7 +860,7 @@ class AbstractTab(QWidget): if navigation.navigation_type == navigation.Type.link_clicked: msg = urlutils.get_errstring(navigation.url, - "Invalid link clicked") + "Invalid link clicked") message.error(msg) self.data.open_target = usertypes.ClickTarget.normal From 985b1fcd636a62c2a6283de2a9c8607febd8cc44 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:12 +0200 Subject: [PATCH 178/324] Update altgraph from 0.15 to 0.16.1 --- misc/requirements/requirements-pyinstaller.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index e9163933b..15286c77a 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -altgraph==0.15 +altgraph==0.16.1 future==0.16.0 macholib==1.9 pefile==2017.11.5 From 889521e4050228df9773b2f0d3001dfe5ca082be Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:14 +0200 Subject: [PATCH 179/324] Update macholib from 1.9 to 1.10 --- misc/requirements/requirements-pyinstaller.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index 15286c77a..5af5bcc2e 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -2,6 +2,6 @@ altgraph==0.16.1 future==0.16.0 -macholib==1.9 +macholib==1.10 pefile==2017.11.5 PyInstaller==3.3.1 From afad6cbf08524d59fa68f4342db84e92286f416c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:15 +0200 Subject: [PATCH 180/324] Update beautifulsoup4 from 4.6.0 to 4.6.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 07b037819..c7871bbc3 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -3,7 +3,7 @@ atomicwrites==1.1.5 attrs==18.1.0 backports.functools-lru-cache==1.5 -beautifulsoup4==4.6.0 +beautifulsoup4==4.6.1 cheroot==6.3.3 click==6.7 # colorama==0.3.9 From a6a6ef4662935e13afd0ad84d23be575f26c0a4a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:17 +0200 Subject: [PATCH 181/324] Update hypothesis from 3.66.6 to 3.66.14 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index c7871bbc3..ee6d437fd 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.66.6 +hypothesis==3.66.14 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 9686a0f8c85dc0cbdebc3891f463a7bd36dbd0b2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:18 +0200 Subject: [PATCH 182/324] Update pluggy from 0.6.0 to 0.7.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index ee6d437fd..ebbd4dfde 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -21,7 +21,7 @@ Mako==1.0.7 more-itertools==4.2.0 parse==1.8.4 parse-type==0.4.2 -pluggy==0.6.0 +pluggy==0.7.1 py==1.5.4 py-cpuinfo==4.0.0 pytest==3.6.3 From 7de6de752b49526e4180c87d7209d2ea61781207 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:20 +0200 Subject: [PATCH 183/324] Update pluggy from 0.6.0 to 0.7.1 --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index e8c660eab..62a037934 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py packaging==17.1 -pluggy==0.6.0 +pluggy==0.7.1 py==1.5.4 pyparsing==2.2.0 six==1.11.0 From 840eb49e65a82099d71cdffb81b7bd13de9b8cc1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Jul 2018 19:39:21 +0200 Subject: [PATCH 184/324] Update pytest from 3.6.3 to 3.6.4 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index ebbd4dfde..8b2d61007 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.5.4 py-cpuinfo==4.0.0 -pytest==3.6.3 +pytest==3.6.4 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 From 97a17f66a514137bab1b77988ba3139bcb57cac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Wed, 1 Aug 2018 11:16:41 +0200 Subject: [PATCH 185/324] Add No-Script-like JavaScript blocking --- doc/faq.asciidoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 7225f0f4e..b734d1e4a 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -105,6 +105,15 @@ Is there an adblocker?:: https://blog.mozilla.org/nnethercote/2014/05/14/adblock-pluss-effect-on-firefoxs-memory-usage/[RAM usage], so implementing support for AdBlockPlus-like lists is currently not a priority. + +How can I get No-Script-like behaviour?:: + You can toggle JavaScript blocking for the current domain with `tsh` by default. + To disable JavaScript by default: ++ +---- +:set content.javascript.enabled false +---- ++ How do I play Youtube videos with mpv?:: You can easily add a key binding to play youtube videos inside a real video From 9d848799d5ee9d11e10b018593c997620b2a9feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Wed, 1 Aug 2018 13:43:01 +0200 Subject: [PATCH 186/324] Add details on how to use other variants of JavaScript exception commands --- doc/faq.asciidoc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index b734d1e4a..39d23a85a 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -106,14 +106,18 @@ Is there an adblocker?:: usage], so implementing support for AdBlockPlus-like lists is currently not a priority. -How can I get No-Script-like behaviour?:: - You can toggle JavaScript blocking for the current domain with `tsh` by default. +How can I get No-Script-like behavior?:: To disable JavaScript by default: + ---- :set content.javascript.enabled false ---- + +The basic command for enabling JavaScript for the current host is `tsh`. +This will allow JavaScript execution for the current session. +Use `S` instead of `s` to make the exception permanent. +With `H` instead of `h`, subdomains are included. +Use S instead of s to make the exception permanent. With H instead of h, subdomains are included. With u instead of h, only the current URL is whitelisted (not the whole host).With `u` instead of `h`, only the current URL is whitelisted (not the whole host). How do I play Youtube videos with mpv?:: You can easily add a key binding to play youtube videos inside a real video From e5ae244387f89e28635377b118db45b20e66817a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Wed, 1 Aug 2018 13:51:03 +0200 Subject: [PATCH 187/324] Fix copy paste mistake --- doc/faq.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 39d23a85a..4f9815cf2 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -117,7 +117,7 @@ The basic command for enabling JavaScript for the current host is `tsh`. This will allow JavaScript execution for the current session. Use `S` instead of `s` to make the exception permanent. With `H` instead of `h`, subdomains are included. -Use S instead of s to make the exception permanent. With H instead of h, subdomains are included. With u instead of h, only the current URL is whitelisted (not the whole host).With `u` instead of `h`, only the current URL is whitelisted (not the whole host). +With `u` instead of `h`, only the current URL is whitelisted (not the whole host). How do I play Youtube videos with mpv?:: You can easily add a key binding to play youtube videos inside a real video From 18884233322fd43d141100ad865efce7669148f9 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 2 Aug 2018 22:03:10 +0200 Subject: [PATCH 188/324] Added a warning when a second instance is being launched with a backend flag --- qutebrowser/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 3cce2e85e..92894dd77 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -129,6 +129,8 @@ def run(args): sys.exit(usertypes.Exit.err_ipc) if server is None: + if args.backend is not None: + log.init.warning("Changing the backend will not work, the backend from the previous instance will be used!") sys.exit(usertypes.Exit.ok) else: server.got_args.connect(lambda args, target_arg, cwd: From 068ac0df822ef3ddec73c7436191f9fa59f108c7 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 4 Aug 2018 01:06:38 +0200 Subject: [PATCH 189/324] Make the line shorter and span over 2 lines --- qutebrowser/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 92894dd77..2f96c2269 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -130,7 +130,8 @@ def run(args): if server is None: if args.backend is not None: - log.init.warning("Changing the backend will not work, the backend from the previous instance will be used!") + log.init.warning("Backend from the running" + "instance will be used") sys.exit(usertypes.Exit.ok) else: server.got_args.connect(lambda args, target_arg, cwd: From 56caae9c47969a84c4b565fe3616b2f41d6ef794 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 4 Aug 2018 01:09:15 +0200 Subject: [PATCH 190/324] Fixed the lack of whitespace between words --- qutebrowser/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 2f96c2269..89c7429ce 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -131,7 +131,7 @@ def run(args): if server is None: if args.backend is not None: log.init.warning("Backend from the running" - "instance will be used") + " instance will be used") sys.exit(usertypes.Exit.ok) else: server.got_args.connect(lambda args, target_arg, cwd: From c692649ad1b9a51f78a9760b680917346c33c4ca Mon Sep 17 00:00:00 2001 From: David Date: Sat, 4 Aug 2018 01:12:39 +0200 Subject: [PATCH 191/324] Improved the style of the message --- qutebrowser/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 89c7429ce..a334d8100 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -130,8 +130,8 @@ def run(args): if server is None: if args.backend is not None: - log.init.warning("Backend from the running" - " instance will be used") + log.init.warning( + "Backend from the running instance will be used") sys.exit(usertypes.Exit.ok) else: server.got_args.connect(lambda args, target_arg, cwd: From 50823b9415a2d047e4f3e53a7d2ec1fd223e415b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 4 Aug 2018 13:41:08 +0200 Subject: [PATCH 192/324] eslint: Disable require-unicode-regexp See https://eslint.org/docs/rules/require-unicode-regexp It would be useful to have, but Chromium 49 coming with Qt 5.7 doesn't support it (Chromium 56 in Qt 5.9 would)... Also see #3839 --- qutebrowser/javascript/.eslintrc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/javascript/.eslintrc.yaml b/qutebrowser/javascript/.eslintrc.yaml index 6a46f96e9..9e99b0aa5 100644 --- a/qutebrowser/javascript/.eslintrc.yaml +++ b/qutebrowser/javascript/.eslintrc.yaml @@ -58,3 +58,4 @@ rules: max-lines: "off" multiline-ternary: ["error", "always-multiline"] max-lines-per-function: "off" + require-unicode-regexp: "off" From e4c58890cfce3cbbc42014628c53d5c213fbbae8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 4 Aug 2018 18:11:57 +0200 Subject: [PATCH 193/324] Install xfonts-base to fix Qt 5.10 tests Fixes #4055 See #4110 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91c34b665..6141b2ab7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ matrix: env: TESTENV=py36-pyqt59 - os: linux env: TESTENV=py36-pyqt510 + addons: + apt: + packages: + - xfonts-base - os: linux env: TESTENV=py36-pyqt511-cov # https://github.com/travis-ci/travis-ci/issues/9069 @@ -65,10 +69,6 @@ matrix: env: TESTENV=shellcheck services: docker fast_finish: true - allow_failures: - # https://github.com/qutebrowser/qutebrowser/issues/4055 - - os: linux - env: TESTENV=py36-pyqt510 cache: directories: From 7746f956f69a7d0f059e1b99c99ccb9c38632d23 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 5 Aug 2018 22:50:22 +0200 Subject: [PATCH 194/324] Add Darcula colorscheme --- doc/help/configuring.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/help/configuring.asciidoc b/doc/help/configuring.asciidoc index 4734e6b54..e63117df4 100644 --- a/doc/help/configuring.asciidoc +++ b/doc/help/configuring.asciidoc @@ -395,6 +395,7 @@ Pre-built colorschemes - A collection of https://github.com/chriskempson/base16[base16] color-schemes can be found in https://github.com/theova/base16-qutebrowser[base16-qutebrowser] and used with https://github.com/AuditeMarlow/base16-manager[base16-manager]. - Two implementations of the https://github.com/arcticicestudio/nord[Nord] colorscheme for qutebrowser exist: https://github.com/Linuus/nord-qutebrowser[Linuus], https://github.com/KnownAsDon/QuteBrowser-Nord-Theme[KnownAsDon] +- https://github.com/evannagle/qutebrowser-dracula-theme[Darcula] Avoiding flake8 errors ^^^^^^^^^^^^^^^^^^^^^^ From dd05c22987a8d3d65824883bc1aff9240e13ee91 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 5 Aug 2018 23:13:42 +0200 Subject: [PATCH 195/324] Fix Dracula name --- doc/help/configuring.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/help/configuring.asciidoc b/doc/help/configuring.asciidoc index e63117df4..362f1682e 100644 --- a/doc/help/configuring.asciidoc +++ b/doc/help/configuring.asciidoc @@ -395,7 +395,7 @@ Pre-built colorschemes - A collection of https://github.com/chriskempson/base16[base16] color-schemes can be found in https://github.com/theova/base16-qutebrowser[base16-qutebrowser] and used with https://github.com/AuditeMarlow/base16-manager[base16-manager]. - Two implementations of the https://github.com/arcticicestudio/nord[Nord] colorscheme for qutebrowser exist: https://github.com/Linuus/nord-qutebrowser[Linuus], https://github.com/KnownAsDon/QuteBrowser-Nord-Theme[KnownAsDon] -- https://github.com/evannagle/qutebrowser-dracula-theme[Darcula] +- https://github.com/evannagle/qutebrowser-dracula-theme[Dracula] Avoiding flake8 errors ^^^^^^^^^^^^^^^^^^^^^^ From c1d06c8abb93fc6c820434d28abe650b744ab655 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Aug 2018 09:55:49 +0200 Subject: [PATCH 196/324] Skip another test --- tests/end2end/features/scroll.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end/features/scroll.feature b/tests/end2end/features/scroll.feature index 2e0414037..56919ce11 100644 --- a/tests/end2end/features/scroll.feature +++ b/tests/end2end/features/scroll.feature @@ -145,7 +145,7 @@ Feature: Scrolling And I wait until the scroll position changed to 0/0 Then the page should not be scrolled - @flaky + @skip # Too flaky Scenario: Scrolling down with a very big count When I run :scroll down with count 99999999999 # Make sure it doesn't hang From 53b33014e4ef928cbb7e80896b09916127a9d49e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:11 +0200 Subject: [PATCH 197/324] Update astroid from 2.0.1 to 2.0.2 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index e78dfe2cc..73c87b9f1 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -astroid==2.0.1 +astroid==2.0.2 certifi==2018.4.16 chardet==3.0.4 github3.py==1.1.0 From 7c991d7c5fe86b1977202bf3f1de82b756067db5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:13 +0200 Subject: [PATCH 198/324] Update pylint from 2.0.1 to 2.1.1 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 73c87b9f1..116fd46d7 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -8,7 +8,7 @@ idna==2.7 isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 -pylint==2.0.1 +pylint==2.1.1 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.19.1 From c2322eddfde43f299d33dab815bace2f7328a74b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:14 +0200 Subject: [PATCH 199/324] Update cheroot from 6.3.3 to 6.4.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 8b2d61007..8e0d950f9 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -4,7 +4,7 @@ atomicwrites==1.1.5 attrs==18.1.0 backports.functools-lru-cache==1.5 beautifulsoup4==4.6.1 -cheroot==6.3.3 +cheroot==6.4.0 click==6.7 # colorama==0.3.9 coverage==4.5.1 From 985f0ff3f0478ff39782c40e9774058d84df6c0f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:16 +0200 Subject: [PATCH 200/324] Update hypothesis from 3.66.14 to 3.66.30 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 8e0d950f9..627e06bd7 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.66.14 +hypothesis==3.66.30 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 5efed1af4c6cd26ea14bc575e52d65b1efb80790 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:17 +0200 Subject: [PATCH 201/324] Update more-itertools from 4.2.0 to 4.3.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 627e06bd7..73e6dbb2b 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -18,7 +18,7 @@ itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 # MarkupSafe==1.0 -more-itertools==4.2.0 +more-itertools==4.3.0 parse==1.8.4 parse-type==0.4.2 pluggy==0.7.1 From 85b5edb02388e184d8d0879adecd37e6c79edfe1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:19 +0200 Subject: [PATCH 202/324] Update pytest from 3.6.4 to 3.7.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 73e6dbb2b..c10d17f6a 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.5.4 py-cpuinfo==4.0.0 -pytest==3.6.4 +pytest==3.7.1 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 From 6854781256aec39a9614f2fc84aafceca39c22ad Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:20 +0200 Subject: [PATCH 203/324] Update pytest-repeat from 0.5.0 to 0.6.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index c10d17f6a..177c6442c 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -32,7 +32,7 @@ pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 pytest-qt==3.0.0 -pytest-repeat==0.5.0 +pytest-repeat==0.6.0 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 pytest-xvfb==1.1.0 From c15277dd5a0df01cbfc1764f620112f53adf45e7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:22 +0200 Subject: [PATCH 204/324] Update vulture from 0.28 to 0.29 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 177c6442c..02cc07cb2 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -38,5 +38,5 @@ pytest-travis-fold==1.3.0 pytest-xvfb==1.1.0 PyVirtualDisplay==0.2.1 six==1.11.0 -vulture==0.28 +vulture==0.29 Werkzeug==0.14.1 From 36348f872aa0fa24d18a5c27ff3f72d271df28d7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:23 +0200 Subject: [PATCH 205/324] Update vulture from 0.28 to 0.29 --- misc/requirements/requirements-vulture.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-vulture.txt b/misc/requirements/requirements-vulture.txt index c8a26e83c..622527f5d 100644 --- a/misc/requirements/requirements-vulture.txt +++ b/misc/requirements/requirements-vulture.txt @@ -1,3 +1,3 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -vulture==0.28 +vulture==0.29 From aac0031ba7562d2eec9402d64e3cfce0b324c13e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Aug 2018 19:41:25 +0200 Subject: [PATCH 206/324] Update tox from 3.1.2 to 3.1.3 --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index 62a037934..bcec912e3 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -5,5 +5,5 @@ pluggy==0.7.1 py==1.5.4 pyparsing==2.2.0 six==1.11.0 -tox==3.1.2 +tox==3.1.3 virtualenv==16.0.0 From b617f1e03cb251b1d888d4f7c18304e3119916d2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Aug 2018 19:55:27 +0200 Subject: [PATCH 207/324] Remove old pylint disable comments --- qutebrowser/browser/webengine/webenginetab.py | 4 ++-- qutebrowser/config/configfiles.py | 2 +- qutebrowser/misc/miscwidgets.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 2ccb7d950..2c890b8a5 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1090,10 +1090,10 @@ class WebEngineTab(browsertab.AbstractTab): # percent encoded content is 2 megabytes minus 30 bytes. self._widget.setHtml(html, base_url) - def networkaccessmanager(self): # pylint: disable=useless-return + def networkaccessmanager(self): return None - def user_agent(self): # pylint: disable=useless-return + def user_agent(self): return None def clear_ssl_errors(self): diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index d0830dd72..a2c88d311 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -576,7 +576,7 @@ def read_autoconfig(): """Read the autoconfig.yml file.""" try: config.instance.read_yaml() - except configexc.ConfigFileErrors: # pylint: disable=try-except-raise + except configexc.ConfigFileErrors: raise # caught in outer block except configexc.Error as e: desc = configexc.ConfigErrorDesc("Error", e) diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index bc0afea24..eef127cf2 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -246,7 +246,7 @@ class WrapperLayout(QLayout): def sizeHint(self): return self._widget.sizeHint() - def itemAt(self, _index): # pylint: disable=useless-return + def itemAt(self, _index): return None def takeAt(self, _index): @@ -287,7 +287,7 @@ class PseudoLayout(QLayout): def count(self): return 0 - def itemAt(self, _pos): # pylint: disable=useless-return + def itemAt(self, _pos): return None def widget(self): From 70addc93b3c7c55bb2ca260d5efe0c3b6bee9c32 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Aug 2018 19:57:38 +0200 Subject: [PATCH 208/324] Add missing yaml_value fixture --- tests/unit/config/test_configcommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 343e7c8ca..77097d851 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -247,7 +247,7 @@ class TestCycle: commands.config_cycle(opt, '[foo]', '[bar]') assert config_stub.get(opt) == ['foo'] - def test_toggle(self, commands, config_stub): + def test_toggle(self, commands, config_stub, yaml_value): """Run ':config-cycle auto_save.session'. Should toggle the value. From 8dcc9963f761d061eb952eace91988302d7e92bb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Aug 2018 21:00:05 +0200 Subject: [PATCH 209/324] Update requirement files --- misc/requirements/requirements-pylint-master.txt | 1 - misc/requirements/requirements-pylint.txt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 2df073620..c27329fad 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -13,7 +13,6 @@ python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.19.1 six==1.11.0 -typed-ast==1.1.0 uritemplate==3.0.0 urllib3==1.23 wrapt==1.10.11 diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 116fd46d7..b41257dc8 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -14,6 +14,7 @@ python-dateutil==2.7.3 requests==2.19.1 six==1.11.0 typed-ast==1.1.0 +typing==3.6.4 uritemplate==3.0.0 urllib3==1.23 wrapt==1.10.11 From 1232edbb228ffc544aec8043b675c09a4a9ad4d9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Aug 2018 21:01:44 +0200 Subject: [PATCH 210/324] Downgrade to pytest 3.6.4 See https://github.com/pytest-dev/pytest-bdd/issues/250 --- misc/requirements/requirements-tests.txt | 2 +- misc/requirements/requirements-tests.txt-raw | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 02cc07cb2..de8db988e 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.5.4 py-cpuinfo==4.0.0 -pytest==3.7.1 +pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 diff --git a/misc/requirements/requirements-tests.txt-raw b/misc/requirements/requirements-tests.txt-raw index 121689980..d1109a418 100644 --- a/misc/requirements/requirements-tests.txt-raw +++ b/misc/requirements/requirements-tests.txt-raw @@ -4,7 +4,7 @@ coverage Flask hunter hypothesis -pytest +pytest<3.7 pytest-bdd pytest-benchmark pytest-cov @@ -19,3 +19,4 @@ pytest-xvfb vulture #@ ignore: Jinja2, MarkupSafe, colorama +#@ filter: pytest != 3.7, != 3.7.1 From 1cb547a8de9228be81db912857cc0a61116d8c05 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Aug 2018 16:26:41 +0200 Subject: [PATCH 211/324] Use exist_ok=True for os.path.makedirs See #2570 --- qutebrowser/browser/downloads.py | 9 ++------- qutebrowser/browser/urlmarks.py | 3 +-- qutebrowser/misc/lineparser.py | 3 +-- qutebrowser/utils/standarddir.py | 5 +---- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 2e30c26c2..396f5152c 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -79,10 +79,7 @@ def download_dir(): else: ddir = directory - try: - os.makedirs(ddir) - except FileExistsError: - pass + os.makedirs(ddir, exist_ok=True) return ddir @@ -692,9 +689,7 @@ class AbstractDownloadItem(QObject): global last_used_directory try: - os.makedirs(os.path.dirname(self._filename)) - except FileExistsError: - pass + os.makedirs(os.path.dirname(self._filename), exist_ok=True) except OSError as e: self._die(e.strerror) diff --git a/qutebrowser/browser/urlmarks.py b/qutebrowser/browser/urlmarks.py index 0a0dfb4f2..bb20e2166 100644 --- a/qutebrowser/browser/urlmarks.py +++ b/qutebrowser/browser/urlmarks.py @@ -240,8 +240,7 @@ class BookmarkManager(UrlMarkManager): def _init_lineparser(self): bookmarks_directory = os.path.join(standarddir.config(), 'bookmarks') - if not os.path.isdir(bookmarks_directory): - os.makedirs(bookmarks_directory) + os.makedirs(bookmarks_directory, exist_ok=True) bookmarks_subdir = os.path.join('bookmarks', 'urls') self._lineparser = lineparser.LineParser( diff --git a/qutebrowser/misc/lineparser.py b/qutebrowser/misc/lineparser.py index 6e50edb9b..e9fc67e18 100644 --- a/qutebrowser/misc/lineparser.py +++ b/qutebrowser/misc/lineparser.py @@ -72,8 +72,7 @@ class BaseLineParser(QObject): Return: True if the file should be saved, False otherwise. """ - if not os.path.exists(self._configdir): - os.makedirs(self._configdir, 0o755) + os.makedirs(self._configdir, 0o755, exist_ok=True) return True def _after_save(self): diff --git a/qutebrowser/utils/standarddir.py b/qutebrowser/utils/standarddir.py index 40f1fa966..95aa4d438 100644 --- a/qutebrowser/utils/standarddir.py +++ b/qutebrowser/utils/standarddir.py @@ -290,10 +290,7 @@ def _create(path): 0700. If the destination directory exists already the permissions should not be changed. """ - try: - os.makedirs(path, 0o700) - except FileExistsError: - pass + os.makedirs(path, 0o700, exist_ok=True) def _init_dirs(args=None): From 7ed71592e013ab2c7e7eaad92b832d12560c3798 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Aug 2018 16:40:46 +0200 Subject: [PATCH 212/324] Handle OSError when creating download directory Fixes #2570 --- qutebrowser/browser/downloads.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 396f5152c..854fd1ca5 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -79,7 +79,10 @@ def download_dir(): else: ddir = directory - os.makedirs(ddir, exist_ok=True) + try: + os.makedirs(ddir, exist_ok=True) + except OSError as e: + message.error("Failed to create download directory: {}".format(e)) return ddir From 4482c41ef78215a7c1df3aed42a1c22b1f59e4a9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Aug 2018 16:41:39 +0200 Subject: [PATCH 213/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 8b180cf2a..f01ffe811 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -39,6 +39,7 @@ Fixed (like i3). - Crash when opening URLs with some unicode characters (IDNA 2008). Those URLs still won't open though, due to missing support in Qt. +- Crash when a download directory which can't be created is configured. v1.4.1 ------ From 9eeaa4f45d9f7244bf13d11d84cc8fb0d1b45acb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Aug 2018 17:53:26 +0200 Subject: [PATCH 214/324] Fix lineparser tests --- tests/unit/misc/test_lineparser.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/unit/misc/test_lineparser.py b/tests/unit/misc/test_lineparser.py index c3624cc1d..10575e676 100644 --- a/tests/unit/misc/test_lineparser.py +++ b/tests/unit/misc/test_lineparser.py @@ -37,21 +37,11 @@ class TestBaseLineParser: """Fixture providing a BaseLineParser.""" return lineparsermod.BaseLineParser(self.CONFDIR, self.FILENAME) - def test_prepare_save_existing(self, mocker, lineparser): - """Test if _prepare_save does what it's supposed to do.""" - os_mock = mocker.patch('qutebrowser.misc.lineparser.os') - os_mock.path.exists.return_value = True - - lineparser._prepare_save() - assert not os_mock.makedirs.called - def test_prepare_save_missing(self, mocker, lineparser): """Test if _prepare_save does what it's supposed to do.""" os_mock = mocker.patch('qutebrowser.misc.lineparser.os') - os_mock.path.exists.return_value = False - lineparser._prepare_save() - os_mock.makedirs.assert_called_with(self.CONFDIR, 0o755) + os_mock.makedirs.assert_called_with(self.CONFDIR, 0o755, exist_ok=True) def test_double_open(self, mocker, lineparser): """Test if _open refuses reentry.""" From 790b34dc56342cfd21f4bd28736db1b2ca3f3a79 Mon Sep 17 00:00:00 2001 From: Jesko Date: Tue, 7 Aug 2018 21:59:15 +0200 Subject: [PATCH 215/324] Adding match pattern test esp. IPv6 --- tests/unit/utils/test_urlmatch.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index dcd703790..071a5fbe6 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -154,10 +154,14 @@ class TestMatchAllPagesForGivenScheme: @pytest.mark.parametrize('url, expected', [ ("http://google.com", True), + ("http://google.com:80", True), + ("http://google.com.", True), ("http://yahoo.com", True), ("http://google.com/foo", True), ("https://google.com", False), ("http://74.125.127.100/search", True), + ("http://[fc2e:0e35:bb88::edac]", True), + ("http://[::1]/bar", True), ]) def test_urls(self, up, url, expected): assert up.matches(QUrl(url)) == expected @@ -238,6 +242,7 @@ class TestMatchIpAddresses: @pytest.mark.parametrize('pattern, host, match_subdomains', [ ("http://127.0.0.1/*", "127.0.0.1", False), ("http://*.0.0.1/*", "0.0.1", True), + ("http://[::1]/*", "::1", False), ]) def test_attrs(self, pattern, host, match_subdomains): up = urlmatch.UrlPattern(pattern) @@ -255,7 +260,7 @@ class TestMatchIpAddresses: def test_urls(self, pattern, expected): up = urlmatch.UrlPattern(pattern) assert up.matches(QUrl("http://127.0.0.1")) == expected - + class TestMatchChromeUrls: From 8dcc6bc36078437ddf224dc964aca8ed6f488009 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Aug 2018 22:20:05 +0200 Subject: [PATCH 216/324] Fix contribution link - fixes #4117 --- doc/contributing.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index fa69bf256..031d63a22 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -93,7 +93,7 @@ git format-patch origin/master <1> Running qutebrowser ------------------- -After link:install.asciidoc#tox[installing qutebrowser via tox], you can run +After link:install.html#tox[installing qutebrowser via tox], you can run `.venv/bin/qutebrowser --debug --temp-basedir` to test your changes with debug logging enabled and without affecting existing running instances. From 599ac5ca233743caf65c8e898fc81aff318c407a Mon Sep 17 00:00:00 2001 From: Jesko Date: Tue, 7 Aug 2018 22:35:00 +0200 Subject: [PATCH 217/324] Adding parser tests for IPv4 --- tests/unit/utils/test_urlmatch.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index 071a5fbe6..16ab0acc9 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -84,6 +84,18 @@ from qutebrowser.utils import urlmatch # Additional tests ("http://[", "Invalid IPv6 URL"), + ("http://[fc2e::bb88::edac]:", "Invalid port: Port is empty"), + ("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"), + ("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"), + ("http://[127.0.0.1:fc2e::bb88:edac]", "Invalid IPv6 URL"), + ("http://[]:20", "Pattern without host"), + ("http://[fc2e::bb88", "Invalid IPv6 URL"), + ("http://[[fc2e::bb88:edac]", "Invalid IPv6 URL"), + ("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL"), + ("http://[fc2e:bb88:edac]", "Invalid IPv6 URL"), + ("http://[fc2e:bb88:edac::z]", "Invalid IPv6 URL"), + ("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"), + ]) def test_invalid_patterns(pattern, error): with pytest.raises(urlmatch.ParseError, match=re.escape(error)): @@ -161,6 +173,8 @@ class TestMatchAllPagesForGivenScheme: ("https://google.com", False), ("http://74.125.127.100/search", True), ("http://[fc2e:0e35:bb88::edac]", True), + ("http://[fc2e:e35:bb88::edac]", True), + ("http://[fc2e:e35:bb88::127.0.0.1]", True), ("http://[::1]/bar", True), ]) def test_urls(self, up, url, expected): @@ -260,7 +274,7 @@ class TestMatchIpAddresses: def test_urls(self, pattern, expected): up = urlmatch.UrlPattern(pattern) assert up.matches(QUrl("http://127.0.0.1")) == expected - + class TestMatchChromeUrls: From fcb3de8ee3a7580ff9887b909aff02d7d88f700c Mon Sep 17 00:00:00 2001 From: Jay Z Date: Tue, 7 Aug 2018 23:11:02 -0400 Subject: [PATCH 218/324] Fix chrome bookmarks import on `sync_transaction_version` --- scripts/importer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/importer.py b/scripts/importer.py index eb808a615..fd3e4ca0b 100755 --- a/scripts/importer.py +++ b/scripts/importer.py @@ -333,6 +333,8 @@ def import_chrome(profile, bookmark_types, output_format): def bm_tree_walk(bm, template): """Recursive function to walk through bookmarks.""" + if not isinstance(bm, dict): + return assert 'type' in bm, bm if bm['type'] == 'url': if urllib.parse.urlparse(bm['url']).scheme != 'chrome': From 20d29aab46567126b9d01549f3e4a79fedbbb192 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Aug 2018 08:44:27 +0200 Subject: [PATCH 219/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index f01ffe811..89ee0b44d 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -40,6 +40,7 @@ Fixed - Crash when opening URLs with some unicode characters (IDNA 2008). Those URLs still won't open though, due to missing support in Qt. - Crash when a download directory which can't be created is configured. +- Crash in the `importer.py` script when importing Chrome bookmarks from newer Chrome versions. v1.4.1 ------ From 831d3e404467d174929471270baf85b0dd7686ed Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Aug 2018 14:23:03 +0200 Subject: [PATCH 220/324] Add gD keybinding for :tab-give (detach a tab) --- doc/help/settings.asciidoc | 1 + misc/cheatsheet.svg | 12 +++++++----- qutebrowser/config/configdata.yml | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index dbb03ef0d..25236e208 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -562,6 +562,7 @@ Default: * +pass:[g0]+: +pass:[tab-focus 1]+ * +pass:[gB]+: +pass:[set-cmd-text -s :bookmark-load -t]+ * +pass:[gC]+: +pass:[tab-clone]+ +* +pass:[gD]+: +pass:[tab-give]+ * +pass:[gO]+: +pass:[set-cmd-text :open -t -r {url:pretty}]+ * +pass:[gU]+: +pass:[navigate up -t]+ * +pass:[g^]+: +pass:[tab-focus 1]+ diff --git a/misc/cheatsheet.svg b/misc/cheatsheet.svg index bb87142a4..e792489d4 100644 --- a/misc/cheatsheet.svg +++ b/misc/cheatsheet.svg @@ -13,7 +13,7 @@ height="682.66669" id="svg2" sodipodi:version="0.32" - inkscape:version="0.92.2 5c3e80d, 2017-08-06" + inkscape:version="0.92.2 2405546, 2018-03-11" version="1.0" sodipodi:docname="cheatsheet.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" @@ -33,7 +33,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.7536248" - inkscape:cx="430.72917" + inkscape:cx="613.20834" inkscape:cy="268.64059" inkscape:document-units="px" inkscape:current-layer="layer1" @@ -3085,7 +3085,9 @@ style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672" id="flowPara4056"> (to index/left/right)gC - clone tab  gC - clone tabgD - detach tab gf - view page sourcesf - save configss - set settingss - set setting (sl: temp)sl - set temp. settingsk - bind key: tab-pin : tab-mute + gD: tab-give q: record-macro "@": run-macro tsh: config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload From 4ce5d99b24313bc2fc635f1f9c9d4aaf3ea4b8a7 Mon Sep 17 00:00:00 2001 From: Jesko Date: Wed, 8 Aug 2018 16:55:43 +0200 Subject: [PATCH 221/324] match minimizes ipv6 urls --- qutebrowser/utils/urlmatch.py | 8 ++++++++ tests/unit/utils/test_urlmatch.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index 5d9afc13e..f8e06fb06 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -30,6 +30,7 @@ import fnmatch import urllib.parse from qutebrowser.utils import utils, qtutils +from PyQt5.QtCore import QUrl class ParseError(Exception): @@ -177,6 +178,13 @@ class UrlPattern: assert self._host is None return + if not utils.raises(ValueError, ipaddress.IPv6Address, parsed.netloc[1:-1]): + # Using QUrl parsing to minimize ipv6 addresses + url = QUrl() + url.setHost(parsed.hostname) + self._host = url.host() + return + # FIXME what about multiple dots? host_parts = parsed.hostname.rstrip('.').split('.') if host_parts[0] == '*': diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index 16ab0acc9..1dadc2cab 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -257,6 +257,9 @@ class TestMatchIpAddresses: ("http://127.0.0.1/*", "127.0.0.1", False), ("http://*.0.0.1/*", "0.0.1", True), ("http://[::1]/*", "::1", False), + ("http://[0::1]/*", "::1", False), + ("http://[::01]/*", "::1", False), + ("http://[0:0:0:0:20::1]/*", "::20:0:0:1", False), ]) def test_attrs(self, pattern, host, match_subdomains): up = urlmatch.UrlPattern(pattern) From 484a22f1119330367b194c086458b4f17dded244 Mon Sep 17 00:00:00 2001 From: Jesko Date: Wed, 8 Aug 2018 17:53:14 +0200 Subject: [PATCH 222/324] now declining more wrong ipv6 addresses and cleaning up code --- qutebrowser/utils/urlmatch.py | 9 ++++++--- tests/unit/utils/test_urlmatch.py | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index f8e06fb06..4b6b9aa83 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -29,9 +29,10 @@ import ipaddress import fnmatch import urllib.parse -from qutebrowser.utils import utils, qtutils from PyQt5.QtCore import QUrl +from qutebrowser.utils import utils, qtutils + class ParseError(Exception): @@ -178,10 +179,12 @@ class UrlPattern: assert self._host is None return - if not utils.raises(ValueError, ipaddress.IPv6Address, parsed.netloc[1:-1]): + if parsed.netloc.startswith('['): # Using QUrl parsing to minimize ipv6 addresses url = QUrl() - url.setHost(parsed.hostname) + url.setHost("[" + parsed.hostname + "]") + if url.host() == "": + raise ParseError("Invalid IPv6 URL"+parsed.hostname) self._host = url.host() return diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index 1dadc2cab..b8ab4ace1 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -84,7 +84,8 @@ from qutebrowser.utils import urlmatch # Additional tests ("http://[", "Invalid IPv6 URL"), - ("http://[fc2e::bb88::edac]:", "Invalid port: Port is empty"), + ("http://[fc2e:bb88::edac]:", "Invalid port: Port is empty"), + ("http://[fc2e::bb88::edac]", "Invalid IPv6 URL"), ("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"), ("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"), ("http://[127.0.0.1:fc2e::bb88:edac]", "Invalid IPv6 URL"), From 972b3ae960accff04888bfdcd079d250fd7a3e29 Mon Sep 17 00:00:00 2001 From: Jesko Date: Wed, 8 Aug 2018 18:30:12 +0200 Subject: [PATCH 223/324] changing suggested flaws --- qutebrowser/utils/urlmatch.py | 4 ++-- tests/unit/utils/test_urlmatch.py | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index 4b6b9aa83..49f6f80f1 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -183,8 +183,8 @@ class UrlPattern: # Using QUrl parsing to minimize ipv6 addresses url = QUrl() url.setHost("[" + parsed.hostname + "]") - if url.host() == "": - raise ParseError("Invalid IPv6 URL"+parsed.hostname) + if not url.isValid(): + raise ParseError(url.errorString()) self._host = url.host() return diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index b8ab4ace1..ea238303f 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -85,16 +85,17 @@ from qutebrowser.utils import urlmatch # Additional tests ("http://[", "Invalid IPv6 URL"), ("http://[fc2e:bb88::edac]:", "Invalid port: Port is empty"), - ("http://[fc2e::bb88::edac]", "Invalid IPv6 URL"), - ("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"), - ("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", "Invalid IPv6 URL"), - ("http://[127.0.0.1:fc2e::bb88:edac]", "Invalid IPv6 URL"), + ("http://[fc2e::bb88::edac]", """Invalid IPv6 address (character ':' not permitted); source was "[fc2e::bb88::edac]"; host = """""), + ("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]"; host = ""'), + ("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]"; host = ""'), + ("http://[127.0.0.1:fc2e::bb88:edac]", """Invalid IPv6 address (character '1' not permitted); source was "[127.0.0.1:fc2e::bb88:edac]"; host = """""), ("http://[]:20", "Pattern without host"), ("http://[fc2e::bb88", "Invalid IPv6 URL"), - ("http://[[fc2e::bb88:edac]", "Invalid IPv6 URL"), - ("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL"), - ("http://[fc2e:bb88:edac]", "Invalid IPv6 URL"), - ("http://[fc2e:bb88:edac::z]", "Invalid IPv6 URL"), + ("http://[[fc2e::bb88:edac]", """Invalid IPv6 address (character '[' not permitted); source was "[[fc2e::bb88:edac]"; host = """""), + pytest.param("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL", marks=pytest.mark.xfail( + reason="https://bugs.python.org/issue34360")), + ("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:bb88:edac]"; host = ""'), + ("http://[fc2e:bb88:edac::z]", """Invalid IPv6 address (character 'z' not permitted); source was "[fc2e:bb88:edac::z]"; host = """""), ("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"), ]) From e927fecbbc12053d2e64deddf4bc89e570f0dcc6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Aug 2018 20:48:33 +0200 Subject: [PATCH 224/324] Make content.webrtc_public_interfaces_only work on Qt 5.11 69abc9a1a1bb6334537b89b5dcf980c40d6b8cbf added the argument for Qt 5.9, but didn't add the QWebEngineSetting for Qt >= 5.11. See #3010, #2163. --- doc/changelog.asciidoc | 2 ++ qutebrowser/browser/webengine/webenginesettings.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 89ee0b44d..e3950563a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -41,6 +41,8 @@ Fixed still won't open though, due to missing support in Qt. - Crash when a download directory which can't be created is configured. - Crash in the `importer.py` script when importing Chrome bookmarks from newer Chrome versions. +- The `content.webrtc_public_interfaces_only` option didn't work on Qt 5.11 previously (it now does). + Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2. v1.4.1 ------ diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py index da569eef6..77f82526a 100644 --- a/qutebrowser/browser/webengine/webenginesettings.py +++ b/qutebrowser/browser/webengine/webenginesettings.py @@ -166,6 +166,8 @@ class WebEngineSettings(websettings.AbstractSettings): # Qt 5.11 'content.autoplay': ('PlaybackRequiresUserGesture', lambda val: not val), + 'content.webrtc_public_interfaces_only': + ('WebRTCPublicInterfacesOnly', None), } for name, (attribute, converter) in new_attributes.items(): try: From e6122b9a5ec74972ef5ed106f69803544d1fd686 Mon Sep 17 00:00:00 2001 From: Slackhead <1039402+slackhead@users.noreply.github.com> Date: Thu, 9 Aug 2018 18:46:01 +0100 Subject: [PATCH 225/324] Add slackware installation instructions --- doc/install.asciidoc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/install.asciidoc b/doc/install.asciidoc index f5fccb32e..d9d8be2cc 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -222,6 +222,38 @@ There are prebuilt RPMs available at https://software.opensuse.org/download.html To use the QtWebEngine backend, install `libqt5-qtwebengine`. +On Slackware +------------ + +qutebrowser is available in the 3rd party repository at http://slackbuilds.org[slackbuilds.org] + +An easy way to install it is with sbopkg (frontend for slackbuilds.org) available at http://sbopkg.org[sbopkg.org] + +sbopkg can be run with a dialog screen interface, or via command line options. + +After installing the latest sbopkg package, choose your release version, and sync the repo. + +---- +sbopkg -V 14.2 +sbopkg -r +---- + +The pyPEG2 and MarkupSafe dependencies both need building for python3. You can either set PYTHON3=yes in the shell or set those as options in the dialog menu for each. + +Generate a queue file for qutebrowser and dependencies: + +---- +sqg -p qutebrowser +---- + +Then load the queue in the dialog queue menu or via: + +---- +PYTHON3=yes sbopkg -b qutebrowser +---- + +If you use the dialog screen you can deselect any already-installed packages that you don't need/want to rebuild before starting the build process. + On OpenBSD ---------- From 62d217389ec2ac9a95a3a245f73a98d6647d0225 Mon Sep 17 00:00:00 2001 From: Slackhead <1039402+slackhead@users.noreply.github.com> Date: Thu, 9 Aug 2018 18:52:15 +0100 Subject: [PATCH 226/324] Change -b to -i --- doc/install.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install.asciidoc b/doc/install.asciidoc index d9d8be2cc..c8b6c2248 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -249,7 +249,7 @@ sqg -p qutebrowser Then load the queue in the dialog queue menu or via: ---- -PYTHON3=yes sbopkg -b qutebrowser +PYTHON3=yes sbopkg -i qutebrowser ---- If you use the dialog screen you can deselect any already-installed packages that you don't need/want to rebuild before starting the build process. From 649fc08ccc07ef93838e501aa068699eea0168bb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jul 2018 16:01:25 +0200 Subject: [PATCH 227/324] Allow PyQt 5.10 to fail on Travis See #4055 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6141b2ab7..bb11e0c3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,6 +69,10 @@ matrix: env: TESTENV=shellcheck services: docker fast_finish: true + allow_failures: + # https://github.com/qutebrowser/qutebrowser/issues/4055 + - os: linux + env: TESTENV=py36-pyqt510 cache: directories: From 57d3ed95f22c8b6752a9bc9e807611ed3c4ff1d4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 10 Aug 2018 08:40:24 +0200 Subject: [PATCH 228/324] Mark another test as flaky --- tests/end2end/features/scroll.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/end2end/features/scroll.feature b/tests/end2end/features/scroll.feature index 56919ce11..09c4cfa51 100644 --- a/tests/end2end/features/scroll.feature +++ b/tests/end2end/features/scroll.feature @@ -253,6 +253,7 @@ Feature: Scrolling When I run :scroll-page 0 1.5 Then the page should be scrolled vertically + @flaky Scenario: Scrolling down and up with :scroll-page When I run :scroll-page 0 1 And I wait until the scroll position changed From 0b514373466eec79bb3ff0ef08ffc0ecd9d85849 Mon Sep 17 00:00:00 2001 From: Jesko Date: Fri, 10 Aug 2018 19:05:15 +0200 Subject: [PATCH 229/324] fixing indentation --- tests/unit/utils/test_urlmatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index ea238303f..af1e9eed8 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -92,7 +92,7 @@ from qutebrowser.utils import urlmatch ("http://[]:20", "Pattern without host"), ("http://[fc2e::bb88", "Invalid IPv6 URL"), ("http://[[fc2e::bb88:edac]", """Invalid IPv6 address (character '[' not permitted); source was "[[fc2e::bb88:edac]"; host = """""), - pytest.param("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL", marks=pytest.mark.xfail( + pytest.param("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL", marks=pytest.mark.xfail( reason="https://bugs.python.org/issue34360")), ("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:bb88:edac]"; host = ""'), ("http://[fc2e:bb88:edac::z]", """Invalid IPv6 address (character 'z' not permitted); source was "[fc2e:bb88:edac::z]"; host = """""), From b74b069153e5d54acec2659368a1f5e69c164ace Mon Sep 17 00:00:00 2001 From: Jesko Date: Fri, 10 Aug 2018 19:14:48 +0200 Subject: [PATCH 230/324] removing useless brackets --- qutebrowser/utils/urlmatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index 49f6f80f1..02db96e33 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -182,7 +182,7 @@ class UrlPattern: if parsed.netloc.startswith('['): # Using QUrl parsing to minimize ipv6 addresses url = QUrl() - url.setHost("[" + parsed.hostname + "]") + url.setHost(parsed.hostname) if not url.isValid(): raise ParseError(url.errorString()) self._host = url.host() From a676cca6c5aeae5810c4d3f8b360a7e0dfd5ee39 Mon Sep 17 00:00:00 2001 From: Jesko Date: Fri, 10 Aug 2018 20:49:20 +0200 Subject: [PATCH 231/324] changing the texts of the errors --- qutebrowser/config/configdata.py | 2 +- qutebrowser/config/configdata.yml | 8 ++++++++ tests/unit/utils/test_urlmatch.py | 17 ++++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index da3025319..dace0772a 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -56,7 +56,7 @@ class Option: @attr.s class Migrations: - """Nigrated options in configdata.yml. + """Migrated options in configdata.yml. Attributes: renamed: A dict mapping old option names to new names. diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index e57459f64..6131be6ba 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1622,6 +1622,14 @@ url.yank_ignored_parameters: - utm_content desc: URL parameters to strip with `:yank url`. +url.yank_remove_password: + type: Bool + default: true + desc: | + Remove the password with `:yank url`. + + E.g. + ## window window.hide_wayland_decoration: diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index af1e9eed8..b77588469 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -85,17 +85,16 @@ from qutebrowser.utils import urlmatch # Additional tests ("http://[", "Invalid IPv6 URL"), ("http://[fc2e:bb88::edac]:", "Invalid port: Port is empty"), - ("http://[fc2e::bb88::edac]", """Invalid IPv6 address (character ':' not permitted); source was "[fc2e::bb88::edac]"; host = """""), - ("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]"; host = ""'), - ("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]"; host = ""'), - ("http://[127.0.0.1:fc2e::bb88:edac]", """Invalid IPv6 address (character '1' not permitted); source was "[127.0.0.1:fc2e::bb88:edac]"; host = """""), + ("http://[fc2e::bb88::edac]", 'Invalid IPv6 address; source was "fc2e::bb88::edac"; host = ""'), + ("http://[fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:0e35:bb88::edac:fc2e:0e35:bb88:edac"; host = ""'), + ("http://[fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:0e35:bb88:af:edac:fc2e:0e35:bb88:edac"; host = ""'), + ("http://[127.0.0.1:fc2e::bb88:edac]", 'Invalid IPv6 address; source was "127.0.0.1:fc2e::bb88:edac'), ("http://[]:20", "Pattern without host"), ("http://[fc2e::bb88", "Invalid IPv6 URL"), - ("http://[[fc2e::bb88:edac]", """Invalid IPv6 address (character '[' not permitted); source was "[[fc2e::bb88:edac]"; host = """""), - pytest.param("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL", marks=pytest.mark.xfail( - reason="https://bugs.python.org/issue34360")), - ("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "[fc2e:bb88:edac]"; host = ""'), - ("http://[fc2e:bb88:edac::z]", """Invalid IPv6 address (character 'z' not permitted); source was "[fc2e:bb88:edac::z]"; host = """""), + ("http://[[fc2e::bb88:edac]", """Expected ']' to match '[' in hostname; source was "[fc2e::bb88:edac"; host = """""), + pytest.param("http://[fc2e::bb88:edac]]", "Invalid IPv6 URL", marks=pytest.mark.xfail(reason="https://bugs.python.org/issue34360")), + ("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:bb88:edac"; host = ""'), + ("http://[fc2e:bb88:edac::z]", 'Invalid IPv6 address; source was "fc2e:bb88:edac::z"; host = ""'), ("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"), ]) From 961fa07fb016bf67edb4fc09b6fa037478e477b4 Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sat, 11 Aug 2018 17:59:45 +0200 Subject: [PATCH 232/324] Core functionality --- qutebrowser/misc/utilcmds.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 702c62cac..99ccc8ecf 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -74,13 +74,20 @@ def later(ms: int, command, win_id): @cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True) @cmdutils.argument('win_id', win_id=True) -def repeat(times: int, command, win_id): +@cmdutils.argument('count', count=True) +@cmdutils.argument('mulcount', flag='c') +def repeat(times: int, command, win_id, count=None, mulcount=False): """Repeat a given command. Args: times: How many times to repeat. command: The command to run, with optional args. + mulcount: Multiply 'times' with [count]. """ + + if mulcount and count is not None: + times *= count + if times < 0: raise cmdexc.CommandError("A negative count doesn't make sense.") commandrunner = runners.CommandRunner(win_id) From b085a8a7de3e05c592e3c706a090d750783f561c Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sat, 11 Aug 2018 18:18:39 +0200 Subject: [PATCH 233/324] Update documentation --- doc/help/commands.asciidoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 3d60cce64..fef4c07f6 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -910,7 +910,7 @@ The tab index to reload. [[repeat]] === repeat -Syntax: +:repeat 'times' 'command'+ +Syntax: +:repeat [*--mulcount*] 'times' 'command'+ Repeat a given command. @@ -918,6 +918,9 @@ Repeat a given command. * +'times'+: How many times to repeat. * +'command'+: The command to run, with optional args. +==== optional arguments +* +*-c*+, +*--mulcount*+: When given, 'times' will be multiplied with [count]. + ==== note * This command does not split arguments after the last argument and handles quotes literally. * With this command, +;;+ is interpreted literally instead of splitting off a second command. From f27195d3601ea3b249f2a056a1d4163dc4ff5004 Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sat, 11 Aug 2018 18:31:17 +0200 Subject: [PATCH 234/324] Have 'times' multiply with [count] by default --- doc/help/commands.asciidoc | 6 +++--- qutebrowser/misc/utilcmds.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index fef4c07f6..06f5da6c6 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -910,7 +910,7 @@ The tab index to reload. [[repeat]] === repeat -Syntax: +:repeat [*--mulcount*] 'times' 'command'+ +Syntax: +:repeat 'times' 'command'+ Repeat a given command. @@ -918,8 +918,8 @@ Repeat a given command. * +'times'+: How many times to repeat. * +'command'+: The command to run, with optional args. -==== optional arguments -* +*-c*+, +*--mulcount*+: When given, 'times' will be multiplied with [count]. +==== count +Multiplies with 'times' when given ==== note * This command does not split arguments after the last argument and handles quotes literally. diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 99ccc8ecf..e867dd0b8 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -75,17 +75,15 @@ def later(ms: int, command, win_id): @cmdutils.register(maxsplit=1, no_cmd_split=True, no_replace_variables=True) @cmdutils.argument('win_id', win_id=True) @cmdutils.argument('count', count=True) -@cmdutils.argument('mulcount', flag='c') -def repeat(times: int, command, win_id, count=None, mulcount=False): +def repeat(times: int, command, win_id, count=None): """Repeat a given command. Args: times: How many times to repeat. command: The command to run, with optional args. - mulcount: Multiply 'times' with [count]. """ - if mulcount and count is not None: + if count is not None: times *= count if times < 0: From adb371f305348a2cede447b354ea5ebd7cb8257d Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sat, 11 Aug 2018 19:04:18 +0200 Subject: [PATCH 235/324] Add test --- tests/end2end/features/utilcmds.feature | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index 5ccbac9b3..fc397f506 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -41,6 +41,15 @@ Feature: Miscellaneous utility commands exposed to the user. # If we have an error, the test will fail Then no crash should happen + Scenario: :repeat with count + When I run :run-with-count 2 repeat 3 message-info "repeat-test 3" + Then the message "repeat-test 3" should be shown + And the message "repeat-test 3" should be shown + And the message "repeat-test 3" should be shown + And the message "repeat-test 3" should be shown + And the message "repeat-test 3" should be shown + And the message "repeat-test 3" should be shown + ## :run-with-count Scenario: :run-with-count From 8e2307c546fa774cc593949065940951f7cf6530 Mon Sep 17 00:00:00 2001 From: farlusiva Date: Sat, 11 Aug 2018 19:32:41 +0200 Subject: [PATCH 236/324] Docstring things, change test - Update the docstring for repeat - Remove the blank line after the docstring - Update the docstring with scripts/dev/src2asciidoc.py - Simplify the test --- doc/help/commands.asciidoc | 2 +- qutebrowser/misc/utilcmds.py | 2 +- tests/end2end/features/utilcmds.feature | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 06f5da6c6..6daff3bcc 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -919,7 +919,7 @@ Repeat a given command. * +'command'+: The command to run, with optional args. ==== count -Multiplies with 'times' when given +Multiplies with 'times' when given. ==== note * This command does not split arguments after the last argument and handles quotes literally. diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index e867dd0b8..d108a56ac 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -81,8 +81,8 @@ def repeat(times: int, command, win_id, count=None): Args: times: How many times to repeat. command: The command to run, with optional args. + count: Multiplies with 'times' when given. """ - if count is not None: times *= count diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index fc397f506..fac335813 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -42,7 +42,7 @@ Feature: Miscellaneous utility commands exposed to the user. Then no crash should happen Scenario: :repeat with count - When I run :run-with-count 2 repeat 3 message-info "repeat-test 3" + When I run :repeat 3 message-info "repeat-test 3" with count 2 Then the message "repeat-test 3" should be shown And the message "repeat-test 3" should be shown And the message "repeat-test 3" should be shown From 0d785334808baa40a2849912470cbb8d3513ab83 Mon Sep 17 00:00:00 2001 From: Jesko Date: Sat, 11 Aug 2018 19:43:11 +0200 Subject: [PATCH 237/324] remove useless config option --- qutebrowser/config/configdata.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 6131be6ba..e57459f64 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1622,14 +1622,6 @@ url.yank_ignored_parameters: - utm_content desc: URL parameters to strip with `:yank url`. -url.yank_remove_password: - type: Bool - default: true - desc: | - Remove the password with `:yank url`. - - E.g. - ## window window.hide_wayland_decoration: From 2a1afd5255f84a498b7d24cb5a9fc4f8475113e7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 11 Aug 2018 22:18:52 +0200 Subject: [PATCH 238/324] Add more detailed info to _chromium_version docs --- qutebrowser/utils/version.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 3b72ee71f..b09c0ea7f 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -313,12 +313,29 @@ def _chromium_version(): http://code.qt.io/cgit/qt/qtwebengine.git/tree/tools/scripts/version_resolver.py#n41 Quick reference: + Qt 5.7: Chromium 49 + 49.0.2623.111 (2016-03-02) + 5.7.1: Security fixes up to 54.0.2840.87 (2016-10-19) + Qt 5.8: Chromium 53 + 53.0.2785.148 (2016-08-31) + 5.8.0: Security fixes up to 55.0.2883.75 (2016-12-01) + Qt 5.9: Chromium 56 + (LTS) 56.0.2924.122 (2017-01-25) + 5.9.6: Security fixes up to 66.0.3359.170 (2018-04-17) + Qt 5.10: Chromium 61 + 61.0.3163.140 (2017-09-05) + 5.10.1: Security fixes up to 64.0.3282.140 (2018-01-24) + Qt 5.11: Chromium 65 - Qt 5.12: Chromium 69 (? - current dev branch: 67) + 65.0.3325.151 (.1: .230) (2018-03-06) + 5.11.1: Security fixes up to 67.0.3396.87 (2018-05-29) + + Qt 5.12: Chromium 69 (?) + current dev branch: 67.0.3396.76 (2018-05-29) Also see https://www.chromium.org/developers/calendar """ From bddc021295ebf10e193ef34ef723376fedb77880 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 12 Aug 2018 20:24:31 +0200 Subject: [PATCH 239/324] Mark more :follow-selected tests as flaky --- tests/end2end/features/caret.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/end2end/features/caret.feature b/tests/end2end/features/caret.feature index a6fd671bf..6d2245a89 100644 --- a/tests/end2end/features/caret.feature +++ b/tests/end2end/features/caret.feature @@ -330,6 +330,7 @@ Feature: Caret mode And I run :follow-selected Then data/hello.txt should be loaded + @flaky Scenario: :follow-selected with link tabbing (with JS) When I set content.javascript.enabled to true And I run :leave-mode @@ -338,6 +339,7 @@ Feature: Caret mode And I run :follow-selected Then data/hello.txt should be loaded + @flaky Scenario: :follow-selected with link tabbing in a tab (without JS) When I set content.javascript.enabled to false And I run :leave-mode From 8e6f79755d9aabcaef748742365e9cc03221b08a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 12 Aug 2018 20:25:23 +0200 Subject: [PATCH 240/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index e3950563a..e66297f95 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -28,6 +28,8 @@ Changed - The `content.xss_auditing` setting is now enabled by default, to mirror Chromium's rather than Qt's default behavior. +- The `:repeat` command now takes a count which is multiplied with the given + "times" argument. Fixed ~~~~~ From 359eefe1ab5f3d10a12fb19980459cc4aa42ef08 Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sun, 12 Aug 2018 21:21:01 +0200 Subject: [PATCH 241/324] Expose $QUTE_COUNT to userscripts --- doc/help/commands.asciidoc | 3 +++ qutebrowser/browser/commands.py | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 6daff3bcc..04cf5f318 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -1200,6 +1200,9 @@ Spawn a command in a shell. * +*-o*+, +*--output*+: Whether the output should be shown in a new tab. * +*-d*+, +*--detach*+: Whether the command should be detached from qutebrowser. +==== count +Given to userscripts as $QUTE_COUNT. + ==== note * This command does not split arguments after the last argument and handles quotes literally. diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 6578e4bb7..5c0e41e77 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1173,8 +1173,9 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', scope='window', maxsplit=0, no_replace_variables=True) + @cmdutils.argument('count', count=True) def spawn(self, cmdline, userscript=False, verbose=False, - output=False, detach=False): + output=False, detach=False, count=None): """Spawn a command in a shell. Args: @@ -1188,6 +1189,7 @@ class CommandDispatcher: output: Whether the output should be shown in a new tab. detach: Whether the command should be detached from qutebrowser. cmdline: The commandline to execute. + count: Given to userscripts as $QUTE_COUNT. """ cmdutils.check_exclusive((userscript, detach), 'ud') try: @@ -1211,7 +1213,7 @@ class CommandDispatcher: if userscript: def _selection_callback(s): try: - runner = self._run_userscript(s, cmd, args, verbose) + runner = self._run_userscript(s, cmd, args, verbose, count) runner.finished.connect(_on_proc_finished) except cmdexc.CommandError as e: message.error(str(e)) @@ -1238,17 +1240,19 @@ class CommandDispatcher: """Open main startpage in current tab.""" self.openurl(config.val.url.start_pages[0]) - def _run_userscript(self, selection, cmd, args, verbose): + def _run_userscript(self, selection, cmd, args, verbose, count): """Run a userscript given as argument. Args: cmd: The userscript to run. args: Arguments to pass to the userscript. verbose: Show notifications when the command started/exited. + count: Exposed to the userscript. """ env = { 'QUTE_MODE': 'command', 'QUTE_SELECTED_TEXT': selection, + 'QUTE_COUNT': str(count), # must be a string } idx = self._current_index() From a9725ddb4a351df205177a76dbc9de501ce4ad19 Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sun, 12 Aug 2018 22:31:12 +0200 Subject: [PATCH 242/324] Add tests for $QUTE_COUNT --- tests/end2end/data/userscripts/hello_if_count | 11 +++++++++++ tests/end2end/features/spawn.feature | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100755 tests/end2end/data/userscripts/hello_if_count diff --git a/tests/end2end/data/userscripts/hello_if_count b/tests/end2end/data/userscripts/hello_if_count new file mode 100755 index 000000000..7ba64a76e --- /dev/null +++ b/tests/end2end/data/userscripts/hello_if_count @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ "$QUTE_COUNT" = "5" ]; then + + echo "message-info 'Count is five!'" >> "$QUTE_FIFO" + +elif [ "$QUTE_COUNT" = "None" ]; then + + echo "message-info 'No count!'" >> "$QUTE_FIFO" + +fi diff --git a/tests/end2end/features/spawn.feature b/tests/end2end/features/spawn.feature index 2a1ea0039..87ffb53e0 100644 --- a/tests/end2end/features/spawn.feature +++ b/tests/end2end/features/spawn.feature @@ -47,6 +47,17 @@ Feature: :spawn - data/hello.txt - data/hello.txt (active) + @posix + Scenario: Running :spawn with userscript and count + When I run :spawn -u (testdata)/userscripts/hello_if_count with count 5 + Then the message "Count is five!" should be shown + + @posix + Scenario: Running :spawn with userscript and no count + When I run :spawn -u (testdata)/userscripts/hello_if_count + Then the message "No count!" should be shown + + @windows Scenario: Running :spawn with userscript on Windows When I open data/hello.txt From b05738dd6ce7aee36df057f90ba9d792037eb45e Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sun, 12 Aug 2018 22:39:32 +0200 Subject: [PATCH 243/324] Keep $QUTE_COUNT unset if a count is not given --- qutebrowser/browser/commands.py | 4 +++- tests/end2end/data/userscripts/hello_if_count | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 5c0e41e77..448741f9f 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1252,9 +1252,11 @@ class CommandDispatcher: env = { 'QUTE_MODE': 'command', 'QUTE_SELECTED_TEXT': selection, - 'QUTE_COUNT': str(count), # must be a string } + if count is not None: + env['QUTE_COUNT'] = str(count) # must be str + idx = self._current_index() if idx != -1: env['QUTE_TITLE'] = self._tabbed_browser.widget.page_title(idx) diff --git a/tests/end2end/data/userscripts/hello_if_count b/tests/end2end/data/userscripts/hello_if_count index 7ba64a76e..efc8bdd6e 100755 --- a/tests/end2end/data/userscripts/hello_if_count +++ b/tests/end2end/data/userscripts/hello_if_count @@ -4,7 +4,7 @@ if [ "$QUTE_COUNT" = "5" ]; then echo "message-info 'Count is five!'" >> "$QUTE_FIFO" -elif [ "$QUTE_COUNT" = "None" ]; then +elif [ -z "$QUTE_COUNT" ]; then echo "message-info 'No count!'" >> "$QUTE_FIFO" From 6d59c1b7a5a9098797df88745eaf01df73b9e206 Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sun, 12 Aug 2018 22:44:51 +0200 Subject: [PATCH 244/324] Update doc/userscripts.asciidoc --- doc/userscripts.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/userscripts.asciidoc b/doc/userscripts.asciidoc index c2f35b026..ac0fe9bb3 100644 --- a/doc/userscripts.asciidoc +++ b/doc/userscripts.asciidoc @@ -45,6 +45,7 @@ In `command` mode: - `QUTE_URL`: The current URL. - `QUTE_TITLE`: The title of the current page. - `QUTE_SELECTED_TEXT`: The text currently selected on the page. +- `QUTE_COUNT`: The `count` from the spawn command running the userscript. In `hints` mode: From b11e26adbdaad19154358b9c1ca7375ccc231e90 Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Mon, 13 Aug 2018 07:22:14 +0200 Subject: [PATCH 245/324] Fix dwb urls in faq --- doc/faq.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 4f9815cf2..618d7801c 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -8,7 +8,7 @@ What is qutebrowser based on?:: qutebrowser uses http://www.python.org/[Python], http://qt.io/[Qt] and http://www.riverbankcomputing.com/software/pyqt/intro[PyQt]. + -The concept of it is largely inspired by http://portix.bitbucket.org/dwb/[dwb] +The concept of it is largely inspired by https://bitbucket.org/portix/dwb/[dwb] and http://www.vimperator.org/vimperator[Vimperator]. Many actions and key bindings are similar to dwb. @@ -21,7 +21,7 @@ Why another browser?:: Read the next few questions to find out why I was unhappy with existing software. -What's wrong with link:http://portix.bitbucket.org/dwb/[dwb]/link:http://sourceforge.net/projects/vimprobable/[vimprobable]/link:https://mason-larobina.github.io/luakit/[luakit]/link:http://pwmt.org/projects/jumanji/[jumanji]/... (projects based on WebKitGTK)?:: +What's wrong with link:https://bitbucket.org/portix/dwb/[dwb]/link:http://sourceforge.net/projects/vimprobable/[vimprobable]/link:https://mason-larobina.github.io/luakit/[luakit]/link:http://pwmt.org/projects/jumanji/[jumanji]/... (projects based on WebKitGTK)?:: Most of them are based on the http://webkitgtk.org/[WebKitGTK+] http://webkitgtk.org/reference/webkitgtk/stable/index.html[WebKit1] API, which causes a lot of crashes. As the GTK API using WebKit1 is From 0e3e41a5e84b28764db393c3a202fd2109242e3b Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Mon, 13 Aug 2018 07:50:54 +0200 Subject: [PATCH 246/324] Handle nitpicks --- qutebrowser/browser/commands.py | 2 +- tests/end2end/data/userscripts/hello_if_count | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 448741f9f..d5e1797ac 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1255,7 +1255,7 @@ class CommandDispatcher: } if count is not None: - env['QUTE_COUNT'] = str(count) # must be str + env['QUTE_COUNT'] = str(count) idx = self._current_index() if idx != -1: diff --git a/tests/end2end/data/userscripts/hello_if_count b/tests/end2end/data/userscripts/hello_if_count index efc8bdd6e..b9f07b86f 100755 --- a/tests/end2end/data/userscripts/hello_if_count +++ b/tests/end2end/data/userscripts/hello_if_count @@ -1,6 +1,6 @@ #!/bin/bash -if [ "$QUTE_COUNT" = "5" ]; then +if [ "$QUTE_COUNT" -eq 5 ]; then echo "message-info 'Count is five!'" >> "$QUTE_FIFO" From 92a856309028d28973576c84e6b415a6c2f34adb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 13 Aug 2018 09:21:21 +0200 Subject: [PATCH 247/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index e66297f95..6cbcbfc15 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -22,6 +22,8 @@ Added ~~~~~ - The qute-pass userscript now has optional OTP support. +- When `:spawn --userscript` is called with a count, that count is now + passed to userscripts as `$QUTE_COUNT`. Changed ~~~~~~~ From 2bde2dcbf0abfc1bba082cb243d0e7a8bce78d18 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:14 +0200 Subject: [PATCH 248/324] Update certifi from 2018.4.16 to 2018.8.13 --- misc/requirements/requirements-codecov.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-codecov.txt b/misc/requirements/requirements-codecov.txt index 9fed7b300..8438d8d6d 100644 --- a/misc/requirements/requirements-codecov.txt +++ b/misc/requirements/requirements-codecov.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -certifi==2018.4.16 +certifi==2018.8.13 chardet==3.0.4 codecov==2.0.15 coverage==4.5.1 From 564633b805002f44a92aba725fd7dffb18660335 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:15 +0200 Subject: [PATCH 249/324] Update certifi from 2018.4.16 to 2018.8.13 --- misc/requirements/requirements-pylint-master.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index c27329fad..2354aa7af 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -e git+https://github.com/PyCQA/astroid.git#egg=astroid -certifi==2018.4.16 +certifi==2018.8.13 chardet==3.0.4 github3.py==1.1.0 idna==2.7 From 60fa40f30b5a88fbc840b5050de2ba8146cf8ac6 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:17 +0200 Subject: [PATCH 250/324] Update certifi from 2018.4.16 to 2018.8.13 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index b41257dc8..a69078efc 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py astroid==2.0.2 -certifi==2018.4.16 +certifi==2018.8.13 chardet==3.0.4 github3.py==1.1.0 idna==2.7 From c665cfbedf242a5f439e2e6b70e0966f493ba56b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:18 +0200 Subject: [PATCH 251/324] Update pefile from 2017.11.5 to 2018.8.8 --- misc/requirements/requirements-pyinstaller.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index 5af5bcc2e..8882ead87 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -3,5 +3,5 @@ altgraph==0.16.1 future==0.16.0 macholib==1.10 -pefile==2017.11.5 +pefile==2018.8.8 PyInstaller==3.3.1 From ba64ea4e0448b57bda9ffd5c79de9d8aa03ce40f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:20 +0200 Subject: [PATCH 252/324] Update astroid from 2.0.2 to 2.0.4 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index a69078efc..d28cba076 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -astroid==2.0.2 +astroid==2.0.4 certifi==2018.8.13 chardet==3.0.4 github3.py==1.1.0 From 6a9f9c3fc0f236f1e874cade6211b2ece4b6ba96 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:21 +0200 Subject: [PATCH 253/324] Update beautifulsoup4 from 4.6.1 to 4.6.3 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index de8db988e..db7b4afc2 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -3,7 +3,7 @@ atomicwrites==1.1.5 attrs==18.1.0 backports.functools-lru-cache==1.5 -beautifulsoup4==4.6.1 +beautifulsoup4==4.6.3 cheroot==6.4.0 click==6.7 # colorama==0.3.9 From 3cdc9ed4ea32b5e23c21175ffeb124fc8b19aa93 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:23 +0200 Subject: [PATCH 254/324] Update hypothesis from 3.66.30 to 3.67.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index db7b4afc2..21de250eb 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.66.30 +hypothesis==3.67.0 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From fb4a0eed301878afb87d160e4eabd5ab674d733f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 Aug 2018 19:44:24 +0200 Subject: [PATCH 255/324] Update tox from 3.1.3 to 3.2.1 --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index bcec912e3..88dd1191d 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -5,5 +5,5 @@ pluggy==0.7.1 py==1.5.4 pyparsing==2.2.0 six==1.11.0 -tox==3.1.3 +tox==3.2.1 virtualenv==16.0.0 From 364b808743c1190f4da94568920e4bf93c803a67 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 15 Aug 2018 10:53:09 +0200 Subject: [PATCH 256/324] Update changelog for v1.4.2 --- doc/changelog.asciidoc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 6cbcbfc15..5da1689a1 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -28,11 +28,18 @@ Added Changed ~~~~~~~ -- The `content.xss_auditing` setting is now enabled by default, to mirror - Chromium's rather than Qt's default behavior. - The `:repeat` command now takes a count which is multiplied with the given "times" argument. +v1.4.2 (unreleased) +------------------- + +Changed +~~~~~~~ + +- The `content.xss_auditing` setting is now enabled by default, to mirror + Chromium's rather than Qt's default behavior. + Fixed ~~~~~ From de8fd25f435192aa087ba05f5076431c3f6563a6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 15 Aug 2018 18:34:26 +0200 Subject: [PATCH 257/324] Change key to leave passthrough mode to Shift-Escape We changed this a while ago in a2f62238f1134e0befcd03d84c131ec0dbc30151 already, but Ctrl-V was kind of cumbersome as well, as it conflicted with pasting. Shift-Escape is closer to the default leave-mode binding (Escape), and also unlikely to conflict as it's used for the task manager in Chrome. --- doc/changelog.asciidoc | 3 +++ doc/help/settings.asciidoc | 2 +- qutebrowser/config/configdata.yml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 5da1689a1..0d6081b8a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -30,6 +30,9 @@ Changed - The `:repeat` command now takes a count which is multiplied with the given "times" argument. +- The default keybinding to leave passthrough mode was changed from `` + to ``, which makes pasting from the clipboard easier in + passthrough mode and is also unlikely to conflict with webpage bindings. v1.4.2 (unreleased) ------------------- diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 25236e208..a5dad907e 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -634,7 +634,7 @@ Default: * +pass:[}}]+: +pass:[navigate next -t]+ - +pass:[passthrough]+: -* +pass:[<Ctrl-V>]+: +pass:[leave-mode]+ +* +pass:[<Shift-Escape>]+: +pass:[leave-mode]+ - +pass:[prompt]+: * +pass:[<Alt-B>]+: +pass:[rl-backward-word]+ diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 5a6cc45a0..89ac390e9 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -2481,7 +2481,7 @@ bindings.default: : hint all tab-bg : leave-mode passthrough: - : leave-mode + : leave-mode command: : command-history-prev : command-history-next From 68b9dff74733278fb8095215db3bd5f00fa3aa50 Mon Sep 17 00:00:00 2001 From: lufte Date: Fri, 17 Aug 2018 00:59:14 -0300 Subject: [PATCH 258/324] Perform attribute updates on a record's clone --- qutebrowser/utils/log.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index 48711614d..ef8aa2ae5 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -25,6 +25,7 @@ import html as pyhtml import logging import contextlib import collections +import copy import faulthandler import traceback import warnings @@ -637,17 +638,18 @@ class HTMLFormatter(logging.Formatter): self._colordict['reset'] = '' def format(self, record): - record.__dict__.update(self._colordict) - if record.levelname in self._log_colors: - color = self._log_colors[record.levelname] - record.log_color = self._colordict[color] + record_clone = copy.copy(record) + record_clone.__dict__.update(self._colordict) + if record_clone.levelname in self._log_colors: + color = self._log_colors[record_clone.levelname] + record_clone.log_color = self._colordict[color] else: - record.log_color = '' + record_clone.log_color = '' for field in ['msg', 'filename', 'funcName', 'levelname', 'module', 'name', 'pathname', 'processName', 'threadName']: - data = str(getattr(record, field)) - setattr(record, field, pyhtml.escape(data)) - msg = super().format(record) + data = str(getattr(record_clone, field)) + setattr(record_clone, field, pyhtml.escape(data)) + msg = super().format(record_clone) if not msg.endswith(self._colordict['reset']): msg += self._colordict['reset'] return msg From fd70d6d2d8d516ad424211d0fb7b89caee771009 Mon Sep 17 00:00:00 2001 From: lufte Date: Fri, 17 Aug 2018 01:00:32 -0300 Subject: [PATCH 259/324] Some memory improvements with generators --- qutebrowser/utils/log.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index ef8aa2ae5..f14b6be1e 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -569,16 +569,14 @@ class RAMHandler(logging.Handler): https://github.com/qutebrowser/qutebrowser/issues/34 """ minlevel = LOG_LEVELS.get(level.upper(), VDEBUG_LEVEL) - lines = [] fmt = self.html_formatter.format if html else self.format self.acquire() try: - records = list(self._data) + lines = list(fmt(record) + for record in self._data + if record.levelno >= minlevel) finally: self.release() - for record in records: - if record.levelno >= minlevel: - lines.append(fmt(record)) return '\n'.join(lines) def change_log_capacity(self, capacity): From 9c4337c359a5641c20f09e2f3deef25e9ef1c372 Mon Sep 17 00:00:00 2001 From: lufte Date: Fri, 17 Aug 2018 18:06:23 -0300 Subject: [PATCH 260/324] Fix "Unnecessary generator - rewrite as a list comprehension." --- qutebrowser/utils/log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index f14b6be1e..afe0a3cb3 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -572,9 +572,9 @@ class RAMHandler(logging.Handler): fmt = self.html_formatter.format if html else self.format self.acquire() try: - lines = list(fmt(record) - for record in self._data - if record.levelno >= minlevel) + lines = [fmt(record) + for record in self._data + if record.levelno >= minlevel] finally: self.release() return '\n'.join(lines) From 995f9b47a06c1fc0a5b612c5d6e6c6bc624b9fa1 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 18 Aug 2018 13:33:12 -0700 Subject: [PATCH 261/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 0d6081b8a..4ad838fc3 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -57,6 +57,7 @@ Fixed - Crash in the `importer.py` script when importing Chrome bookmarks from newer Chrome versions. - The `content.webrtc_public_interfaces_only` option didn't work on Qt 5.11 previously (it now does). Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2. +- Repeated escaping of entries in `qute://log` when refreshing page. v1.4.1 ------ From b192164f2e663dc96e697e369654ec79dc529bb3 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sat, 18 Aug 2018 19:44:51 +1200 Subject: [PATCH 262/324] Don't alphabetically sort tab completion. `ListCategory` sorts its completion by default, we are already building the categories in the right order so don't need that. The test tests the case of where you have 11 tabs and if the model was sorted the tabs with index 10 and 11 would be sorted before the one with index 2. The `random.sample` bit for the tab url and title is to also make sure the model isn't being sorted on those columns, whithout haveng to write and all ten lines. --- qutebrowser/completion/models/miscmodels.py | 4 +-- tests/unit/completion/test_models.py | 30 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/qutebrowser/completion/models/miscmodels.py b/qutebrowser/completion/models/miscmodels.py index 35beb24de..74b75aeb1 100644 --- a/qutebrowser/completion/models/miscmodels.py +++ b/qutebrowser/completion/models/miscmodels.py @@ -122,8 +122,8 @@ def _buffer(skip_win_id=None): tabs.append(("{}/{}".format(win_id, idx + 1), tab.url().toDisplayString(), tabbed_browser.widget.page_title(idx))) - cat = listcategory.ListCategory("{}".format(win_id), tabs, - delete_func=delete_buffer) + cat = listcategory.ListCategory( + str(win_id), tabs, delete_func=delete_buffer, sort=False) model.add_category(cat) return model diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py index a8c7d9425..8d16b4142 100644 --- a/tests/unit/completion/test_models.py +++ b/tests/unit/completion/test_models.py @@ -20,6 +20,8 @@ """Tests for completion models.""" import collections +import random +import string from datetime import datetime import pytest @@ -593,6 +595,34 @@ def test_tab_completion_delete(qtmodeltester, fake_web_tab, app_stub, QUrl('https://duckduckgo.com')] +def test_tab_completion_not_sorted(qtmodeltester, fake_web_tab, app_stub, + win_registry, tabbed_browser_stubs): + """Ensure that the completion row order is the same as tab index order. + + Would be violated for more than 9 tabs if the completion was being + alphabetically sorted on the first column, or the others. + """ + expected = [] + for idx in range(1, 11): + url = "".join(random.sample(string.ascii_letters, 12)) + title = "".join(random.sample(string.ascii_letters, 12)) + expected.append(("0/{}".format(idx), url, title)) + + tabbed_browser_stubs[0].widget.tabs = [ + fake_web_tab(QUrl(tab[1]), tab[2], idx) + for idx, tab in enumerate(expected) + ] + model = miscmodels.buffer() + model.set_pattern('') + qtmodeltester.data_display_may_return_none = True + qtmodeltester.check(model) + + _check_completions(model, { + '0': expected, + '1': [], + }) + + def test_other_buffer_completion(qtmodeltester, fake_web_tab, app_stub, win_registry, tabbed_browser_stubs, info): tabbed_browser_stubs[0].widget.tabs = [ From a370a0019499f20ad8c0b3f5eeab7f43ccfd9412 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 19 Aug 2018 10:49:46 +0200 Subject: [PATCH 263/324] Remove more useless-return suppressions --- tests/end2end/fixtures/test_quteprocess.py | 2 +- tests/helpers/stubs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/end2end/fixtures/test_quteprocess.py b/tests/end2end/fixtures/test_quteprocess.py index 9a6f5b19d..a0dcaf5ce 100644 --- a/tests/end2end/fixtures/test_quteprocess.py +++ b/tests/end2end/fixtures/test_quteprocess.py @@ -68,7 +68,7 @@ class FakeNode: def __init__(self, call): self.rep_call = call - def get_closest_marker(self, _name): # pylint: disable=useless-return + def get_closest_marker(self, _name): return None diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index 808061976..84e5b0125 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -44,7 +44,7 @@ class FakeNetworkCache(QAbstractNetworkCache): def cacheSize(self): return 0 - def data(self, _url): # pylint: disable=useless-return + def data(self, _url): return None def insert(self, _dev): @@ -53,7 +53,7 @@ class FakeNetworkCache(QAbstractNetworkCache): def metaData(self, _url): return QNetworkCacheMetaData() - def prepare(self, _metadata): # pylint: disable=useless-return + def prepare(self, _metadata): return None def remove(self, _url): From b24fbb3462e6b696c4767815174d0937646aed8c Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Sun, 19 Aug 2018 21:40:33 -0700 Subject: [PATCH 264/324] Add two similar projects to the Active list in README. Checked other entries in both the Active and Inactive lists; no changes needed. --- README.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.asciidoc b/README.asciidoc index 2237955dd..b5154c6ef 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -172,6 +172,8 @@ Active * https://luakit.github.io/luakit/[luakit] (C/Lua, GTK+ with WebKit2) * http://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) * http://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) +* https://github.com/next-browser/next/[next] (Lisp, GTK+ with Webkit2) +* https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with WebEngine) * Chrome/Chromium addons: https://github.com/1995eaton/chromium-vim[cVim], http://vimium.github.io/[Vimium], From 0d4c3db303e7c2f29ca5276cfd621744459636fa Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 20 Aug 2018 19:40:13 +0200 Subject: [PATCH 265/324] Update flake8-bugbear from 18.2.0 to 18.8.0 --- misc/requirements/requirements-flake8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index b4f004522..c2f721fdf 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -2,7 +2,7 @@ attrs==18.1.0 flake8==3.5.0 -flake8-bugbear==18.2.0 +flake8-bugbear==18.8.0 flake8-builtins==1.4.1 # rq.filter: != 1.4.0 flake8-comprehensions==1.4.1 flake8-copyright==0.2.0 From a6321bb7d0f9a8209c6104920a6a1e11899d7b05 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 20 Aug 2018 19:40:15 +0200 Subject: [PATCH 266/324] Update setuptools from 40.0.0 to 40.1.0 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index bf003fc8f..00e25abed 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==17.1 pyparsing==2.2.0 -setuptools==40.0.0 +setuptools==40.1.0 six==1.11.0 wheel==0.31.1 From c594c5ee9e177c293346f399166a2daa8f92eb4b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 20 Aug 2018 19:40:16 +0200 Subject: [PATCH 267/324] Update pyroma from 2.3.1 to 2.4 --- misc/requirements/requirements-pyroma.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyroma.txt b/misc/requirements/requirements-pyroma.txt index 6afd097f9..513e8b269 100644 --- a/misc/requirements/requirements-pyroma.txt +++ b/misc/requirements/requirements-pyroma.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py docutils==0.14 -pyroma==2.3.1 +pyroma==2.4 From 699c4b21c0427283cf9403919e31060979c67bf2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 20 Aug 2018 19:40:18 +0200 Subject: [PATCH 268/324] Update hypothesis from 3.67.0 to 3.69.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 21de250eb..59305d0c9 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.67.0 +hypothesis==3.69.0 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From d8a26995c4039442121f3443e7bc0b1abe797c27 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 20 Aug 2018 19:40:19 +0200 Subject: [PATCH 269/324] Update pytest from 3.6.4 to 3.7.2 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 59305d0c9..e7cdd198a 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.5.4 py-cpuinfo==4.0.0 -pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1 +pytest==3.7.2 # rq.filter: != 3.7, != 3.7.1 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 From b58e081f0a25f614cf963b74cdeba2cdadd952c7 Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Mon, 20 Aug 2018 14:25:42 -0700 Subject: [PATCH 270/324] Add browser project data and 2 new links to README. For the 'next' browser, change Webkit2 to Webkit, the version used for Mac is unclear. The links for 'jumanji' and 'pentadactyl' are dead. Keep those old links (if someone wants to search a web archive for them); and add a working link for each of those browsers. --- README.asciidoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index b5154c6ef..424cecbfc 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -172,7 +172,7 @@ Active * https://luakit.github.io/luakit/[luakit] (C/Lua, GTK+ with WebKit2) * http://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) * http://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) -* https://github.com/next-browser/next/[next] (Lisp, GTK+ with Webkit2) +* https://github.com/next-browser/next/[next] (Lisp, Emacs-like, GTK+ with Webkit) * https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with WebEngine) * Chrome/Chromium addons: https://github.com/1995eaton/chromium-vim[cVim], @@ -196,11 +196,13 @@ https://bitbucket.org/portix/dwb/pull-requests/22/several-cleanups-to-increase-p main inspiration for qutebrowser) * http://sourceforge.net/p/vimprobable/wiki/Home/[vimprobable] (C, GTK+ with WebKit1) -* http://pwmt.org/projects/jumanji/[jumanji] (C, GTK+ with WebKit1) +* http://pwmt.org/projects/jumanji/[jumanji-dead link] (C, GTK+ with WebKit1, +https://wiki.archlinux.org/index.php?title=Jumanji[Arch Linux] has some data) * http://conkeror.org/[conkeror] (Javascript, Emacs-like, XULRunner/Gecko) * Firefox addons (not based on WebExtensions or no recent activity): http://www.vimperator.org/[Vimperator], - http://5digits.org/pentadactyl/[Pentadactyl], + http://5digits.org/pentadactyl/[Pentadactyl-dead link], + http://bug.5digits.org/home[Pentadactyl], https://github.com/akhodakivskiy/VimFx[VimFx], * Chrome/Chromium addons: https://chrome.google.com/webstore/detail/vichrome/gghkfhpblkcmlkmpcpgaajbbiikbhpdi?hl=en[ViChrome], From 7a7a65d71442ca62abe46bfcbcffedfb419c8270 Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Mon, 20 Aug 2018 14:36:27 -0700 Subject: [PATCH 271/324] Change Webkit to WebKit in one place. --- README.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index 424cecbfc..0a328ffef 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -172,7 +172,7 @@ Active * https://luakit.github.io/luakit/[luakit] (C/Lua, GTK+ with WebKit2) * http://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) * http://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) -* https://github.com/next-browser/next/[next] (Lisp, Emacs-like, GTK+ with Webkit) +* https://github.com/next-browser/next/[next] (Lisp, Emacs-like, GTK+ with WebKit) * https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with WebEngine) * Chrome/Chromium addons: https://github.com/1995eaton/chromium-vim[cVim], From 92a8e415e9c60262c4df41ebff2c6eae572a7b03 Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Tue, 21 Aug 2018 11:29:00 -0700 Subject: [PATCH 272/324] Remove two dead links from Inactive list in README. These links are in the Similar Projects-Inactive section of the README file. Two other links point to pages with data about those projects. --- README.asciidoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index 0a328ffef..9ff7e1dfd 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -196,12 +196,10 @@ https://bitbucket.org/portix/dwb/pull-requests/22/several-cleanups-to-increase-p main inspiration for qutebrowser) * http://sourceforge.net/p/vimprobable/wiki/Home/[vimprobable] (C, GTK+ with WebKit1) -* http://pwmt.org/projects/jumanji/[jumanji-dead link] (C, GTK+ with WebKit1, -https://wiki.archlinux.org/index.php?title=Jumanji[Arch Linux] has some data) +* https://wiki.archlinux.org/index.php?title=Jumanji[jumanji at Arch Linux] has some data (C, GTK+ with WebKit1) * http://conkeror.org/[conkeror] (Javascript, Emacs-like, XULRunner/Gecko) * Firefox addons (not based on WebExtensions or no recent activity): http://www.vimperator.org/[Vimperator], - http://5digits.org/pentadactyl/[Pentadactyl-dead link], http://bug.5digits.org/home[Pentadactyl], https://github.com/akhodakivskiy/VimFx[VimFx], * Chrome/Chromium addons: From 65ca15ecf6379284962a310d9069d6e89e3707fc Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Tue, 21 Aug 2018 11:48:16 -0700 Subject: [PATCH 273/324] Reword text for inactive project jumanji, in README. Clarify that jumanji is not a project of Arch Linux, but that the page at Arch has some data about the browser. --- README.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index 9ff7e1dfd..2733da7ef 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -196,7 +196,8 @@ https://bitbucket.org/portix/dwb/pull-requests/22/several-cleanups-to-increase-p main inspiration for qutebrowser) * http://sourceforge.net/p/vimprobable/wiki/Home/[vimprobable] (C, GTK+ with WebKit1) -* https://wiki.archlinux.org/index.php?title=Jumanji[jumanji at Arch Linux] has some data (C, GTK+ with WebKit1) +* https://wiki.archlinux.org/index.php?title=Jumanji[jumanji] (C, GTK+ with WebKit1, +original site is gone but Arch Linux has some data) * http://conkeror.org/[conkeror] (Javascript, Emacs-like, XULRunner/Gecko) * Firefox addons (not based on WebExtensions or no recent activity): http://www.vimperator.org/[Vimperator], From 8ac9c72412e614a8d1c559ec80ecda38c9987633 Mon Sep 17 00:00:00 2001 From: vilhalmer Date: Tue, 21 Aug 2018 21:38:26 -0400 Subject: [PATCH 274/324] Set desktop file name --- qutebrowser/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index a334d8100..ed2a85eed 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -104,6 +104,7 @@ def run(args): qApp = Application(args) qApp.setOrganizationName("qutebrowser") qApp.setApplicationName("qutebrowser") + qApp.setDesktopFileName("qutebrowser") qApp.setApplicationVersion(qutebrowser.__version__) qApp.lastWindowClosed.connect(quitter.on_last_window_closed) From 802ce3636e6e47fbeb57257fb6340e87f423cca1 Mon Sep 17 00:00:00 2001 From: PLD Date: Thu, 23 Aug 2018 17:36:21 +0200 Subject: [PATCH 275/324] Add instructions to link against OpenSSL 1.0 on Ubuntu When installing qutebrowser via tox on Ubuntu 18.04, the notes on linking OpenSSL 1.0 instead of OpenSSL 1.1 to make QtNetwork SSL working are a bit confusing, due to some path differences between Ubuntu and ArchLinux. The addition of an item addressing this specific issue should help newcomers. --- doc/install.asciidoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/install.asciidoc b/doc/install.asciidoc index c8b6c2248..6e3eb7b25 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -443,6 +443,14 @@ caveats: (`export LD_LIBRARY_PATH=/usr/lib/openssl-1.0` on Archlinux) before starting qutebrowser if you want SSL to work in certain downloads (e.g. for `:adblock-update` or `:download`). + * On Ubuntu (tested on 18.04), you will need to install the `libssl1.0.0` + package (`apt install libssl1.0.0`). Then, in the qutebrowser git + repository, create a directory named `libssl` (`mkdir libssl`), and link + `libcrypto.so.1.0.0` and `libssl.so.1.0.0` into it without the versioning + part in their names (`ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 + libssl/libcrypto.so` and `ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 + libssl/libssl.so`). Now you can start qutebrowser issuing `export + LD_LIBRARY_PATH=$(pwd)/libssl` beforehand. - It comes with a QtWebEngine compiled without proprietary codec support (such as h.264). From ac6d5283e0b9eb7322e75c618d027bb0a21dd6fc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 23 Aug 2018 21:28:46 +0200 Subject: [PATCH 276/324] Fix stacktrace.asciidoc link --- doc/faq.asciidoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 618d7801c..d59d49e67 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -105,7 +105,7 @@ Is there an adblocker?:: https://blog.mozilla.org/nnethercote/2014/05/14/adblock-pluss-effect-on-firefoxs-memory-usage/[RAM usage], so implementing support for AdBlockPlus-like lists is currently not a priority. - + How can I get No-Script-like behavior?:: To disable JavaScript by default: + @@ -160,11 +160,11 @@ What is the difference between bookmarks and quickmarks?:: Bookmarks will always use the title of the website as their name, but with quickmarks you can set your own title. + -For example, if you bookmark multiple food recipe websites and use `:open`, +For example, if you bookmark multiple food recipe websites and use `:open`, you have to type the title or address of the website. + When using quickmark, you can give them all names, like -`foodrecipes1`, `foodrecipes2` and so on. When you type +`foodrecipes1`, `foodrecipes2` and so on. When you type `:open foodrecipes`, you will see a list of all the food recipe sites, without having to remember the exact website title or address. @@ -258,7 +258,7 @@ Note that there are some missing features which you may run into: See https://wiki.greasespot.net/Metadata_Block[the wiki] for more info. . Any greasemonkey API function to do with adding UI elements is not currently supported. That means context menu extentensions and background pages. - + == Troubleshooting Unable to view flash content.:: @@ -279,12 +279,12 @@ When using QtWebEngine, qutebrowser reports "Render Process Crashed" and the con As stated in https://gcc.gnu.org/gcc-6/changes.html[GCC's Website] GCC 6 has introduced some optimizations that could break non-conforming codebases, like QtWebEngine. + As a workaround, you can disable the nullpointer check optimization by adding the -fno-delete-null-pointer-checks flag while compiling. + On gentoo, you just need to add it into your make.conf, like this: + - + CFLAGS="... -fno-delete-null-pointer-checks" CXXFLAGS="... -fno-delete-null-pointer-checks" + And then re-emerging qtwebengine with: + - + emerge -1 qtwebengine Unable to view DRM content (Netflix, Spotify, etc.).:: @@ -315,5 +315,5 @@ My issue is not listed.:: https://github.com/qutebrowser/qutebrowser/issues[the issue tracker] or using the `:report` command. If you are reporting a segfault, make sure you read the - link:stacktrace.asciidoc[guide] on how to report them with all needed + link:stacktrace.html[guide] on how to report them with all needed information. From 2d54cdaecb8c4c302d251593679183d555cc1729 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 23 Aug 2018 21:31:21 +0200 Subject: [PATCH 277/324] Really fix stacktrace link... --- doc/faq.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index d59d49e67..76dfdea9b 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -315,5 +315,5 @@ My issue is not listed.:: https://github.com/qutebrowser/qutebrowser/issues[the issue tracker] or using the `:report` command. If you are reporting a segfault, make sure you read the - link:stacktrace.html[guide] on how to report them with all needed + link:doc/stacktrace.html[guide] on how to report them with all needed information. From 1dd857a51af1c730e3902c88f4fcc14888665484 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 24 Aug 2018 23:31:04 +0200 Subject: [PATCH 278/324] Implement MouseLock permission Closes #3287 --- doc/changelog.asciidoc | 1 + qutebrowser/browser/webengine/webenginetab.py | 12 ++++++++++++ qutebrowser/config/configdata.yml | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 4ad838fc3..b353bd3ad 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -24,6 +24,7 @@ Added - The qute-pass userscript now has optional OTP support. - When `:spawn --userscript` is called with a count, that count is now passed to userscripts as `$QUTE_COUNT`. +- New `content.mouse_lock` setting to handle HTML5 pointer locking. Changed ~~~~~~~ diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 2c890b8a5..cfb809097 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -707,6 +707,18 @@ class _WebEnginePermissions(QObject): QWebEnginePage.MediaVideoCapture: 'record video', QWebEnginePage.MediaAudioVideoCapture: 'record audio/video', } + try: + options.update({ + QWebEnginePage.MouseLock: + 'content.mouse_lock', + }) + messages.update({ + QWebEnginePage.MouseLock: + 'hide your mouse pointer', + }) + except AttributeError: + # Added in Qt 5.8 + pass try: options.update({ QWebEnginePage.DesktopVideoCapture: diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 89ac390e9..7d39bded8 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -354,6 +354,15 @@ content.geolocation: supports_pattern: true desc: Allow websites to request geolocations. +content.mouse_lock: + default: ask + type: BoolAsk + supports_pattern: true + backend: + QtWebKit: false + QtWebEngine: Qt 5.8 + desc: Allow websites to lock your mouse pointer. + content.headers.accept_language: type: name: String From 51a87f78dfdbec901a3eec735b172ced612cee02 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 25 Aug 2018 08:06:54 +0200 Subject: [PATCH 279/324] Blacklist pytest 3.7.2 --- misc/requirements/requirements-tests.txt | 2 +- misc/requirements/requirements-tests.txt-raw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index e7cdd198a..bfca4321f 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.5.4 py-cpuinfo==4.0.0 -pytest==3.7.2 # rq.filter: != 3.7, != 3.7.1 +pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 diff --git a/misc/requirements/requirements-tests.txt-raw b/misc/requirements/requirements-tests.txt-raw index d1109a418..eac1381d4 100644 --- a/misc/requirements/requirements-tests.txt-raw +++ b/misc/requirements/requirements-tests.txt-raw @@ -19,4 +19,4 @@ pytest-xvfb vulture #@ ignore: Jinja2, MarkupSafe, colorama -#@ filter: pytest != 3.7, != 3.7.1 +#@ filter: pytest != 3.7, != 3.7.1, != 3.7.2 From b85f58545e41cd5774618e12d96f70b24a24b5fb Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Sun, 26 Aug 2018 12:52:06 -0700 Subject: [PATCH 280/324] Move some listings from Active to Inactive in README. Move five items in the Similar Projects section, to reflect lack of recent activity. Fix one URL typo. --- README.asciidoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index 2733da7ef..806969aec 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -171,19 +171,14 @@ Active * https://fanglingsu.github.io/vimb/[vimb] (C, GTK+ with WebKit2) * https://luakit.github.io/luakit/[luakit] (C/Lua, GTK+ with WebKit2) * http://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) -* http://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) * https://github.com/next-browser/next/[next] (Lisp, Emacs-like, GTK+ with WebKit) * https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with WebEngine) * Chrome/Chromium addons: - https://github.com/1995eaton/chromium-vim[cVim], http://vimium.github.io/[Vimium], https://github.com/brookhong/Surfingkeys[Surfingkeys], - https://key.saka.io/[Saka Key] * Firefox addons (based on WebExtensions): https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/[Vimium-FF] (experimental), - https://key.saka.io[Saka Key], https://github.com/ueokande/vim-vixen[Vim Vixen], - https://github.com/shinglyu/QuantumVim[QuantumVim], https://github.com/cmcaine/tridactyl[Tridactyl] (working on a https://bugzilla.mozilla.org/show_bug.cgi?id=1215061[better API] for keyboard integration in Firefox). @@ -199,13 +194,18 @@ main inspiration for qutebrowser) * https://wiki.archlinux.org/index.php?title=Jumanji[jumanji] (C, GTK+ with WebKit1, original site is gone but Arch Linux has some data) * http://conkeror.org/[conkeror] (Javascript, Emacs-like, XULRunner/Gecko) +* http://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) * Firefox addons (not based on WebExtensions or no recent activity): http://www.vimperator.org/[Vimperator], - http://bug.5digits.org/home[Pentadactyl], + http://bug.5digits.org/pentadactyl/index[Pentadactyl], https://github.com/akhodakivskiy/VimFx[VimFx], + https://key.saka.io[Saka Key], + https://github.com/shinglyu/QuantumVim[QuantumVim], * Chrome/Chromium addons: https://chrome.google.com/webstore/detail/vichrome/gghkfhpblkcmlkmpcpgaajbbiikbhpdi?hl=en[ViChrome], https://github.com/jinzhu/vrome[Vrome] + https://key.saka.io[Saka Key], + https://github.com/1995eaton/chromium-vim[cVim], License ------- From 23991ccb4eb3fa0f7b1f88225c1f8cff50ad8ae5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 27 Aug 2018 10:07:36 +0200 Subject: [PATCH 281/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b353bd3ad..59c9d2f55 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -34,6 +34,7 @@ Changed - The default keybinding to leave passthrough mode was changed from `` to ``, which makes pasting from the clipboard easier in passthrough mode and is also unlikely to conflict with webpage bindings. +- The `app_id` is now set to `qutebrowser` for Wayland. v1.4.2 (unreleased) ------------------- @@ -83,6 +84,7 @@ Fixed - The Windows installer now uninstalls the old version before installing the new one, fixing issues with qutebrowser not starting after installing v1.4.0 over v1.3.3. +- The `:buffer` completion now sorts tabs with indices >= 10 correctly again. v1.4.0 ------ From ce5bfd4e9256c690ab7d091f7ef7c1e3f0ecac10 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 27 Aug 2018 10:40:48 +0200 Subject: [PATCH 282/324] Update docs --- doc/help/settings.asciidoc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index a5dad907e..edb60aa34 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -143,6 +143,7 @@ |<>|Allow locally loaded documents to access remote URLs. |<>|Enable support for HTML 5 local storage and Web SQL. |<>|Allow websites to record audio/video. +|<>|Allow websites to lock your mouse pointer. |<>|Netrc-file for HTTP authentication. |<>|Allow websites to show notifications. |<>|Allow pdf.js to view PDF files in the browser. @@ -1872,6 +1873,26 @@ Default: +pass:[ask]+ This setting is only available with the QtWebEngine backend. +[[content.mouse_lock]] +=== content.mouse_lock +Allow websites to lock your mouse pointer. + +This setting supports URL patterns. + +Type: <> + +Valid values: + + * +true+ + * +false+ + * +ask+ + +Default: +pass:[ask]+ + +On QtWebEngine, this setting requires Qt 5.8 or newer. + +On QtWebKit, this setting is unavailable. + [[content.netrc_file]] === content.netrc_file Netrc-file for HTTP authentication. From 4d0cb33df1df2a3f4bbf01f1d6768d0c29ae1500 Mon Sep 17 00:00:00 2001 From: "C. Poda" Date: Mon, 27 Aug 2018 08:14:30 -0700 Subject: [PATCH 283/324] Change webmacs from WebEngine to QtWebEngine. --- README.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index 806969aec..6a568aa5a 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -172,7 +172,7 @@ Active * https://luakit.github.io/luakit/[luakit] (C/Lua, GTK+ with WebKit2) * http://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) * https://github.com/next-browser/next/[next] (Lisp, Emacs-like, GTK+ with WebKit) -* https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with WebEngine) +* https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with QtWebEngine) * Chrome/Chromium addons: http://vimium.github.io/[Vimium], https://github.com/brookhong/Surfingkeys[Surfingkeys], From a03133c5734a2db4d08c8d38c27db4ffaaa40877 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 27 Aug 2018 23:31:13 +0200 Subject: [PATCH 284/324] Fix and https-ify some URLs --- README.asciidoc | 26 +++++++++++++------------- doc/faq.asciidoc | 40 ++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index 6a568aa5a..d587d48d3 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -59,7 +59,7 @@ Getting help You can get help in the IRC channel irc://irc.freenode.org/#qutebrowser[`#qutebrowser`] on -http://freenode.net/[Freenode] +https://freenode.net/[Freenode] (https://webchat.freenode.net/?channels=#qutebrowser[webchat]), or by writing a message to the https://lists.schokokeks.org/mailman/listinfo.cgi/qutebrowser[mailinglist] at @@ -96,8 +96,8 @@ Requirements The following software and libraries are required to run qutebrowser: -* http://www.python.org/[Python] 3.5 or newer (3.6 recommended) -* http://qt.io/[Qt] 5.7.1 or newer (5.11.1 recommended) with the following modules: +* https://www.python.org/[Python] 3.5 or newer (3.6 recommended) +* https://www.qt.io/[Qt] 5.7.1 or newer (5.11.1 recommended) with the following modules: - QtCore / qtbase - QtQuick (part of qtbase in some distributions) - QtSQL (part of qtbase in some distributions) @@ -106,14 +106,14 @@ The following software and libraries are required to run qutebrowser: - QtWebKit - only the link:https://github.com/annulen/webkit/wiki[updated fork] (5.212) is supported -* http://www.riverbankcomputing.com/software/pyqt/intro[PyQt] 5.7.0 or newer +* https://www.riverbankcomputing.com/software/pyqt/intro[PyQt] 5.7.0 or newer (5.11.2 recommended) for Python 3 * https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools] -* http://fdik.org/pyPEG/[pyPEG2] +* https://fdik.org/pyPEG/[pyPEG2] * http://jinja.pocoo.org/[jinja2] * http://pygments.org/[pygments] * https://github.com/yaml/pyyaml[PyYAML] -* http://www.attrs.org/[attrs] +* https://www.attrs.org/[attrs] The following libraries are optional: @@ -152,7 +152,7 @@ https://github.com/qutebrowser/qutebrowser/graphs/contributors[hundreds of contr Additionally, the following people have contributed graphics: -* Jad/link:http://yelostudio.com[yelo] (new icon) +* Jad/link:https://yelostudio.com[yelo] (new icon) * WOFall (original icon) * regines (key binding cheatsheet) @@ -170,11 +170,11 @@ Active * https://fanglingsu.github.io/vimb/[vimb] (C, GTK+ with WebKit2) * https://luakit.github.io/luakit/[luakit] (C/Lua, GTK+ with WebKit2) -* http://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) +* https://surf.suckless.org/[surf] (C, GTK+ with WebKit1/WebKit2) * https://github.com/next-browser/next/[next] (Lisp, Emacs-like, GTK+ with WebKit) * https://github.com/parkouss/webmacs/[webmacs] (Python, Emacs-like with QtWebEngine) * Chrome/Chromium addons: - http://vimium.github.io/[Vimium], + https://vimium.github.io/[Vimium], https://github.com/brookhong/Surfingkeys[Surfingkeys], * Firefox addons (based on WebExtensions): https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/[Vimium-FF] (experimental), @@ -189,12 +189,12 @@ Inactive * https://bitbucket.org/portix/dwb[dwb] (C, GTK+ with WebKit1, https://bitbucket.org/portix/dwb/pull-requests/22/several-cleanups-to-increase-portability/diff[unmaintained] - main inspiration for qutebrowser) -* http://sourceforge.net/p/vimprobable/wiki/Home/[vimprobable] (C, GTK+ with +* https://sourceforge.net/p/vimprobable/wiki/Home/[vimprobable] (C, GTK+ with WebKit1) -* https://wiki.archlinux.org/index.php?title=Jumanji[jumanji] (C, GTK+ with WebKit1, +* https://wiki.archlinux.org/index.php?title=Jumanji[jumanji] (C, GTK+ with WebKit1, original site is gone but Arch Linux has some data) * http://conkeror.org/[conkeror] (Javascript, Emacs-like, XULRunner/Gecko) -* http://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) +* https://www.uzbl.org/[uzbl] (C, GTK+ with WebKit1/WebKit2) * Firefox addons (not based on WebExtensions or no recent activity): http://www.vimperator.org/[Vimperator], http://bug.5digits.org/pentadactyl/index[Pentadactyl], @@ -232,4 +232,4 @@ display PDF files in the browser. Windows releases come with a bundled pdf.js. pdf.js is distributed under the terms of the Apache License. You can find a copy of the license in `qutebrowser/3rdparty/pdfjs/LICENSE` (in the Windows release or after running `scripts/dev/update_3rdparty.py`), or online -http://www.apache.org/licenses/LICENSE-2.0.html[here]. +https://www.apache.org/licenses/LICENSE-2.0.html[here]. diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 76dfdea9b..a5d790508 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -5,8 +5,8 @@ The Compiler [qanda] What is qutebrowser based on?:: - qutebrowser uses http://www.python.org/[Python], http://qt.io/[Qt] and - http://www.riverbankcomputing.com/software/pyqt/intro[PyQt]. + qutebrowser uses https://www.python.org/[Python], https://www.qt.io/[Qt] and + https://www.riverbankcomputing.com/software/pyqt/intro[PyQt]. + The concept of it is largely inspired by https://bitbucket.org/portix/dwb/[dwb] and http://www.vimperator.org/vimperator[Vimperator]. Many actions and @@ -16,34 +16,34 @@ Why another browser?:: It might be hard to believe, but I didn't find any browser which I was happy with, so I started to write my own. Also, I needed a project to get into writing GUI applications with Python and - link:http://qt.io/[Qt]/link:http://www.riverbankcomputing.com/software/pyqt/intro[PyQt]. + link:https://www.qt.io/[Qt]/link:https://www.riverbankcomputing.com/software/pyqt/intro[PyQt]. + Read the next few questions to find out why I was unhappy with existing software. -What's wrong with link:https://bitbucket.org/portix/dwb/[dwb]/link:http://sourceforge.net/projects/vimprobable/[vimprobable]/link:https://mason-larobina.github.io/luakit/[luakit]/link:http://pwmt.org/projects/jumanji/[jumanji]/... (projects based on WebKitGTK)?:: - Most of them are based on the http://webkitgtk.org/[WebKitGTK+] - http://webkitgtk.org/reference/webkitgtk/stable/index.html[WebKit1] API, +What's wrong with link:https://bitbucket.org/portix/dwb/[dwb]/link:https://sourceforge.net/projects/vimprobable/[vimprobable]/link:https://mason-larobina.github.io/luakit/[luakit]/jumanji/... (projects based on WebKitGTK)?:: + Most of them are based on the https://webkitgtk.org/[WebKitGTK+] + https://webkitgtk.org/reference/webkitgtk/stable/index.html[WebKit1] API, which causes a lot of crashes. As the GTK API using WebKit1 is https://lists.webkit.org/pipermail/webkit-gtk/2014-March/001821.html[deprecated], these bugs are never going to be fixed. + When qutebrowser was created, the newer -http://webkitgtk.org/reference/webkit2gtk/stable/index.html[WebKit2 API] lacked +https://webkitgtk.org/reference/webkit2gtk/stable/index.html[WebKit2 API] lacked basic features like proxy support, and almost no projects have started porting to WebKit2. In the meantime, this situation has improved a bit, but there are still only a few projects which have some kind of WebKit2 support (see the https://github.com/qutebrowser/qutebrowser#similar-projects[list of alternatives]). + -qutebrowser uses http://qt.io/[Qt] and -http://wiki.qt.io/QtWebEngine[QtWebEngine] by default (and supports -http://wiki.qt.io/QtWebKit[QtWebKit] optionally). QtWebEngine is based on +qutebrowser uses https://www.qt.io/[Qt] and +https://wiki.qt.io/QtWebEngine[QtWebEngine] by default (and supports +https://wiki.qt.io/QtWebKit[QtWebKit] optionally). QtWebEngine is based on Google's https://www.chromium.org/Home[Chromium]. With an up-to-date Qt, it has much more man-power behind it than WebKitGTK+ has, and thus supports more modern web features - it's also arguably more secure. -What's wrong with https://www.mozilla.org/en-US/firefox/new/[Firefox] and link:http://5digits.org/pentadactyl/[Pentadactyl]/link:http://www.vimperator.org/vimperator[Vimperator]?:: +What's wrong with https://www.mozilla.org/en-US/firefox/new/[Firefox] and link:http://bug.5digits.org/pentadactyl/[Pentadactyl]/link:http://www.vimperator.org/vimperator[Vimperator]?:: Firefox likes to break compatibility with addons on each upgrade, gets slower and more bloated with every upgrade, and has some https://blog.mozilla.org/advancingcontent/2014/02/11/publisher-transformation-with-users-at-the-center/[horrible @@ -51,20 +51,20 @@ What's wrong with https://www.mozilla.org/en-US/firefox/new/[Firefox] and link:h + Also, developing addons for it is a nightmare. -What's wrong with http://www.chromium.org/Home[Chromium] and https://vimium.github.io/[Vimium]?:: +What's wrong with https://www.chromium.org/Home[Chromium] and https://vimium.github.io/[Vimium]?:: The Chrome plugin API doesn't seem to allow much freedom for plugin writers, which results in Vimium not really having all the features you'd expect from a proper minimal, vim-like browser. Why Python?:: I enjoy writing Python since 2011, which made it one of the possible - choices. I wanted to use http://qt.io/[Qt] because of - http://wiki.qt.io/QtWebKit[QtWebKit] so I didn't have - http://wiki.qt.io/Category:LanguageBindings[many other choices]. I don't + choices. I wanted to use https://www.qt.io/[Qt] because of + https://wiki.qt.io/QtWebKit[QtWebKit] so I didn't have + https://wiki.qt.io/Category:LanguageBindings[many other choices]. I don't like C++ and can't write it very well, so that wasn't an alternative. But isn't Python too slow for a browser?:: - http://www.infoworld.com/d/application-development/van-rossum-python-not-too-slow-188715[No.] + https://www.infoworld.com/d/application-development/van-rossum-python-not-too-slow-188715[No.] I believe efficiency while coding is a lot more important than efficiency while running. Also, most of the heavy lifting of qutebrowser is done by Qt and WebKit in C++, with the @@ -74,7 +74,7 @@ Is qutebrowser secure?:: Most security issues are in the backend (which handles networking, rendering, JavaScript, etc.) and not qutebrowser itself. + -qutebrowser uses http://wiki.qt.io/QtWebEngine[QtWebEngine] by default. +qutebrowser uses https://wiki.qt.io/QtWebEngine[QtWebEngine] by default. QtWebEngine is based on Google's https://www.chromium.org/Home[Chromium]. While Qt only updates to a new Chromium release on every minor Qt release (all ~6 months), every patch release backports security fixes from newer Chromium @@ -84,7 +84,7 @@ do anything. Chromium's process isolation and https://chromium.googlesource.com/chromium/src/+/master/docs/design/sandbox.md[sandboxing] features are also enabled as a second line of defense. + -http://wiki.qt.io/QtWebKit[QtWebKit] is also supported as an alternative +https://wiki.qt.io/QtWebKit[QtWebKit] is also supported as an alternative backend, but hasn't seen new releases https://github.com/annulen/webkit/releases[in a while]. It also doesn't have any process isolation or sandboxing. See @@ -100,7 +100,7 @@ https://www.the-compiler.org/pubkey.asc[0x916eb0c8fd55a072]. Is there an adblocker?:: There is a host-based adblocker which takes /etc/hosts-like lists. A "real" adblocker has a - http://www.reddit.com/r/programming/comments/25j41u/adblock_pluss_effect_on_firefoxs_memory_usage/chhpomw[big + https://www.reddit.com/r/programming/comments/25j41u/adblock_pluss_effect_on_firefoxs_memory_usage/chhpomw[big impact] on browsing speed and https://blog.mozilla.org/nnethercote/2014/05/14/adblock-pluss-effect-on-firefoxs-memory-usage/[RAM usage], so implementing support for AdBlockPlus-like lists is currently not @@ -266,7 +266,7 @@ Unable to view flash content.:: to use the flash plugin. Using the command `:set content.plugins true` in qutebrowser will enable plugins. Packages for flash should be provided for your platform or it can be obtained from - http://get.adobe.com/flashplayer/[Adobe]. + https://get.adobe.com/flashplayer/[Adobe]. Experiencing freezing on sites like duckduckgo and youtube.:: This issue could be caused by stale plugin files installed by `mozplugger` From 7d293ed9ffbadc0117fd9e656951c9eafd331649 Mon Sep 17 00:00:00 2001 From: lufte Date: Mon, 27 Aug 2018 23:03:49 -0300 Subject: [PATCH 285/324] Missing colon --- doc/userscripts.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/userscripts.asciidoc b/doc/userscripts.asciidoc index ac0fe9bb3..2dc34402d 100644 --- a/doc/userscripts.asciidoc +++ b/doc/userscripts.asciidoc @@ -19,7 +19,7 @@ Also note userscripts need to have the executable bit set (`chmod +x`) for qutebrowser to run them. To call a userscript, it needs to be stored in your data directory under -`userscripts` (for example: `~/.local/share/qutebrowser/userscripts/myscript`), +`userscripts` (for example: `~/.local/share/qutebrowser/userscripts/myscript`), or just use an absolute path. NOTE: On Windows, only userscripts with `com`, `bat`, or `exe` extensions will be launched. @@ -51,7 +51,7 @@ In `hints` mode: - `QUTE_URL`: The URL selected via hints. - `QUTE_SELECTED_TEXT`: The plain text of the element selected via hints. -- `QUTE_SELECTED_HTML` The HTML of the element selected via hints. +- `QUTE_SELECTED_HTML`: The HTML of the element selected via hints. Sending commands ---------------- From 3fa01ae84d4dbb8c628c389888b4ee15eb597fea Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 28 Aug 2018 09:21:03 +0200 Subject: [PATCH 286/324] Handle more flaky tests --- tests/end2end/features/misc.feature | 2 +- tests/end2end/features/open.feature | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 5f0035b8b..f00a4664c 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -181,7 +181,7 @@ Feature: Various utility commands. # :stop/:reload - @flaky + @skip # Too flaky Scenario: :stop Given I have a fresh instance # We can't use "When I open" because we don't want to wait for load diff --git a/tests/end2end/features/open.feature b/tests/end2end/features/open.feature index ebae3cefb..3aec41786 100644 --- a/tests/end2end/features/open.feature +++ b/tests/end2end/features/open.feature @@ -41,6 +41,7 @@ Feature: Opening pages And I run :open 3 Then data/numbers/3.txt should be loaded + @flaky Scenario: Opening in a new tab Given I open about:blank When I run :tab-only From 8459afb76e4d03f736baf6f14b6b736d052f20c0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 28 Aug 2018 18:57:47 +0200 Subject: [PATCH 287/324] Recognize "Command"/"Cmd" in keybindings --- doc/changelog.asciidoc | 2 ++ qutebrowser/keyinput/keyutils.py | 4 +++- tests/unit/keyinput/test_keyutils.py | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 59c9d2f55..de9ab4aa0 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -35,6 +35,8 @@ Changed to ``, which makes pasting from the clipboard easier in passthrough mode and is also unlikely to conflict with webpage bindings. - The `app_id` is now set to `qutebrowser` for Wayland. +- `Command` or `Cmd` can now be used (instead of `Meta`) to map the Command key + on macOS. v1.4.2 (unreleased) ------------------- diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index e22e24f77..bef3c7cf0 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -270,8 +270,10 @@ def _parse_special_key(keystr): replacements = ( ('control', 'ctrl'), ('windows', 'meta'), - ('mod1', 'alt'), ('mod4', 'meta'), + ('command', 'meta'), + ('cmd', 'meta'), + ('mod1', 'alt'), ('less', '<'), ('greater', '>'), ) diff --git a/tests/unit/keyinput/test_keyutils.py b/tests/unit/keyinput/test_keyutils.py index dc8fe0a53..d6e7bce34 100644 --- a/tests/unit/keyinput/test_keyutils.py +++ b/tests/unit/keyinput/test_keyutils.py @@ -214,8 +214,10 @@ class TestKeySequence: @pytest.mark.parametrize('orig, normalized', [ ('', ''), ('', ''), - ('', ''), ('', ''), + ('', ''), + ('', ''), + ('', ''), ('', ''), ('', ''), ('', ''), From d337ed885a820bb5c68fb5d9bef4ee067060c700 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 28 Aug 2018 22:56:50 +0200 Subject: [PATCH 288/324] Re-add :stop test in misc.feature For some reason I don't comprehend right now, disabling it breaks test_focusing_download_widget_via_tab. I'm having exams tomorrow and the day after that, so meh, let's just re-enable that test for now as a stopgap solution. --- tests/end2end/features/misc.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index f00a4664c..5f0035b8b 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -181,7 +181,7 @@ Feature: Various utility commands. # :stop/:reload - @skip # Too flaky + @flaky Scenario: :stop Given I have a fresh instance # We can't use "When I open" because we don't want to wait for load From a13607674fcb5c1ccd8914e48da5ae626a35f951 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 30 Aug 2018 07:46:01 +0200 Subject: [PATCH 289/324] Elide URLs at the end and not in the middle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With a URL like http://www.example.com/long/path/end, an elision like http://www.example.com/…/path/end would be nicest, but using ElideMiddle means we can end up with something like http://www.example.…/path/end, which can possibly trick a user during a phishing attempt. Instead, let's just always elide at the end, so we end up with http://www.example.com/long/…. That makes sure the scheme/hostname (which are most important) are visible as long as possible. Fixes #4170. --- qutebrowser/mainwindow/statusbar/url.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/statusbar/url.py b/qutebrowser/mainwindow/statusbar/url.py index f24e79834..c9f17db1b 100644 --- a/qutebrowser/mainwindow/statusbar/url.py +++ b/qutebrowser/mainwindow/statusbar/url.py @@ -80,8 +80,7 @@ class UrlText(textbase.TextBase): """ def __init__(self, parent=None): - """Override TextBase.__init__ to elide in the middle by default.""" - super().__init__(parent, Qt.ElideMiddle) + super().__init__(parent) self.setObjectName(self.__class__.__name__) config.set_register_stylesheet(self) self._hover_url = None From b7b3473f74db8b99007a0acf1a14fc702c216e44 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 30 Aug 2018 07:50:31 +0200 Subject: [PATCH 290/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index de9ab4aa0..95815279b 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -46,6 +46,8 @@ Changed - The `content.xss_auditing` setting is now enabled by default, to mirror Chromium's rather than Qt's default behavior. +- Long URLs in the statusbar are now elided at the end rather than in the + middle, to make sure the hostname is completely visible whenever possible. Fixed ~~~~~ From 65caf40b06c23585feb4675f71a28e34c609b2f4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 31 Aug 2018 11:47:18 +0200 Subject: [PATCH 291/324] Remove unneeded import --- qutebrowser/mainwindow/statusbar/url.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/mainwindow/statusbar/url.py b/qutebrowser/mainwindow/statusbar/url.py index c9f17db1b..fda09d642 100644 --- a/qutebrowser/mainwindow/statusbar/url.py +++ b/qutebrowser/mainwindow/statusbar/url.py @@ -21,7 +21,7 @@ import enum -from PyQt5.QtCore import pyqtSlot, pyqtProperty, Qt, QUrl +from PyQt5.QtCore import pyqtSlot, pyqtProperty, QUrl from qutebrowser.mainwindow.statusbar import textbase from qutebrowser.config import config From 1815070dab8b2fccbdf27ff0259f88723914e925 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 31 Aug 2018 16:48:45 +0200 Subject: [PATCH 292/324] Make sure the host blocker doesn't block 0.0.0.0 --- qutebrowser/browser/adblock.py | 4 +++- tests/unit/browser/test_adblock.py | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/adblock.py b/qutebrowser/browser/adblock.py index f42d1a1db..affd80eaf 100644 --- a/qutebrowser/browser/adblock.py +++ b/qutebrowser/browser/adblock.py @@ -234,7 +234,9 @@ class HostBlocker: hosts = parts[1:] for host in hosts: - if '.' in host and not host.endswith('.localdomain'): + if ('.' in host and + not host.endswith('.localdomain') and + host != '0.0.0.0'): self._blocked_hosts.add(host) return True diff --git a/tests/unit/browser/test_adblock.py b/tests/unit/browser/test_adblock.py index 8ab3b930d..e4e7a0eda 100644 --- a/tests/unit/browser/test_adblock.py +++ b/tests/unit/browser/test_adblock.py @@ -259,6 +259,33 @@ def test_parsing_multiple_hosts_on_line(config_stub, basedir, download_stub, assert_urls(host_blocker, whitelisted=[]) +@pytest.mark.parametrize('ip, host', [ + ('127.0.0.1', 'localhost'), + ('27.0.0.1', 'localhost.localdomain'), + ('27.0.0.1', 'local'), + ('55.255.255.255', 'broadcasthost'), + (':1', 'localhost'), + (':1', 'ip6-localhost'), + (':1', 'ip6-loopback'), + ('e80::1%lo0', 'localhost'), + ('f00::0', 'ip6-localnet'), + ('f00::0', 'ip6-mcastprefix'), + ('f02::1', 'ip6-allnodes'), + ('f02::2', 'ip6-allrouters'), + ('ff02::3', 'ip6-allhosts'), + ('.0.0.0', '0.0.0.0'), + ('127.0.1.1', 'myhostname'), + ('127.0.0.53', 'myhostname'), +]) +def test_whitelisted_lines(config_stub, basedir, download_stub, data_tmpdir, + tmpdir, win_registry, caplog, ip, host): + """Make sure we don't block hosts we don't want to.""" + host_blocker = adblock.HostBlocker() + line = ('{} {}'.format(ip, host)).encode('ascii') + host_blocker._parse_line(line) + assert host not in host_blocker._blocked_hosts + + def test_failed_dl_update(config_stub, basedir, download_stub, data_tmpdir, tmpdir, win_registry, caplog): """One blocklist fails to download. From 003f667d4f5b4b4ac589ae8cad559d2113d30c86 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 31 Aug 2018 16:49:13 +0200 Subject: [PATCH 293/324] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 95815279b..8ffdc6a35 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -64,6 +64,7 @@ Fixed - The `content.webrtc_public_interfaces_only` option didn't work on Qt 5.11 previously (it now does). Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2. - Repeated escaping of entries in `qute://log` when refreshing page. +- The host blocker doesn't block 0.0.0.0 anymore. v1.4.1 ------ From 3fa6d948935d7e8a11db91c9bfc8f90cfd31acb1 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Fri, 31 Aug 2018 20:36:22 +0200 Subject: [PATCH 294/324] Display value when calling :set without a value This change brings Qutebrowser closer to Vim's behavior of `:set foo?` *and* `:set foo` displaying the current value of `foo`. --- doc/help/commands.asciidoc | 2 +- qutebrowser/config/configcommands.py | 8 ++++---- tests/unit/config/test_configcommands.py | 21 +++++++++------------ 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 04cf5f318..4b4ad54bc 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -1139,7 +1139,7 @@ Syntax: +:set [*--temp*] [*--print*] [*--pattern* 'pattern'] ['option'] ['value' Set an option. -If the option name ends with '?', the value of the option is shown instead. Using :set without any arguments opens a page where settings can be changed interactively. +If the option name ends with '?' or no value is provided, the value of the option is shown instead. Using :set without any arguments opens a page where settings can be changed interactively. ==== positional arguments * +'option'+: The name of the option. diff --git a/qutebrowser/config/configcommands.py b/qutebrowser/config/configcommands.py index 792eacaf0..2d8ccd547 100644 --- a/qutebrowser/config/configcommands.py +++ b/qutebrowser/config/configcommands.py @@ -85,8 +85,8 @@ class ConfigCommands: *, pattern=None): """Set an option. - If the option name ends with '?', the value of the option is shown - instead. + If the option name ends with '?' or no value is provided, the + value of the option is shown instead. Using :set without any arguments opens a page where settings can be changed interactively. @@ -97,6 +97,7 @@ class ConfigCommands: pattern: The URL pattern to use. temp: Set value temporarily until qutebrowser is closed. print_: Print the value after setting. + """ if option is None: tabbed_browser = objreg.get('tabbed-browser', scope='window', @@ -116,8 +117,7 @@ class ConfigCommands: with self._handle_config_error(): if value is None: - raise cmdexc.CommandError("set: The following arguments " - "are required: value") + self._print_value(option, pattern=pattern) else: self._config.set_str(option, value, pattern=pattern, save_yaml=not temp) diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 77097d851..9da480b75 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -61,13 +61,14 @@ class TestSet: commands.set(win_id=0) assert tabbed_browser_stubs[0].opened_url == QUrl('qute://settings') - def test_get(self, config_stub, commands, message_mock): - """Run ':set url.auto_search?'. + @pytest.mark.parametrize('option', ['url.auto_search?', 'url.auto_search']) + def test_get(self, config_stub, commands, message_mock, option): + """Run ':set url.auto_search?' / ':set url.auto_search?'. Should show the value. """ config_stub.val.url.auto_search = 'never' - commands.set(win_id=0, option='url.auto_search?') + commands.set(win_id=0, option=option) msg = message_mock.getmsg(usertypes.MessageLevel.info) assert msg.text == 'url.auto_search = never' @@ -183,17 +184,13 @@ class TestSet: "not available with the QtWebEngine backend!"): commands.set(0, 'hints.find_implementation', 'javascript') - @pytest.mark.parametrize('option', ['?', 'url.auto_search']) - def test_empty(self, commands, option): - """Run ':set ?' / ':set url.auto_search'. - - Should show an error. + def test_empty(self, commands): + """Run ':set ?'. + Should show an error. See https://github.com/qutebrowser/qutebrowser/issues/1109 """ - with pytest.raises(cmdexc.CommandError, - match="The following arguments are required: " - "value"): - commands.set(win_id=0, option=option) + with pytest.raises(cmdexc.CommandError, match="No option '?'"): + commands.set(win_id=0, option='?') def test_toggle(self, commands): """Try toggling a value. From 5f10c9c15f534a51fd3896335b051462a56eab89 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 1 Sep 2018 22:17:22 +0200 Subject: [PATCH 295/324] Make rcorre codeowners line recursive --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d7da20300..1bc570a7e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ qutebrowser/browser/history.py @rcorre -qutebrowser/completion/* @rcorre +qutebrowser/completion/** @rcorre qutebrowser/misc/sql.py @rcorre tests/end2end/features/completion.feature @rcorre tests/end2end/features/test_completion_bdd.py @rcorre From 67b4b7d490b901a494b62c3b44833a247eabfa34 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 11:58:34 +0200 Subject: [PATCH 296/324] Handle :// as URL pattern --- doc/changelog.asciidoc | 1 + qutebrowser/utils/urlmatch.py | 4 +++- tests/unit/utils/test_urlmatch.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 8ffdc6a35..a8461c2bb 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -65,6 +65,7 @@ Fixed Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2. - Repeated escaping of entries in `qute://log` when refreshing page. - The host blocker doesn't block 0.0.0.0 anymore. +- Crash when using :// as URL pattern v1.4.1 ------ diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index 02db96e33..79e02c37f 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -142,7 +142,9 @@ class UrlPattern: Deviation from Chromium: - We assume * when no scheme has been given. """ - assert parsed.scheme, parsed + if not parsed.scheme: + raise ParseError("Missing scheme") + if parsed.scheme == 'any': self._scheme = None return diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index b77588469..e569c51b8 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -96,7 +96,7 @@ from qutebrowser.utils import urlmatch ("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:bb88:edac"; host = ""'), ("http://[fc2e:bb88:edac::z]", 'Invalid IPv6 address; source was "fc2e:bb88:edac::z"; host = ""'), ("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"), - + ("://", "Missing scheme"), ]) def test_invalid_patterns(pattern, error): with pytest.raises(urlmatch.ParseError, match=re.escape(error)): From 3a13614d0e1267818d3d8beb26ad645523d9262e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 12:10:07 +0200 Subject: [PATCH 297/324] Fix none_ok description in BaseType --- qutebrowser/config/configtypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 619dfd71d..7b7889ebe 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -123,7 +123,7 @@ class BaseType: """A type used for a setting value. Attributes: - none_ok: Whether to convert to None for an empty string. + none_ok: Whether to allow None (or an empty string for :set) as value. Class attributes: valid_values: Possible values if they can be expressed as a fixed From 46b430c95bf89ffe2656a02537c2d0452e120561 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 14:50:42 +0200 Subject: [PATCH 298/324] Update changelog for v1.4.2 --- doc/changelog.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index a8461c2bb..c419b98a2 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -38,8 +38,8 @@ Changed - `Command` or `Cmd` can now be used (instead of `Meta`) to map the Command key on macOS. -v1.4.2 (unreleased) -------------------- +v1.4.2 +------ Changed ~~~~~~~ @@ -65,7 +65,7 @@ Fixed Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2. - Repeated escaping of entries in `qute://log` when refreshing page. - The host blocker doesn't block 0.0.0.0 anymore. -- Crash when using :// as URL pattern +- Crash when using :// as URL pattern. v1.4.1 ------ From a7775ffc2d805b7f97c152ee7489cb4e8a764714 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 14:52:30 +0200 Subject: [PATCH 299/324] Release v1.4.2 --- qutebrowser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/__init__.py b/qutebrowser/__init__.py index fab8a5fae..e75b2755d 100644 --- a/qutebrowser/__init__.py +++ b/qutebrowser/__init__.py @@ -26,7 +26,7 @@ __copyright__ = "Copyright 2014-2018 Florian Bruhin (The Compiler)" __license__ = "GPL" __maintainer__ = __author__ __email__ = "mail@qutebrowser.org" -__version_info__ = (1, 4, 1) +__version_info__ = (1, 4, 2) __version__ = '.'.join(str(e) for e in __version_info__) __description__ = "A keyboard-driven, vim-like browser based on PyQt5." From e8937b55f25e1d2355b86841cb6349e1c3d525a7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 14:56:09 +0200 Subject: [PATCH 300/324] Fix up changelog for v1.4.2 --- doc/changelog.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index c419b98a2..3c8cb7f3e 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -66,6 +66,7 @@ Fixed - Repeated escaping of entries in `qute://log` when refreshing page. - The host blocker doesn't block 0.0.0.0 anymore. - Crash when using :// as URL pattern. +- The `:buffer` completion now sorts tabs with indices >= 10 correctly again. v1.4.1 ------ @@ -90,7 +91,6 @@ Fixed - The Windows installer now uninstalls the old version before installing the new one, fixing issues with qutebrowser not starting after installing v1.4.0 over v1.3.3. -- The `:buffer` completion now sorts tabs with indices >= 10 correctly again. v1.4.0 ------ From 5b0c10d43049782a4f889a61776bef471b6f2d9b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 15:46:57 +0200 Subject: [PATCH 301/324] Fix docstrings --- qutebrowser/config/configcommands.py | 1 - tests/unit/config/test_configcommands.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/config/configcommands.py b/qutebrowser/config/configcommands.py index 2d8ccd547..10e16c370 100644 --- a/qutebrowser/config/configcommands.py +++ b/qutebrowser/config/configcommands.py @@ -97,7 +97,6 @@ class ConfigCommands: pattern: The URL pattern to use. temp: Set value temporarily until qutebrowser is closed. print_: Print the value after setting. - """ if option is None: tabbed_browser = objreg.get('tabbed-browser', scope='window', diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 9da480b75..f70586152 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -63,7 +63,7 @@ class TestSet: @pytest.mark.parametrize('option', ['url.auto_search?', 'url.auto_search']) def test_get(self, config_stub, commands, message_mock, option): - """Run ':set url.auto_search?' / ':set url.auto_search?'. + """Run ':set url.auto_search?' / ':set url.auto_search'. Should show the value. """ @@ -186,7 +186,8 @@ class TestSet: def test_empty(self, commands): """Run ':set ?'. - Should show an error. + + Should show an error. See https://github.com/qutebrowser/qutebrowser/issues/1109 """ with pytest.raises(cmdexc.CommandError, match="No option '?'"): From f0287591250df788eff16427955c83abedf665c4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Sep 2018 15:47:53 +0200 Subject: [PATCH 302/324] Update changelog --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 3c8cb7f3e..6c19e0e4f 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -37,6 +37,8 @@ Changed - The `app_id` is now set to `qutebrowser` for Wayland. - `Command` or `Cmd` can now be used (instead of `Meta`) to map the Command key on macOS. +- Using `:set option` now shows the value of the setting (like `:set option?` + already did). v1.4.2 ------ From adfcf6acd7d675936d02f2089d33fd7da1d61cb8 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:13 +0200 Subject: [PATCH 303/324] Update certifi from 2018.8.13 to 2018.8.24 --- misc/requirements/requirements-codecov.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-codecov.txt b/misc/requirements/requirements-codecov.txt index 8438d8d6d..efd023ea6 100644 --- a/misc/requirements/requirements-codecov.txt +++ b/misc/requirements/requirements-codecov.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -certifi==2018.8.13 +certifi==2018.8.24 chardet==3.0.4 codecov==2.0.15 coverage==4.5.1 From 0dbdd4a410b506de862555646be41baa0403efec Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:14 +0200 Subject: [PATCH 304/324] Update certifi from 2018.8.13 to 2018.8.24 --- misc/requirements/requirements-pylint-master.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 2354aa7af..708265f65 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -e git+https://github.com/PyCQA/astroid.git#egg=astroid -certifi==2018.8.13 +certifi==2018.8.24 chardet==3.0.4 github3.py==1.1.0 idna==2.7 From 0e7053affee41340b160eee23b382942c6e1c239 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:16 +0200 Subject: [PATCH 305/324] Update certifi from 2018.8.13 to 2018.8.24 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index d28cba076..12a2d61b9 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py astroid==2.0.4 -certifi==2018.8.13 +certifi==2018.8.24 chardet==3.0.4 github3.py==1.1.0 idna==2.7 From aad42aca6337458d6451895524a61cf7713fabc5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:17 +0200 Subject: [PATCH 306/324] Update attrs from 18.1.0 to 18.2.0 --- misc/requirements/requirements-flake8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index c2f721fdf..1a87da1cd 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -attrs==18.1.0 +attrs==18.2.0 flake8==3.5.0 flake8-bugbear==18.8.0 flake8-builtins==1.4.1 # rq.filter: != 1.4.0 From 4f5dec0dc2fd2b64b980365fdffab43940560921 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:19 +0200 Subject: [PATCH 307/324] Update attrs from 18.1.0 to 18.2.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index bfca4321f..6bbdf656c 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py atomicwrites==1.1.5 -attrs==18.1.0 +attrs==18.2.0 backports.functools-lru-cache==1.5 beautifulsoup4==4.6.3 cheroot==6.4.0 From d787f858430b4c81a0db0ea0f64a01d6d1609517 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:20 +0200 Subject: [PATCH 308/324] Update attrs from 18.1.0 to 18.2.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b5328b5da..c54d143a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -attrs==18.1.0 +attrs==18.2.0 colorama==0.3.9 cssutils==1.0.2 Jinja2==2.10 From 48711c380339c1bbc7d80ed08fc960d96d862674 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:22 +0200 Subject: [PATCH 309/324] Update typing from 3.6.4 to 3.6.6 --- misc/requirements/requirements-flake8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index 1a87da1cd..8ae3ac64d 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -24,4 +24,4 @@ pydocstyle==2.1.1 pyflakes==2.0.0 six==1.11.0 snowballstemmer==1.2.1 -typing==3.6.4 +typing==3.6.6 From 7c1f46134a6d7748707fa663c2ee83fe3f169413 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:23 +0200 Subject: [PATCH 310/324] Update typing from 3.6.4 to 3.6.6 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 12a2d61b9..c0b62d6b5 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -14,7 +14,7 @@ python-dateutil==2.7.3 requests==2.19.1 six==1.11.0 typed-ast==1.1.0 -typing==3.6.4 +typing==3.6.6 uritemplate==3.0.0 urllib3==1.23 wrapt==1.10.11 From f27f2f2ae1ebe9855d56013d047b61a99309560b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:25 +0200 Subject: [PATCH 311/324] Update setuptools from 40.1.0 to 40.2.0 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 00e25abed..a399c0b47 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==17.1 pyparsing==2.2.0 -setuptools==40.1.0 +setuptools==40.2.0 six==1.11.0 wheel==0.31.1 From 202bac485a8a9180c4635ed43fb4fd4ada02e52d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:26 +0200 Subject: [PATCH 312/324] Update macholib from 1.10 to 1.11 --- misc/requirements/requirements-pyinstaller.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index 8882ead87..aa9aebeb6 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -2,6 +2,6 @@ altgraph==0.16.1 future==0.16.0 -macholib==1.10 +macholib==1.11 pefile==2018.8.8 PyInstaller==3.3.1 From 9205f68f9c35c9cc10cf58f61802ba82df87e754 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:28 +0200 Subject: [PATCH 313/324] Update github3.py from 1.1.0 to 1.2.0 --- misc/requirements/requirements-pylint-master.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 708265f65..9f471f56b 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -3,7 +3,7 @@ -e git+https://github.com/PyCQA/astroid.git#egg=astroid certifi==2018.8.24 chardet==3.0.4 -github3.py==1.1.0 +github3.py==1.2.0 idna==2.7 isort==4.3.4 lazy-object-proxy==1.3.1 From bc1296f55e03defc1c649eff1d035749dbb215d2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:29 +0200 Subject: [PATCH 314/324] Update github3.py from 1.1.0 to 1.2.0 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index c0b62d6b5..39dfd025f 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -3,7 +3,7 @@ astroid==2.0.4 certifi==2018.8.24 chardet==3.0.4 -github3.py==1.1.0 +github3.py==1.2.0 idna==2.7 isort==4.3.4 lazy-object-proxy==1.3.1 From 998a55844a77d25308115fd9cc427110508bd675 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:31 +0200 Subject: [PATCH 315/324] Update atomicwrites from 1.1.5 to 1.2.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 6bbdf656c..a9217dc14 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -atomicwrites==1.1.5 +atomicwrites==1.2.0 attrs==18.2.0 backports.functools-lru-cache==1.5 beautifulsoup4==4.6.3 From 3026f1472957d1726ed902bf013d0c01bf394208 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:32 +0200 Subject: [PATCH 316/324] Update cheroot from 6.4.0 to 6.5.2 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index a9217dc14..7f95140b6 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -4,7 +4,7 @@ atomicwrites==1.2.0 attrs==18.2.0 backports.functools-lru-cache==1.5 beautifulsoup4==4.6.3 -cheroot==6.4.0 +cheroot==6.5.2 click==6.7 # colorama==0.3.9 coverage==4.5.1 From c9f049a886579e429da006720cec7255d29907a0 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:34 +0200 Subject: [PATCH 317/324] Update hypothesis from 3.69.0 to 3.70.3 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 7f95140b6..a0eeb3b4e 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.69.0 +hypothesis==3.70.3 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 9e93009d54ea04bcf16a16a256a33a6174fb7dac Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:35 +0200 Subject: [PATCH 318/324] Update py from 1.5.4 to 1.6.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index a0eeb3b4e..5aa33b3a3 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -22,7 +22,7 @@ more-itertools==4.3.0 parse==1.8.4 parse-type==0.4.2 pluggy==0.7.1 -py==1.5.4 +py==1.6.0 py-cpuinfo==4.0.0 pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2 pytest-bdd==2.21.0 From fc29f027c727a0926a21f4944fdaec4b68814169 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:37 +0200 Subject: [PATCH 319/324] Update py from 1.5.4 to 1.6.0 --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index 88dd1191d..3f6d3d09c 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -2,7 +2,7 @@ packaging==17.1 pluggy==0.7.1 -py==1.5.4 +py==1.6.0 pyparsing==2.2.0 six==1.11.0 tox==3.2.1 From c8e143cdb8773958a2f19d54e54e8ac7263fd990 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:38 +0200 Subject: [PATCH 320/324] Update pytest from 3.6.4 to 3.7.4 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 5aa33b3a3..5688744a1 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.6.0 py-cpuinfo==4.0.0 -pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2 +pytest==3.7.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 From c896444289182237200aa43cd61e6a3a302df447 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:40 +0200 Subject: [PATCH 321/324] Update pytest-qt from 3.0.0 to 3.0.2 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 5688744a1..9807e104b 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -31,7 +31,7 @@ pytest-cov==2.5.1 pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 -pytest-qt==3.0.0 +pytest-qt==3.0.2 pytest-repeat==0.6.0 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 From 6a323c9fda15b0733f517f97809d1b39bee659ab Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Sep 2018 19:42:41 +0200 Subject: [PATCH 322/324] Update pytest-repeat from 0.6.0 to 0.7.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 9807e104b..d80ae5d56 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -32,7 +32,7 @@ pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 pytest-qt==3.0.2 -pytest-repeat==0.6.0 +pytest-repeat==0.7.0 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 pytest-xvfb==1.1.0 From e9370aeed4f1e0f85377e25f3f5fdbc1cc73901f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Sep 2018 19:55:01 +0200 Subject: [PATCH 323/324] Filter pytest 3.7.3/3.7.4 --- misc/requirements/requirements-tests.txt | 2 +- misc/requirements/requirements-tests.txt-raw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index d80ae5d56..68d30cefa 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -24,7 +24,7 @@ parse-type==0.4.2 pluggy==0.7.1 py==1.6.0 py-cpuinfo==4.0.0 -pytest==3.7.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2 +pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2, != 3.7.3, != 3.7.4 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 diff --git a/misc/requirements/requirements-tests.txt-raw b/misc/requirements/requirements-tests.txt-raw index eac1381d4..2d1c378a1 100644 --- a/misc/requirements/requirements-tests.txt-raw +++ b/misc/requirements/requirements-tests.txt-raw @@ -19,4 +19,4 @@ pytest-xvfb vulture #@ ignore: Jinja2, MarkupSafe, colorama -#@ filter: pytest != 3.7, != 3.7.1, != 3.7.2 +#@ filter: pytest != 3.7, != 3.7.1, != 3.7.2, != 3.7.3, != 3.7.4 From a565fc62e47c371444472d02430be184595ebdaa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Sep 2018 20:06:18 +0200 Subject: [PATCH 324/324] Rebuild all requirements files --- misc/requirements/requirements-pylint-master.txt | 5 +++++ misc/requirements/requirements-pylint.txt | 7 +++++-- misc/requirements/requirements-tests.txt | 2 +- misc/requirements/requirements-tox.txt | 2 -- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 9f471f56b..6386505fc 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -1,13 +1,18 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +asn1crypto==0.24.0 -e git+https://github.com/PyCQA/astroid.git#egg=astroid certifi==2018.8.24 +cffi==1.11.5 chardet==3.0.4 +cryptography==2.3.1 github3.py==1.2.0 idna==2.7 isort==4.3.4 +jwcrypto==0.5.0 lazy-object-proxy==1.3.1 mccabe==0.6.1 +pycparser==2.18 -e git+https://github.com/PyCQA/pylint.git#egg=pylint python-dateutil==2.7.3 ./scripts/dev/pylint_checkers diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 39dfd025f..d7be3955b 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,20 +1,23 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +asn1crypto==0.24.0 astroid==2.0.4 certifi==2018.8.24 +cffi==1.11.5 chardet==3.0.4 +cryptography==2.3.1 github3.py==1.2.0 idna==2.7 isort==4.3.4 +jwcrypto==0.5.0 lazy-object-proxy==1.3.1 mccabe==0.6.1 +pycparser==2.18 pylint==2.1.1 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.19.1 six==1.11.0 -typed-ast==1.1.0 -typing==3.6.6 uritemplate==3.0.0 urllib3==1.23 wrapt==1.10.11 diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 68d30cefa..c727ad736 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -atomicwrites==1.2.0 +atomicwrites==1.2.1 attrs==18.2.0 backports.functools-lru-cache==1.5 beautifulsoup4==4.6.3 diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index 3f6d3d09c..398de75bf 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -1,9 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -packaging==17.1 pluggy==0.7.1 py==1.6.0 -pyparsing==2.2.0 six==1.11.0 tox==3.2.1 virtualenv==16.0.0