{"action":"created","comment":{"url":"https://api.github.com/repos/florian/federated-learning-addon/pulls/comments/199630442","pull_request_review_id":133788059,"id":199630442,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTYzMDQ0Mg==","diff_hunk":"@@ -0,0 +1,63 @@\n+'use strict'\n+\n+ChromeUtils.import('resource://gre/modules/Services.jsm')\n+\n+const { ExtensionCommon } = ChromeUtils.import(\n+  'resource://gre/modules/ExtensionCommon.jsm'\n+)\n+\n+const { EventManager } = ExtensionCommon\n+\n+const EVENT = 'autocomplete-will-enter-text'\n+// Bookmarks are not included for now because we also want to take them into account\n+const NON_HISTORY_STYLES = ['switchtab', 'remotetab', 'searchengine', 'visiturl', 'extension', 'suggestion', 'keyword']\n+\n+var awesomeBar = class extends ExtensionAPI {\n+  getAPI (context) {\n+    return {\n+      experiments: {\n+        awesomeBar: {\n+          onHistorySearch: new EventManager({\n+            context,\n+            name: 'awesomeBar.onHistorySearch',\n+            register: fire => {\n+              Services.obs.addObserver(el => processAwesomeBarSearch(el, fire.async), EVENT, false)\n+            }\n+          }).api()\n+        }\n+      }\n+    }\n+  }\n+}\n+\n+function processAwesomeBarSearch (el, callback) {\n+  let popup = el.popup\n+  let controller = popup.view.QueryInterface(Ci.nsIAutoCompleteController)\n+\n+  let selectedIndex = popup.selectedIndex\n+  let selectedStyle = controller.getStyleAt(selectedIndex)\n+  let searchQuery = controller.searchString\n+\n+  if (isHistoryStyle(selectedStyle) && searchQuery !== '') {\n+    let numberOfSuggestions = controller.matchCount\n+    let historySuggestions = []\n+\n+    for (var i = 0; i < numberOfSuggestions; i++) {\n+      let url = controller.getFinalCompleteValueAt(i)","path":"experiments/awesomeBar/api.js","position":null,"original_position":46,"commit_id":"099862e20f80d314ef5957bbac6c78851d557634","original_commit_id":"77dc1435cd189c4c6b6c3c94917ba9b8f78ed126","user":{"login":"florian","id":1564556,"node_id":"MDQ6VXNlcjE1NjQ1NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1564556?v=4","gravatar_id":"","url":"https://api.github.com/users/florian","html_url":"https://github.com/florian","followers_url":"https://api.github.com/users/florian/followers","following_url":"https://api.github.com/users/florian/following{/other_user}","gists_url":"https://api.github.com/users/florian/gists{/gist_id}","starred_url":"https://api.github.com/users/florian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian/subscriptions","organizations_url":"https://api.github.com/users/florian/orgs","repos_url":"https://api.github.com/users/florian/repos","events_url":"https://api.github.com/users/florian/events{/privacy}","received_events_url":"https://api.github.com/users/florian/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2018-07-02T21:46:07Z","updated_at":"2018-07-02T21:46:07Z","html_url":"https://github.com/florian/federated-learning-addon/pull/1#discussion_r199630442","pull_request_url":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/florian/federated-learning-addon/pulls/comments/199630442"},"html":{"href":"https://github.com/florian/federated-learning-addon/pull/1#discussion_r199630442"},"pull_request":{"href":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1"}},"in_reply_to_id":199609213},"pull_request":{"url":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1","id":197588957,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NTg4OTU3","html_url":"https://github.com/florian/federated-learning-addon/pull/1","diff_url":"https://github.com/florian/federated-learning-addon/pull/1.diff","patch_url":"https://github.com/florian/federated-learning-addon/pull/1.patch","issue_url":"https://api.github.com/repos/florian/federated-learning-addon/issues/1","number":1,"state":"open","locked":false,"title":"Initial Federated Learning WebExtension","user":{"login":"florian","id":1564556,"node_id":"MDQ6VXNlcjE1NjQ1NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1564556?v=4","gravatar_id":"","url":"https://api.github.com/users/florian","html_url":"https://github.com/florian","followers_url":"https://api.github.com/users/florian/followers","following_url":"https://api.github.com/users/florian/following{/other_user}","gists_url":"https://api.github.com/users/florian/gists{/gist_id}","starred_url":"https://api.github.com/users/florian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian/subscriptions","organizations_url":"https://api.github.com/users/florian/orgs","repos_url":"https://api.github.com/users/florian/repos","events_url":"https://api.github.com/users/florian/events{/privacy}","received_events_url":"https://api.github.com/users/florian/received_events","type":"User","site_admin":false},"body":"This PR contains all the code for the initial version of the WebExtension that implements the client-side part for the [Federated Learning project](https://bugzilla.mozilla.org/show_bug.cgi?id=1462109).\r\n\r\n`experiments/study/` is the shield library provided by the [`shield-studies-addon-utils`](https://github.com/mozilla/shield-studies-addon-utils) repository and does not need to be reviewed here. `addon/studySetup.js` is from the same repository but was configured for this project. I'll remove the testing flag in that file before we ship everything.","created_at":"2018-06-27T00:48:21Z","updated_at":"2018-07-02T21:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d0a6b76869b9c3b1e8bc3f1ae5beadf3dc5aebd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1/commits","review_comments_url":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1/comments","review_comment_url":"https://api.github.com/repos/florian/federated-learning-addon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/florian/federated-learning-addon/issues/1/comments","statuses_url":"https://api.github.com/repos/florian/federated-learning-addon/statuses/099862e20f80d314ef5957bbac6c78851d557634","head":{"label":"florian:master","ref":"master","sha":"099862e20f80d314ef5957bbac6c78851d557634","user":{"login":"florian","id":1564556,"node_id":"MDQ6VXNlcjE1NjQ1NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1564556?v=4","gravatar_id":"","url":"https://api.github.com/users/florian","html_url":"https://github.com/florian","followers_url":"https://api.github.com/users/florian/followers","following_url":"https://api.github.com/users/florian/following{/other_user}","gists_url":"https://api.github.com/users/florian/gists{/gist_id}","starred_url":"https://api.github.com/users/florian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian/subscriptions","organizations_url":"https://api.github.com/users/florian/orgs","repos_url":"https://api.github.com/users/florian/repos","events_url":"https://api.github.com/users/florian/events{/privacy}","received_events_url":"https://api.github.com/users/florian/received_events","type":"User","site_admin":false},"repo":{"id":137802120,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc4MDIxMjA=","name":"federated-learning-addon","full_name":"florian/federated-learning-addon","owner":{"login":"florian","id":1564556,"node_id":"MDQ6VXNlcjE1NjQ1NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1564556?v=4","gravatar_id":"","url":"https://api.github.com/users/florian","html_url":"https://github.com/florian","followers_url":"https://api.github.com/users/florian/followers","following_url":"https://api.github.com/users/florian/following{/other_user}","gists_url":"https://api.github.com/users/florian/gists{/gist_id}","starred_url":"https://api.github.com/users/florian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian/subscriptions","organizations_url":"https://api.github.com/users/florian/orgs","repos_url":"https://api.github.com/users/florian/repos","events_url":"https://api.github.com/users/florian/events{/privacy}","received_events_url":"https://api.github.com/users/florian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/florian/federated-learning-addon","description":null,"fork":false,"url":"https://api.github.com/repos/florian/federated-learning-addon","forks_url":"https://api.github.com/repos/florian/federated-learning-addon/forks","keys_url":"https://api.github.com/repos/florian/federated-learning-addon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/florian/federated-learning-addon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/florian/federated-learning-addon/teams","hooks_url":"https://api.github.com/repos/florian/federated-learning-addon/hooks","issue_events_url":"https://api.github.com/repos/florian/federated-learning-addon/issues/events{/number}","events_url":"https://api.github.com/repos/florian/federated-learning-addon/events","assignees_url":"https://api.github.com/repos/florian/federated-learning-addon/assignees{/user}","branches_url":"https://api.github.com/repos/florian/federated-learning-addon/branches{/branch}","tags_url":"https://api.github.com/repos/florian/federated-learning-addon/tags","blobs_url":"https://api.github.com/repos/florian/federated-learning-addon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/florian/federated-learning-addon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/florian/federated-learning-addon/git/refs{/sha}","trees_url":"https://api.github.com/repos/florian/federated-learning-addon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/florian/federated-learning-addon/statuses/{sha}","languages_url":"https://api.github.com/repos/florian/federated-learning-addon/languages","stargazers_url":"https://api.github.com/repos/florian/federated-learning-addon/stargazers","contributors_url":"https://api.github.com/repos/florian/federated-learning-addon/contributors","subscribers_url":"https://api.github.com/repos/florian/federated-learning-addon/subscribers","subscription_url":"https://api.github.com/repos/florian/federated-learning-addon/subscription","commits_url":"https://api.github.com/repos/florian/federated-learning-addon/commits{/sha}","git_commits_url":"https://api.github.com/repos/florian/federated-learning-addon/git/commits{/sha}","comments_url":"https://api.github.com/repos/florian/federated-learning-addon/comments{/number}","issue_comment_url":"https://api.github.com/repos/florian/federated-learning-addon/issues/comments{/number}","contents_url":"https://api.github.com/repos/florian/federated-learning-addon/contents/{+path}","compare_url":"https://api.github.com/repos/florian/federated-learning-addon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/florian/federated-learning-addon/merges","archive_url":"https://api.github.com/repos/florian/federated-learning-addon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/florian/federated-learning-addon/downloads","issues_url":"https://api.github.com/repos/florian/federated-learning-addon/issues{/number}","pulls_url":"https://api.github.com/repos/florian/federated-learning-addon/pulls{/number}","milestones_url":"https://api.github.com/repos/florian/federated-learning-addon/milestones{/number}","notifications_url":"https://api.github.com/repos/florian/federated-learning-addon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/florian/federated-learning-addon/labels{/name}","releases_url":"https://api.github.com/repos/florian/federated-learning-addon/releases{/id}","deployments_url":"https://api.github.com/repos/florian/federated-learning-addon/deployments","created_at":"2018-06-18T20:19:12Z","updated_at":"2018-07-02T21:45:19Z","pushed_at":"2018-07-02T21:45:18Z","git_url":"git://github.com/florian/federated-learning-addon.git","ssh_url":"git@github.com:florian/federated-learning-addon.git","clone_url":"https://github.com/florian/federated-learning-addon.git","svn_url":"https://github.com/florian/federated-learning-addon","homepage":null,"size":132,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"florian:release","ref":"release","sha":"51de4729d40973818e615b42eb98a8e3598e7a82","user":{"login":"florian","id":1564556,"node_id":"MDQ6VXNlcjE1NjQ1NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1564556?v=4","gravatar_id":"","url":"https://api.github.com/users/florian","html_url":"https://github.com/florian","followers_url":"https://api.github.com/users/florian/followers","following_url":"https://api.github.com/users/florian/following{/other_user}","gists_url":"https://api.github.com/users/florian/gists{/gist_id}","starred_url":"https://api.github.com/users/florian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian/subscriptions","organizations_url":"https://api.github.com/users/florian/orgs","repos_url":"https://api.github.com/users/florian/repos","events_url":"https://api.github.com/users/florian/events{/privacy}","received_events_url":"https://api.github.com/users/florian/received_events","type":"User","site_admin":false},"repo":{"id":137802120,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc4MDIxMjA=","name":"federated-learning-addon","full_name":"florian/federated-learning-addon","owner":{"login":"florian","id":1564556,"node_id":"MDQ6VXNlcjE1NjQ1NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1564556?v=4","gravatar_id":"","url":"https://api.github.com/users/florian","html_url":"https://github.com/florian","followers_url":"https://api.github.com/users/florian/followers","following_url":"https://api.github.com/users/florian/following{/other_user}","gists_url":"https://api.github.com/users/florian/gists{/gist_id}","starred_url":"https://api.github.com/users/florian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian/subscriptions","organizations_url":"https://api.github.com/users/florian/orgs","repos_url":"https://api.github.com/users/florian/repos","events_url":"https://api.github.com/users/florian/events{/privacy}","received_events_url":"https://api.github.com/users/florian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/florian/federated-learning-addon","description":null,"fork":false,"url":"https://api.github.com/repos/florian/federated-learning-addon","forks_url":"https://api.github.com/repos/florian/federated-learning-addon/forks","keys_url":"https://api.github.com/repos/florian/federated-learning-addon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/florian/federated-learning-addon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/florian/federated-learning-addon/teams","hooks_url":"https://api.github.com/repos/florian/federated-learning-addon/hooks","issue_events_url":"https://api.github.com/repos/florian/federated-learning-addon/issues/events{/number}","events_url":"https://api.github.com/repos/florian/federated-learning-addon/events","assignees_url":"https://api.github.com/repos/florian/federated-learning-addon/assignees{/user}","branches_url":"https://api.github.com/repos/florian/federated-learning-addon/branches{/branch}","tags_url":"https://api.github.com/repos/florian/federated-learning-addon/tags","blobs_url":"https://api.github.com/repos/florian/federated-learning-addon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/florian/federated-learning-addon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/florian/federated-learning-addon/git/refs{/sha}","trees_url":"https://api.github.com/repos/florian/federated-learning-addon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/florian/federated-learning-addon/statuses/{sha}","languages_url":"https://api.github.com/repos/florian/federated-learning-addon/languages","stargazers_url":"https://api.github.com/repos/florian/federated-learning-addon/stargazers","contributors_url":"https://api.github.com/repos/florian/federated-learning-addon/contributors","subscribers_url":"https://api.github.com/repos/florian/federated-learning-addon/subscribers","subscription_url":"https://api.github.com/repos/florian/federated-learning-addon/subscription","commits_url":"https://api.github.com/repos/florian/federated-learning-addon/commits{/sha}","git_commits_url":"https://api.github.com/repos/florian/federated-learning-addon/git/commits{/sha}","comments_url":"https://api.github.com/repos/florian/federated-learning-addon/comments{/number}","issue_comment_url":"https://api.github.com/repos/florian/federated-learning-addon/issues/comments{/number}","contents_url":"https://api.github.com/repos/florian/federated-learning-addon/contents/{+path}","compare_url":"https://api.github.com/repos/florian/federated-learning-addon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/florian/federated-learning-addon/merges","archive_url":"https://api.github.com/repos/florian/federated-learning-addon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/florian/federated-learning-addon/downloads","issues_url":"https://api.github.com/repos/florian/federated-learning-addon/issues{/number}","pulls_url":"https://api.github.com/repos/florian/federated-learning-addon/pulls{/number}","milestones_url":"https://api.github.com/repos/florian/federated-learning-addon/milestones{/number}","notifications_url":"https://api.github.com/repos/florian/federated-learning-addon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/florian/federated-learning-addon/labels{/name}","releases_url":"https://api.github.com/repos/florian/federated-learning-addon/releases{/id}","deployments_url":"https://api.github.com/repos/florian/federated-learning-addon/deployments","created_at":"2018-06-18T20:19:12Z","updated_at":"2018-07-02T21:45:19Z","pushed_at":"2018-07-02T21:45:18Z","git_url":"git://github.com/florian/federated-learning-addon.git","ssh_url":"git@github.com:florian/federated-learning-addon.git","clone_url":"https://github.com/florian/federated-learning-addon.git","svn_url":"https://github.com/florian/federated-learning-addon","homepage":null,"size":132,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1"},"html":{"href":"https://github.com/florian/federated-learning-addon/pull/1"},"issue":{"href":"https://api.github.com/repos/florian/federated-learning-addon/issues/1"},"comments":{"href":"https://api.github.com/repos/florian/federated-learning-addon/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/florian/federated-learning-addon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/florian/federated-learning-addon/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/florian/federated-learning-addon/statuses/099862e20f80d314ef5957bbac6c78851d557634"}},"author_association":"OWNER"}}
{"actor":{"display_login":"florian"}}