Try using tab.reload() on setting changes instead
This commit is contained in:
parent
08bc55995b
commit
bfb3a6594f
@ -879,10 +879,16 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
if not ok and not self.settings.test_attribute('content.javascript.enabled'):
|
if not ok and not self.settings.test_attribute('content.javascript.enabled'):
|
||||||
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66643
|
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66643
|
||||||
self._show_error_page(self.url(), error="")
|
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
|
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66656
|
||||||
QTimer.singleShot(100, lambda url=self._reload_url:
|
log.config.debug(
|
||||||
self.openurl(url))
|
"Reloading {} on {} because of config change".format(
|
||||||
|
self._reload_url.toDisplayString(), url.toDisplayString()))
|
||||||
|
self.reload()
|
||||||
self._reload_url = None
|
self._reload_url = None
|
||||||
|
|
||||||
@pyqtSlot(usertypes.NavigationRequest)
|
@pyqtSlot(usertypes.NavigationRequest)
|
||||||
@ -891,7 +897,6 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
if navigation.accepted and navigation.is_main_frame:
|
if navigation.accepted and navigation.is_main_frame:
|
||||||
changed = self.settings.update_for_url(navigation.url)
|
changed = self.settings.update_for_url(navigation.url)
|
||||||
if changed & {'content.plugins', 'content.javascript.enabled'}:
|
if changed & {'content.plugins', 'content.javascript.enabled'}:
|
||||||
navigation.accepted = False
|
|
||||||
self._reload_url = navigation.url
|
self._reload_url = navigation.url
|
||||||
|
|
||||||
def _connect_signals(self):
|
def _connect_signals(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user