Work around InstalledApp renderer process crash

Closes #5997
This commit is contained in:
Florian Bruhin 2021-01-16 20:46:34 +01:00
parent b04166ff9a
commit 53859b68e5
5 changed files with 52 additions and 4 deletions

View File

@ -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)
--------------------

View File

@ -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)

View File

@ -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>

View File

@ -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

View File

@ -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