Commit cd1e096f authored by Cédric Bellegarde's avatar Cédric Bellegarde

Always show URI on load

parent d9af675d
Pipeline #75285 passed with stage
in 14 minutes and 27 seconds
......@@ -164,7 +164,7 @@ class WebView(WebKit2.WebView):
Set delayed uri
@param uri as str
"""
self.__uri = uri
self._uri = uri
self.emit("uri-changed", uri)
def update_spell_checking(self, uri):
......@@ -402,10 +402,7 @@ class WebView(WebKit2.WebView):
Get uri (loaded or unloaded)
@return str
"""
uri = self.get_uri()
if uri is None:
uri = self.__uri
return uri
return self._uri
@property
def netloc(self):
......@@ -461,7 +458,7 @@ class WebView(WebKit2.WebView):
# it from clipboard FIXME Get it from extensions
self.__selection = ""
self._readable = False
self.__uri = None
self._uri = None
self._initial_uri = None
self._title = None
self.__related_view = related_view
......@@ -617,9 +614,10 @@ class WebViewMeta(WebViewNavigation, WebView, WebViewErrors,
@param webview as WebView
@param event as WebKit2.LoadEvent
"""
self.__uri = webview.get_uri()
if event == WebKit2.LoadEvent.STARTED:
self.__new_pages_opened = 0
WebViewNavigation._on_load_changed(self, webview, event)
WebViewSignals._on_load_changed(self, webview, event)
WebViewArtwork._on_load_changed(self, webview, event)
if event == WebKit2.LoadEvent.STARTED:
self.__new_pages_opened = 0
elif event == WebKit2.LoadEvent.COMMITTED:
self._uri = webview.get_uri()
......@@ -98,7 +98,6 @@ class WebViewNavigation:
"""
parsed = urlparse(self.uri)
if event == WebKit2.LoadEvent.STARTED:
self.emit("uri-changed", self.uri)
if parsed.scheme in ["http", "https"]:
self._initial_uri = self.uri.rstrip('/')
else:
......@@ -366,6 +365,7 @@ class WebViewNavigation:
self.__set_user_agent(navigation_uri)
self.discard_error()
decision.use()
self._uri = navigation_uri
return False
else:
self.new_page(navigation_uri, LoadingType.BACKGROUND)
......
......@@ -127,6 +127,7 @@ class WebViewLoadSignals:
@param event as WebKit2.LoadEvent
"""
parsed = urlparse(self.uri)
self._window.toolbar.title.set_uri(self.uri)
wanted_scheme = parsed.scheme in ["http", "https", "file"]
if event == WebKit2.LoadEvent.STARTED:
self._window.container.current.find_widget.set_search_mode(False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment