Don't use requested URLs
This commit is contained in:
parent
394d91a11b
commit
651ed5247b
@ -797,25 +797,14 @@ class _WebEngineScripts(QObject):
|
||||
def _on_config_changed(self, option):
|
||||
if option in ['scrolling.bar', 'content.user_stylesheets']:
|
||||
self._init_stylesheet()
|
||||
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)
|
||||
self._update_stylesheet(url=self._tab.url())
|
||||
|
||||
@pyqtSlot()
|
||||
def _on_load_finished(self):
|
||||
url = self._tab.url(requested=True)
|
||||
url = self._tab.url()
|
||||
self._update_stylesheet(url)
|
||||
|
||||
@pyqtSlot(QUrl)
|
||||
def _update_stylesheet(self, url=None):
|
||||
"""Update the custom stylesheet in existing tabs."""
|
||||
css = shared.get_user_stylesheet(url=url)
|
||||
|
Loading…
Reference in New Issue
Block a user