Adjust for _WebEngineScripts move
This commit is contained in:
parent
7141f9a2be
commit
394d91a11b
@ -812,15 +812,6 @@ class AbstractTab(QWidget):
|
||||
self.title_changed.emit(url.toDisplayString())
|
||||
self.url_changed.emit(url)
|
||||
|
||||
url = self.url(requested=True)
|
||||
|
||||
# Ignore blank QUrls to avoid crashes.
|
||||
if not url.isValid():
|
||||
log.webview.debug("Not updating per-domain stylesheets due to the QUrl being blank")
|
||||
return
|
||||
|
||||
self._update_stylesheet(url)
|
||||
|
||||
@pyqtSlot()
|
||||
def _on_load_started(self):
|
||||
self._progress = 0
|
||||
|
@ -790,14 +790,32 @@ class _WebEngineScripts(QObject):
|
||||
|
||||
def connect_signals(self):
|
||||
config.instance.changed.connect(self._on_config_changed)
|
||||
self._tab.url_changed.connect(self._update_stylesheet)
|
||||
self._tab.load_finished.connect(self._on_load_finished)
|
||||
|
||||
@pyqtSlot(str)
|
||||
def _on_config_changed(self, option):
|
||||
if option in ['scrolling.bar', 'content.user_stylesheets']:
|
||||
self._init_stylesheet()
|
||||
url = self.url(requested=True)
|
||||
url = self._tab.url(requested=True)
|
||||
self._update_stylesheet(url=url)
|
||||
|
||||
@pyqtSlot()
|
||||
def _on_url_changed(self):
|
||||
requested_url = self._tab.url(requested=True)
|
||||
|
||||
# Ignore blank QUrls to avoid crashes.
|
||||
if not requested_url.isValid():
|
||||
log.webview.debug("Not updating per-domain stylesheets due to the QUrl being blank")
|
||||
return
|
||||
|
||||
self._update_stylesheet(requested_url)
|
||||
|
||||
@pyqtSlot()
|
||||
def _on_load_finished(self):
|
||||
url = self._tab.url(requested=True)
|
||||
self._update_stylesheet(url)
|
||||
|
||||
def _update_stylesheet(self, url=None):
|
||||
"""Update the custom stylesheet in existing tabs."""
|
||||
css = shared.get_user_stylesheet(url=url)
|
||||
@ -1226,9 +1244,6 @@ class WebEngineTab(browsertab.AbstractTab):
|
||||
# the old icon is still displayed.
|
||||
self.icon_changed.emit(QIcon())
|
||||
|
||||
url = self.url(requested=True)
|
||||
self._update_stylesheet(url)
|
||||
|
||||
@pyqtSlot(QUrl)
|
||||
def _on_predicted_navigation(self, url):
|
||||
"""If we know we're going to visit an URL soon, change the settings.
|
||||
|
Loading…
Reference in New Issue
Block a user