From f17d4388fd79e74a094dd1868472361ee64fdea8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Jun 2016 14:43:32 +0200 Subject: [PATCH] Use fully encoded URL for history Otherwise e.g. spaces are literal spaces instead of %20 and the history breaks. --- qutebrowser/browser/webview.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index e21189929..08d1a154a 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -154,8 +154,12 @@ class WebView(QWebView): QUrl.UrlFormattingOption(0)): # If the url of the page is different than the url of the link # originally clicked, save them both. - history.add_url(self._orig_url.toDisplayString(), self.title()) - history.add_url(self.cur_url.toDisplayString(), self.title()) + url = self._orig_url.toString(QUrl.FullyEncoded | + QUrl.RemovePassword) + history.add_url(url, self.title()) + url = self.cur_url.toString(QUrl.FullyEncoded | QUrl.RemovePassword) + + history.add_url(url, self.title()) def _init_page(self): """Initialize the QWebPage used by this view."""