Add tab.url(requested=True) to get original URL
This commit is contained in:
parent
81eb53a152
commit
eed3460317
@ -542,7 +542,7 @@ class AbstractTab(QWidget):
|
|||||||
def _on_ssl_errors(self):
|
def _on_ssl_errors(self):
|
||||||
self._has_ssl_errors = True
|
self._has_ssl_errors = True
|
||||||
|
|
||||||
def url(self):
|
def url(self, requested=False):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def progress(self):
|
def progress(self):
|
||||||
|
@ -363,8 +363,12 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
self._openurl_prepare(url)
|
self._openurl_prepare(url)
|
||||||
self._widget.load(url)
|
self._widget.load(url)
|
||||||
|
|
||||||
def url(self):
|
def url(self, requested=False):
|
||||||
return self._widget.url()
|
page = self._widget.page()
|
||||||
|
if requested:
|
||||||
|
return page.requestedUrl()
|
||||||
|
else:
|
||||||
|
return page.url()
|
||||||
|
|
||||||
def dump_async(self, callback, *, plain=False):
|
def dump_async(self, callback, *, plain=False):
|
||||||
if plain:
|
if plain:
|
||||||
|
@ -514,8 +514,12 @@ class WebKitTab(browsertab.AbstractTab):
|
|||||||
self._openurl_prepare(url)
|
self._openurl_prepare(url)
|
||||||
self._widget.openurl(url)
|
self._widget.openurl(url)
|
||||||
|
|
||||||
def url(self):
|
def url(self, requested=False):
|
||||||
return self._widget.url()
|
frame = self._widget.page().mainFrame()
|
||||||
|
if requested:
|
||||||
|
return frame.requestedUrl()
|
||||||
|
else:
|
||||||
|
return frame.url()
|
||||||
|
|
||||||
def dump_async(self, callback, *, plain=False):
|
def dump_async(self, callback, *, plain=False):
|
||||||
frame = self._widget.page().mainFrame()
|
frame = self._widget.page().mainFrame()
|
||||||
|
Loading…
Reference in New Issue
Block a user