From bfb3a6594f0cecd21dfda0a9d89b52113d905d22 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 24 Feb 2018 23:06:18 +0100 Subject: [PATCH] Try using tab.reload() on setting changes instead --- qutebrowser/browser/webengine/webenginetab.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 32a17916b..73e6ec18d 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -879,10 +879,16 @@ class WebEngineTab(browsertab.AbstractTab): if not ok and not self.settings.test_attribute('content.javascript.enabled'): # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66643 self._show_error_page(self.url(), error="") - elif ok and self._reload_url is not None: + + @pyqtSlot(QUrl) + def _on_url_changed(self, url): + super()._on_url_changed(url) + if self._reload_url is not None: # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66656 - QTimer.singleShot(100, lambda url=self._reload_url: - self.openurl(url)) + log.config.debug( + "Reloading {} on {} because of config change".format( + self._reload_url.toDisplayString(), url.toDisplayString())) + self.reload() self._reload_url = None @pyqtSlot(usertypes.NavigationRequest) @@ -891,7 +897,6 @@ class WebEngineTab(browsertab.AbstractTab): if navigation.accepted and navigation.is_main_frame: changed = self.settings.update_for_url(navigation.url) if changed & {'content.plugins', 'content.javascript.enabled'}: - navigation.accepted = False self._reload_url = navigation.url def _connect_signals(self):