diff options
author | Florian Bruhin <git@the-compiler.org> | 2016-06-09 14:42:26 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2016-06-09 21:14:03 +0200 |
commit | d5abfa3d0d20c292986e0be45d80dddb6cd0d475 (patch) | |
tree | d956701d49dbafd306f369e39f2d9b9b7fadada6 | |
parent | 9510af9912f06193065bdc5db63e4f4847a80f77 (diff) | |
download | qutebrowser-d5abfa3d0d20c292986e0be45d80dddb6cd0d475.tar.gz qutebrowser-d5abfa3d0d20c292986e0be45d80dddb6cd0d475.zip |
Check if original URL is valid
-rw-r--r-- | qutebrowser/browser/webview.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index 9fbebf78f..36c3f508f 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -150,8 +150,9 @@ class WebView(QWebView): def on_initial_layout_completed(self): """Add url to history now that we have displayed something.""" history = objreg.get('web-history') - if not self._orig_url.matches(self.cur_url, - QUrl.UrlFormattingOption(0)): + no_formatting = QUrl.UrlFormattingOption(0) + if (self._orig_url.isValid() and + not self._orig_url.matches(self.cur_url, no_formatting)): # 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, self.title(), hidden=True) |