{"action":"created","comment":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments/63289366","id":63289366,"diff_hunk":"@@ -145,13 +146,29 @@ def __init__(self, win_id, parent=None):\n         self.loadProgress.connect(lambda p: setattr(self, 'progress', p))\n         objreg.get('config').changed.connect(self.on_config_changed)\n \n+    @pyqtSlot()\n+    def on_initial_layout_complete(self):\n+        \"\"\"Add url to history now that we have displayed something.\"\"\"\n+        history = objreg.get('web-history')\n+        # QUrl.None or .None_ in later versions is from the enum\n+        # QUrl.UrlFormattingOption.\n+        if not self._orig_url.matches(self.cur_url,\n+                                      getattr(QUrl, 'None',\n+                                              getattr(QUrl, 'None_'))):","path":"qutebrowser/browser/webview.py","position":20,"original_position":20,"commit_id":"f557a7ae8045b715868b50b68b1bdb69b45a678f","original_commit_id":"f557a7ae8045b715868b50b68b1bdb69b45a678f","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"body":"This is a bit unfortunate indeed... But `QUrl.UrlFormattingOption(0)` seems to work as well and seems cleaner.","created_at":"2016-05-15T10:11:46Z","updated_at":"2016-05-15T10:11:46Z","html_url":"https://github.com/The-Compiler/qutebrowser/pull/1350#discussion_r63289366","pull_request_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350","_links":{"self":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments/63289366"},"html":{"href":"https://github.com/The-Compiler/qutebrowser/pull/1350#discussion_r63289366"},"pull_request":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350"}}},"pull_request":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350","id":63483282,"html_url":"https://github.com/The-Compiler/qutebrowser/pull/1350","diff_url":"https://github.com/The-Compiler/qutebrowser/pull/1350.diff","patch_url":"https://github.com/The-Compiler/qutebrowser/pull/1350.patch","issue_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1350","number":1350,"state":"open","locked":false,"title":"Switch browsing history away from QWebHistoryInterface and add titles.","user":{"login":"toofar","id":7419144,"avatar_url":"https://avatars.githubusercontent.com/u/7419144?v=3","gravatar_id":"","url":"https://api.github.com/users/toofar","html_url":"https://github.com/toofar","followers_url":"https://api.github.com/users/toofar/followers","following_url":"https://api.github.com/users/toofar/following{/other_user}","gists_url":"https://api.github.com/users/toofar/gists{/gist_id}","starred_url":"https://api.github.com/users/toofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toofar/subscriptions","organizations_url":"https://api.github.com/users/toofar/orgs","repos_url":"https://api.github.com/users/toofar/repos","events_url":"https://api.github.com/users/toofar/events{/privacy}","received_events_url":"https://api.github.com/users/toofar/received_events","type":"User","site_admin":false},"body":"Changes history items to be added when initialLayoutCompleted is fired as opposed to when navigation is initiated. Regarding #1345 this method saves the final url after redirects and doesn't save the url of the redirect.\r\n\r\nThere are some things I am unsure about:\r\n* Encoding. I haven't tested the serialization with unicode titles (and urls) on windows.\r\n* Testing. I was looking at the history behavior for redirects and errors and was wondering if this was worth adding to the test suite and how.\r\n\r\nHere is some comparisons with dwb and otter:\r\n\r\nOtter (for the qtwebkit backend at least) calls handleHistory() at a few\r\nplaces but calls after the first one update an entry instead of adding a new\r\none. It gets called on title changed, navigate (load started I think) and load\r\nfinished. Due to events that would update current url and title not firing for\r\nredirect urls otter saves the originally requested url as url and title into\r\nhistory so if there is a chain of redirects all but the first will be saved\r\nwrong.\r\n\r\ndwb and QupZilla use load finished. They only save the final page on\r\nredirects.\r\n\r\nThis method, the old method, dwb and otter all save the requested url to\r\nhistory on DNS and 404 errors.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/the-compiler/qutebrowser/1350)\n<!-- Reviewable:end -->\n","created_at":"2016-03-20T00:41:36Z","updated_at":"2016-05-15T10:11:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bac9a5b3fbc46484688e199f59c67852441a6d15","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350/commits","review_comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350/comments","review_comment_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1350/comments","statuses_url":"https://api.github.com/repos/The-Compiler/qutebrowser/statuses/f557a7ae8045b715868b50b68b1bdb69b45a678f","head":{"label":"toofar:history-title","ref":"history-title","sha":"f557a7ae8045b715868b50b68b1bdb69b45a678f","user":{"login":"toofar","id":7419144,"avatar_url":"https://avatars.githubusercontent.com/u/7419144?v=3","gravatar_id":"","url":"https://api.github.com/users/toofar","html_url":"https://github.com/toofar","followers_url":"https://api.github.com/users/toofar/followers","following_url":"https://api.github.com/users/toofar/following{/other_user}","gists_url":"https://api.github.com/users/toofar/gists{/gist_id}","starred_url":"https://api.github.com/users/toofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toofar/subscriptions","organizations_url":"https://api.github.com/users/toofar/orgs","repos_url":"https://api.github.com/users/toofar/repos","events_url":"https://api.github.com/users/toofar/events{/privacy}","received_events_url":"https://api.github.com/users/toofar/received_events","type":"User","site_admin":false},"repo":{"id":31693282,"name":"qutebrowser","full_name":"toofar/qutebrowser","owner":{"login":"toofar","id":7419144,"avatar_url":"https://avatars.githubusercontent.com/u/7419144?v=3","gravatar_id":"","url":"https://api.github.com/users/toofar","html_url":"https://github.com/toofar","followers_url":"https://api.github.com/users/toofar/followers","following_url":"https://api.github.com/users/toofar/following{/other_user}","gists_url":"https://api.github.com/users/toofar/gists{/gist_id}","starred_url":"https://api.github.com/users/toofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toofar/subscriptions","organizations_url":"https://api.github.com/users/toofar/orgs","repos_url":"https://api.github.com/users/toofar/repos","events_url":"https://api.github.com/users/toofar/events{/privacy}","received_events_url":"https://api.github.com/users/toofar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/toofar/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit.","fork":true,"url":"https://api.github.com/repos/toofar/qutebrowser","forks_url":"https://api.github.com/repos/toofar/qutebrowser/forks","keys_url":"https://api.github.com/repos/toofar/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toofar/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toofar/qutebrowser/teams","hooks_url":"https://api.github.com/repos/toofar/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/toofar/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/toofar/qutebrowser/events","assignees_url":"https://api.github.com/repos/toofar/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/toofar/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/toofar/qutebrowser/tags","blobs_url":"https://api.github.com/repos/toofar/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toofar/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toofar/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/toofar/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toofar/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/toofar/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/toofar/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/toofar/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/toofar/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/toofar/qutebrowser/subscription","commits_url":"https://api.github.com/repos/toofar/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/toofar/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/toofar/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/toofar/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/toofar/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/toofar/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toofar/qutebrowser/merges","archive_url":"https://api.github.com/repos/toofar/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toofar/qutebrowser/downloads","issues_url":"https://api.github.com/repos/toofar/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/toofar/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/toofar/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/toofar/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toofar/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/toofar/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/toofar/qutebrowser/deployments","created_at":"2015-03-05T03:17:20Z","updated_at":"2016-01-30T01:43:08Z","pushed_at":"2016-05-05T05:45:02Z","git_url":"git://github.com/toofar/qutebrowser.git","ssh_url":"git@github.com:toofar/qutebrowser.git","clone_url":"https://github.com/toofar/qutebrowser.git","svn_url":"https://github.com/toofar/qutebrowser","homepage":null,"size":15920,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"The-Compiler:master","ref":"master","sha":"4a1a87a4dbb078dae26a82492848d994114ba872","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"repo":{"id":21244505,"name":"qutebrowser","full_name":"The-Compiler/qutebrowser","owner":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/The-Compiler/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":false,"url":"https://api.github.com/repos/The-Compiler/qutebrowser","forks_url":"https://api.github.com/repos/The-Compiler/qutebrowser/forks","keys_url":"https://api.github.com/repos/The-Compiler/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/The-Compiler/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/The-Compiler/qutebrowser/teams","hooks_url":"https://api.github.com/repos/The-Compiler/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/The-Compiler/qutebrowser/events","assignees_url":"https://api.github.com/repos/The-Compiler/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/The-Compiler/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/The-Compiler/qutebrowser/tags","blobs_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/The-Compiler/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/The-Compiler/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/The-Compiler/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/The-Compiler/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/The-Compiler/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/The-Compiler/qutebrowser/subscription","commits_url":"https://api.github.com/repos/The-Compiler/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/The-Compiler/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/The-Compiler/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/The-Compiler/qutebrowser/merges","archive_url":"https://api.github.com/repos/The-Compiler/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/The-Compiler/qutebrowser/downloads","issues_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/The-Compiler/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/The-Compiler/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/The-Compiler/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/The-Compiler/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/deployments","created_at":"2014-06-26T14:59:34Z","updated_at":"2016-05-15T05:23:08Z","pushed_at":"2016-05-15T09:54:05Z","git_url":"git://github.com/The-Compiler/qutebrowser.git","ssh_url":"git@github.com:The-Compiler/qutebrowser.git","clone_url":"https://github.com/The-Compiler/qutebrowser.git","svn_url":"https://github.com/The-Compiler/qutebrowser","homepage":"http://www.qutebrowser.org/","size":20055,"stargazers_count":1166,"watchers_count":1166,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":183,"mirror_url":null,"open_issues_count":391,"forks":183,"open_issues":391,"watchers":1166,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350"},"html":{"href":"https://github.com/The-Compiler/qutebrowser/pull/1350"},"issue":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1350"},"comments":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1350/comments"},"review_comments":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350/comments"},"review_comment":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1350/commits"},"statuses":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/statuses/f557a7ae8045b715868b50b68b1bdb69b45a678f"}}}}