Add workaround for missing per-domain setting changes

Fixes #4920
This commit is contained in:
Florian Bruhin 2020-01-20 20:07:23 +01:00
parent 923ab2687b
commit f8aec212c8
2 changed files with 17 additions and 0 deletions

View File

@ -56,6 +56,8 @@ Fixed
- When quitting qutebrowser, components are now cleaned up differently. This
should fix certain (rare) segmentation faults and exceptions when quitting,
especially with the new exit scheme introduced in in PyQt5 5.13.1.
- Added a workaround for per-domain settings (e.g. a JavaScript whitelist) not
being applied in some scenarios with Qt 5.13 and above.
v1.9.0 (2020-01-08)
-------------------

View File

@ -1490,6 +1490,21 @@ class WebEngineTab(browsertab.AbstractTab):
except browsertab.WebTabError as e:
message.error(str(e))
@pyqtSlot(QUrl)
def _on_url_changed(self, url: QUrl) -> None:
"""Update settings for the current URL.
Normally this is done below in _on_navigation_request, but we also need
to do it here as WORKAROUND for
https://bugreports.qt.io/browse/QTBUG-77137
Since update_for_url() is idempotent, it doesn't matter much if we end
up doing it twice.
"""
super()._on_url_changed(url)
if url.isValid() and qtutils.version_check('5.13'):
self.settings.update_for_url(url)
@pyqtSlot(usertypes.NavigationRequest)
def _on_navigation_request(self, navigation):
super()._on_navigation_request(navigation)