{"action":"created","comment":{"url":"https://api.github.com/repos/EFForg/privacybadger/pulls/comments/177589176","pull_request_review_id":107487871,"id":177589176,"diff_hunk":"@@ -200,34 +200,47 @@ var htmlUtils = exports.htmlUtils = {\n   },\n \n   /**\n-  * Compare 2 domains. Reversing them to start comparing the least significant parts (TLD) first\n-  *\n-  * @param a First domain\n-  * @param b Second domain\n-  * @returns {number} standard compare returns\n-  */\n-  compareReversedDomains: function(a, b) {\n-    var fqdn1 = htmlUtils.makeSortable(a);\n-    var fqdn2 = htmlUtils.makeSortable(b);\n-    if (fqdn1 < fqdn2) {\n-      return -1;\n-    }\n-    if (fqdn1 > fqdn2) {\n-      return 1;\n-    }\n-    return 0;\n+   * Compare two domains, reversing them to start comparing the least\n+   * significant parts (TLD) first.\n+   *\n+   * @param {Array} domains The domains to sort.\n+   * @returns {Array} Sorted domains.\n+   */\n+  sortDomains: (domains) => {\n+    return domains.map((domain, i) => {","path":"src/js/htmlutils.js","position":27,"original_position":27,"commit_id":"b64c96e8aae851ca9a43e9c030b28caa3ea5bfb1","original_commit_id":"b64c96e8aae851ca9a43e9c030b28caa3ea5bfb1","user":{"login":"ghostwords","id":794578,"avatar_url":"https://avatars1.githubusercontent.com/u/794578?v=4","gravatar_id":"","url":"https://api.github.com/users/ghostwords","html_url":"https://github.com/ghostwords","followers_url":"https://api.github.com/users/ghostwords/followers","following_url":"https://api.github.com/users/ghostwords/following{/other_user}","gists_url":"https://api.github.com/users/ghostwords/gists{/gist_id}","starred_url":"https://api.github.com/users/ghostwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghostwords/subscriptions","organizations_url":"https://api.github.com/users/ghostwords/orgs","repos_url":"https://api.github.com/users/ghostwords/repos","events_url":"https://api.github.com/users/ghostwords/events{/privacy}","received_events_url":"https://api.github.com/users/ghostwords/received_events","type":"User","site_admin":false},"body":"Yep, as noted in the commit message for 6f6b7063d083619b0e6fb959577c6ac00d3eee3f.","created_at":"2018-03-27T22:16:38Z","updated_at":"2018-03-27T22:16:38Z","html_url":"https://github.com/EFForg/privacybadger/pull/1903#discussion_r177589176","pull_request_url":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/EFForg/privacybadger/pulls/comments/177589176"},"html":{"href":"https://github.com/EFForg/privacybadger/pull/1903#discussion_r177589176"},"pull_request":{"href":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903"}},"in_reply_to_id":177577008},"pull_request":{"url":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903","id":172599621,"html_url":"https://github.com/EFForg/privacybadger/pull/1903","diff_url":"https://github.com/EFForg/privacybadger/pull/1903.diff","patch_url":"https://github.com/EFForg/privacybadger/pull/1903.patch","issue_url":"https://api.github.com/repos/EFForg/privacybadger/issues/1903","number":1903,"state":"open","locked":false,"title":"Improve domain sort","user":{"login":"ghostwords","id":794578,"avatar_url":"https://avatars1.githubusercontent.com/u/794578?v=4","gravatar_id":"","url":"https://api.github.com/users/ghostwords","html_url":"https://github.com/ghostwords","followers_url":"https://api.github.com/users/ghostwords/followers","following_url":"https://api.github.com/users/ghostwords/following{/other_user}","gists_url":"https://api.github.com/users/ghostwords/gists{/gist_id}","starred_url":"https://api.github.com/users/ghostwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghostwords/subscriptions","organizations_url":"https://api.github.com/users/ghostwords/orgs","repos_url":"https://api.github.com/users/ghostwords/repos","events_url":"https://api.github.com/users/ghostwords/events{/privacy}","received_events_url":"https://api.github.com/users/ghostwords/received_events","type":"User","site_admin":false},"body":"Fixes #1874.\r\n\r\nThe old domain sort algorithm was clearly lacking. Do the new sort algorithm's results make sense?\r\n Sorting `bbc.co.uk` with the Bs is clearly good, but should we sort `ajax.googleapis.com` with the Gs or the As? Maybe we don't want to use the PSL here, just country code TLDs ... But is that difficult to achieve with our current domain parsing setup?\r\n\r\nThe tests could probably be improved (for clarity especially), but some tests is better than no tests.\r\n\r\nIs the new sort algorithm's performance acceptable?","created_at":"2018-03-02T20:41:24Z","updated_at":"2018-03-27T22:16:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc664cd1be310e26947e71a8aa6404a7f18436c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903/commits","review_comments_url":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903/comments","review_comment_url":"https://api.github.com/repos/EFForg/privacybadger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EFForg/privacybadger/issues/1903/comments","statuses_url":"https://api.github.com/repos/EFForg/privacybadger/statuses/b64c96e8aae851ca9a43e9c030b28caa3ea5bfb1","head":{"label":"EFForg:improve-domain-sort","ref":"improve-domain-sort","sha":"b64c96e8aae851ca9a43e9c030b28caa3ea5bfb1","user":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"repo":{"id":11321096,"name":"privacybadger","full_name":"EFForg/privacybadger","owner":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EFForg/privacybadger","description":"Privacy Badger - Block third party tracking in your browser! By EFF","fork":false,"url":"https://api.github.com/repos/EFForg/privacybadger","forks_url":"https://api.github.com/repos/EFForg/privacybadger/forks","keys_url":"https://api.github.com/repos/EFForg/privacybadger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EFForg/privacybadger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EFForg/privacybadger/teams","hooks_url":"https://api.github.com/repos/EFForg/privacybadger/hooks","issue_events_url":"https://api.github.com/repos/EFForg/privacybadger/issues/events{/number}","events_url":"https://api.github.com/repos/EFForg/privacybadger/events","assignees_url":"https://api.github.com/repos/EFForg/privacybadger/assignees{/user}","branches_url":"https://api.github.com/repos/EFForg/privacybadger/branches{/branch}","tags_url":"https://api.github.com/repos/EFForg/privacybadger/tags","blobs_url":"https://api.github.com/repos/EFForg/privacybadger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EFForg/privacybadger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EFForg/privacybadger/git/refs{/sha}","trees_url":"https://api.github.com/repos/EFForg/privacybadger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EFForg/privacybadger/statuses/{sha}","languages_url":"https://api.github.com/repos/EFForg/privacybadger/languages","stargazers_url":"https://api.github.com/repos/EFForg/privacybadger/stargazers","contributors_url":"https://api.github.com/repos/EFForg/privacybadger/contributors","subscribers_url":"https://api.github.com/repos/EFForg/privacybadger/subscribers","subscription_url":"https://api.github.com/repos/EFForg/privacybadger/subscription","commits_url":"https://api.github.com/repos/EFForg/privacybadger/commits{/sha}","git_commits_url":"https://api.github.com/repos/EFForg/privacybadger/git/commits{/sha}","comments_url":"https://api.github.com/repos/EFForg/privacybadger/comments{/number}","issue_comment_url":"https://api.github.com/repos/EFForg/privacybadger/issues/comments{/number}","contents_url":"https://api.github.com/repos/EFForg/privacybadger/contents/{+path}","compare_url":"https://api.github.com/repos/EFForg/privacybadger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EFForg/privacybadger/merges","archive_url":"https://api.github.com/repos/EFForg/privacybadger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EFForg/privacybadger/downloads","issues_url":"https://api.github.com/repos/EFForg/privacybadger/issues{/number}","pulls_url":"https://api.github.com/repos/EFForg/privacybadger/pulls{/number}","milestones_url":"https://api.github.com/repos/EFForg/privacybadger/milestones{/number}","notifications_url":"https://api.github.com/repos/EFForg/privacybadger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EFForg/privacybadger/labels{/name}","releases_url":"https://api.github.com/repos/EFForg/privacybadger/releases{/id}","deployments_url":"https://api.github.com/repos/EFForg/privacybadger/deployments","created_at":"2013-07-10T18:59:11Z","updated_at":"2018-03-27T22:15:54Z","pushed_at":"2018-03-27T22:05:50Z","git_url":"git://github.com/EFForg/privacybadger.git","ssh_url":"git@github.com:EFForg/privacybadger.git","clone_url":"https://github.com/EFForg/privacybadger.git","svn_url":"https://github.com/EFForg/privacybadger","homepage":"https://www.eff.org/privacybadger","size":22544,"stargazers_count":1027,"watchers_count":1027,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"archived":false,"open_issues_count":300,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":201,"open_issues":300,"watchers":1027,"default_branch":"master"}},"base":{"label":"EFForg:master","ref":"master","sha":"e7ffa41a82e7447a758290546d06c8d9b9e3d54f","user":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"repo":{"id":11321096,"name":"privacybadger","full_name":"EFForg/privacybadger","owner":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EFForg/privacybadger","description":"Privacy Badger - Block third party tracking in your browser! By EFF","fork":false,"url":"https://api.github.com/repos/EFForg/privacybadger","forks_url":"https://api.github.com/repos/EFForg/privacybadger/forks","keys_url":"https://api.github.com/repos/EFForg/privacybadger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EFForg/privacybadger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EFForg/privacybadger/teams","hooks_url":"https://api.github.com/repos/EFForg/privacybadger/hooks","issue_events_url":"https://api.github.com/repos/EFForg/privacybadger/issues/events{/number}","events_url":"https://api.github.com/repos/EFForg/privacybadger/events","assignees_url":"https://api.github.com/repos/EFForg/privacybadger/assignees{/user}","branches_url":"https://api.github.com/repos/EFForg/privacybadger/branches{/branch}","tags_url":"https://api.github.com/repos/EFForg/privacybadger/tags","blobs_url":"https://api.github.com/repos/EFForg/privacybadger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EFForg/privacybadger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EFForg/privacybadger/git/refs{/sha}","trees_url":"https://api.github.com/repos/EFForg/privacybadger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EFForg/privacybadger/statuses/{sha}","languages_url":"https://api.github.com/repos/EFForg/privacybadger/languages","stargazers_url":"https://api.github.com/repos/EFForg/privacybadger/stargazers","contributors_url":"https://api.github.com/repos/EFForg/privacybadger/contributors","subscribers_url":"https://api.github.com/repos/EFForg/privacybadger/subscribers","subscription_url":"https://api.github.com/repos/EFForg/privacybadger/subscription","commits_url":"https://api.github.com/repos/EFForg/privacybadger/commits{/sha}","git_commits_url":"https://api.github.com/repos/EFForg/privacybadger/git/commits{/sha}","comments_url":"https://api.github.com/repos/EFForg/privacybadger/comments{/number}","issue_comment_url":"https://api.github.com/repos/EFForg/privacybadger/issues/comments{/number}","contents_url":"https://api.github.com/repos/EFForg/privacybadger/contents/{+path}","compare_url":"https://api.github.com/repos/EFForg/privacybadger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EFForg/privacybadger/merges","archive_url":"https://api.github.com/repos/EFForg/privacybadger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EFForg/privacybadger/downloads","issues_url":"https://api.github.com/repos/EFForg/privacybadger/issues{/number}","pulls_url":"https://api.github.com/repos/EFForg/privacybadger/pulls{/number}","milestones_url":"https://api.github.com/repos/EFForg/privacybadger/milestones{/number}","notifications_url":"https://api.github.com/repos/EFForg/privacybadger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EFForg/privacybadger/labels{/name}","releases_url":"https://api.github.com/repos/EFForg/privacybadger/releases{/id}","deployments_url":"https://api.github.com/repos/EFForg/privacybadger/deployments","created_at":"2013-07-10T18:59:11Z","updated_at":"2018-03-27T22:15:54Z","pushed_at":"2018-03-27T22:05:50Z","git_url":"git://github.com/EFForg/privacybadger.git","ssh_url":"git@github.com:EFForg/privacybadger.git","clone_url":"https://github.com/EFForg/privacybadger.git","svn_url":"https://github.com/EFForg/privacybadger","homepage":"https://www.eff.org/privacybadger","size":22544,"stargazers_count":1027,"watchers_count":1027,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"archived":false,"open_issues_count":300,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":201,"open_issues":300,"watchers":1027,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903"},"html":{"href":"https://github.com/EFForg/privacybadger/pull/1903"},"issue":{"href":"https://api.github.com/repos/EFForg/privacybadger/issues/1903"},"comments":{"href":"https://api.github.com/repos/EFForg/privacybadger/issues/1903/comments"},"review_comments":{"href":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903/comments"},"review_comment":{"href":"https://api.github.com/repos/EFForg/privacybadger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EFForg/privacybadger/pulls/1903/commits"},"statuses":{"href":"https://api.github.com/repos/EFForg/privacybadger/statuses/b64c96e8aae851ca9a43e9c030b28caa3ea5bfb1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ghostwords"}}