summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-01-16 20:46:34 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-01-16 20:54:14 +0100
commit53859b68e59a05fdf0641eab6e8a2d7834274f92 (patch)
treedb354f09e5f91036dbaca882d1884e5d3df8ac38
parentb04166ff9a717b9e3f18378a4eb224c66c8c9d66 (diff)
downloadqutebrowser-53859b68e59a05fdf0641eab6e8a2d7834274f92.tar.gz
qutebrowser-53859b68e59a05fdf0641eab6e8a2d7834274f92.zip
Work around InstalledApp renderer process crash
Closes #5997
-rw-r--r--doc/changelog.asciidoc3
-rw-r--r--qutebrowser/config/qtargs.py6
-rw-r--r--tests/end2end/data/crashers/installedapp.html12
-rw-r--r--tests/end2end/features/misc.feature4
-rw-r--r--tests/unit/config/test_qtargs.py31
5 files changed, 52 insertions, 4 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index b22f5e8ee..02ac2aad2 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -183,6 +183,9 @@ Fixed
instead of crashing.
- A couple of long URLs (such as `qute://pdfjs` URLs) are now not added to the
history database anymore.
+- A bug in QtWebEngine 5.15.2 causes "renderer process killed" errors on
+ websites like LinkedIn and TradingView. There is now a workaround in qutebrowser
+ to prevent this from happening.
v1.14.1 (2020-12-04)
--------------------
diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py
index b263de541..f22a2a6be 100644
--- a/qutebrowser/config/qtargs.py
+++ b/qutebrowser/config/qtargs.py
@@ -132,6 +132,12 @@ def _qtwebengine_features(
# https://chromium-review.googlesource.com/c/chromium/src/+/2545444
enabled_features.append('ReducedReferrerGranularity')
+ if qtutils.version_check('5.15.2', compiled=False, exact=True):
+ # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-89740
+ # FIXME Not needed anymore with QtWebEngne 5.15.3 (or Qt 6), but we'll probably
+ # have no way to detect that...
+ disabled_features.append('InstalledApp')
+
return (enabled_features, disabled_features)
diff --git a/tests/end2end/data/crashers/installedapp.html b/tests/end2end/data/crashers/installedapp.html
new file mode 100644
index 000000000..4fc2a5bfc
--- /dev/null
+++ b/tests/end2end/data/crashers/installedapp.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+
+<html lang="en">
+ <head>
+ <title>Should crash immediately</title>
+ <meta charset="UTF-8"/>
+ </head>
+ <body>
+ <p>Should crash immediately</p>
+ <script>navigator.getInstalledRelatedApps();</script>
+ </body>
+</html>
diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature
index 4269f9649..d9a1f747c 100644
--- a/tests/end2end/features/misc.feature
+++ b/tests/end2end/features/misc.feature
@@ -544,6 +544,10 @@ Feature: Various utility commands.
And I wait until data/crashers/webrtc.html is loaded
Then "Renderer process crashed" should not be logged
+ Scenario: InstalledApps crash
+ When I open data/crashers/installedapp.html
+ Then "Renderer process was killed" should not be logged
+
## Other
Scenario: Resource with invalid URL
diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py
index d8546fe30..4adb33527 100644
--- a/tests/unit/config/test_qtargs.py
+++ b/tests/unit/config/test_qtargs.py
@@ -391,12 +391,12 @@ class TestQtArgs:
@pytest.mark.parametrize('via_commandline', [True, False])
@pytest.mark.parametrize('passed_features', [
- 'CustomFeature',
- 'CustomFeature1,CustomFeature2',
+ ['CustomFeature'],
+ ['CustomFeature1', 'CustomFeature2'],
])
def test_disable_features_passthrough(self, config_stub, parser, feature_flag_patch,
via_commandline, passed_features):
- flag = qtargs._DISABLE_FEATURES + passed_features
+ flag = qtargs._DISABLE_FEATURES + ','.join(passed_features)
config_flag = flag.lstrip('-')
config_stub.val.qt.args = ([] if via_commandline else [config_flag])
@@ -408,7 +408,30 @@ class TestQtArgs:
arg for arg in args
if arg.startswith(qtargs._DISABLE_FEATURES)
]
- assert disable_features_args == [flag]
+ assert len(disable_features_args) == 1
+ features = set(disable_features_args[0].split('=')[1].split(','))
+ features -= {'InstalledApp'}
+ assert features == set(passed_features)
+
+ @pytest.mark.parametrize('qt_version, has_workaround', [
+ ('5.14.0', False),
+ ('5.15.1', False),
+ ('5.15.2', True),
+ ('5.15.3', False),
+ ('6.0.0', False),
+ ])
+ def test_installedapp_workaround(self, parser, monkeypatch, qt_version, has_workaround):
+ monkeypatch.setattr(qtargs.qtutils, 'qVersion', lambda: qt_version)
+
+ parsed = parser.parse_args([])
+ args = qtargs.qt_args(parsed)
+ disable_features_args = [
+ arg for arg in args
+ if arg.startswith(qtargs._DISABLE_FEATURES)
+ ]
+
+ expected = ['--disable-features=InstalledApp'] if has_workaround else []
+ assert disable_features_args == expected
def test_blink_settings(self, config_stub, monkeypatch, parser):
from qutebrowser.browser.webengine import darkmode