{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fireplace/pulls/comments/34062922","id":34062922,"diff_hunk":"@@ -54,56 +54,38 @@\n             // We are only interested in a few features for now. We're already\n             // only doing this if getFeature() is present, and it was\n             // introduced in 2.0, so we know we can hardcode anything that\n-            // comes with 2.0 or better and for which we don't need to know the\n-            // exact value. This sucks, won't scale, and we need a better\n-            // long-term solution, but for now it helps us work the fact that\n-            // hasFeature() does not exist in 2.0 :(\n+            // comes with 2.0 and for which we don't need to know the exact\n+            // value.\n             true, // 'getMobileIdAssertion' in window.navigator || 'api.window.Navigator.getMobileIdAssertion',\n             true, // 'manifest.precompile',\n             ['hardware.memory', 512],\n             ['hardware.memory', 1024],\n             true, // NFC\n-            'acl.version',\n+            'acl.version', // OpenMobile ACL\n             // Don't add any more as long as bug 1172487 is not fixed, it won't\n             // work correctly.\n         ];\n \n         features.forEach(function(key) {\n             if (typeof key === 'boolean') {\n-                // Hardcoded boolean value, just pass it to promises directly.\n+                // Hardcoded boolean value, just pass it directly.\n                 promises.push(key);\n-            }\n-            else if (typeof key === 'string') {\n-                if (key.substr(0, 9) === 'manifest.' ||\n-                    key === 'acl.version') {\n-                    // Handle cases where we need to call getFeature() instead\n-                    // of just hasFeature().\n-                    // It's necessary in 2 cases:\n-                    // - The `manifest.*` properties ; Because of bug 1098470,\n-                    //   hasFeature(manifest.*) can fail, while\n-                    //   getFeature(manifest.*) will work. On later builds,\n-                    //   where this bug was fixed, the behaviour is reversed\n-                    //   so we call hasFeature() first and *then* getFeature()\n-                    //   if it returned a falsy value.\n-                    // - The `acl.version` property, which is only available\n-                    //   through getFeature().\n-                    promises.push(new Promise(function(resolve, reject) {\n-                        navigator.hasFeature(key).then(function(supported) {\n-                            if (!supported) {\n-                                navigator.getFeature(key).then(function(feat) {\n-                                    resolve(feat);\n-                                });\n-                            } else {\n-                                resolve(supported);\n-                            }\n-                        });\n-                    }));\n-                } else {\n-                    // Regular case: just call hasFeature().\n+            } else if (typeof key === 'string') {\n+                if (key === 'acl.version') {\n+                    // This feature has a value, so we need to call\n+                    // getFeature(), but we actually only care about the fact\n+                    // that it's not empty, so we can just use the getFeature()\n+                    // promise directly.\n+                    promises.push(navigator.getFeature(key));\n+                } else if (typeof window.hasFeature !== 'undefined') {\n+                    // Regular boolean feature: just call hasFeature().\n                     promises.push(navigator.hasFeature(key));","path":"package/iframe/main.js","position":null,"original_position":63,"commit_id":"5037f4d68b451a10f310aa993b9e22ef19adc6c1","original_commit_id":"74fa8d1119099f1ec9d5b4fda178200cdd64c29c","user":{"login":"diox","id":187006,"avatar_url":"https://avatars.githubusercontent.com/u/187006?v=3","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false},"body":"Yes, that bug has been fixed since.","created_at":"2015-07-07T16:57:43Z","updated_at":"2015-07-07T16:57:43Z","html_url":"https://github.com/mozilla/fireplace/pull/1376#discussion_r34062922","pull_request_url":"https://api.github.com/repos/mozilla/fireplace/pulls/1376","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fireplace/pulls/comments/34062922"},"html":{"href":"https://github.com/mozilla/fireplace/pull/1376#discussion_r34062922"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fireplace/pulls/1376"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fireplace/pulls/1376","id":39365635,"html_url":"https://github.com/mozilla/fireplace/pull/1376","diff_url":"https://github.com/mozilla/fireplace/pull/1376.diff","patch_url":"https://github.com/mozilla/fireplace/pull/1376.patch","issue_url":"https://api.github.com/repos/mozilla/fireplace/issues/1376","number":1376,"state":"open","locked":false,"title":"Remove workaround for old *feature bug and test hasFeature before using it (bug 1180909)","user":{"login":"diox","id":187006,"avatar_url":"https://avatars.githubusercontent.com/u/187006?v=3","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false},"body":"https://bugzilla.mozilla.org/show_bug.cgi?id=1180909","created_at":"2015-07-07T12:43:54Z","updated_at":"2015-07-07T16:57:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c5f17be77ed802de36b0d3fd7669d55cc5ec377","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/fireplace/pulls/1376/commits","review_comments_url":"https://api.github.com/repos/mozilla/fireplace/pulls/1376/comments","review_comment_url":"https://api.github.com/repos/mozilla/fireplace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fireplace/issues/1376/comments","statuses_url":"https://api.github.com/repos/mozilla/fireplace/statuses/5037f4d68b451a10f310aa993b9e22ef19adc6c1","head":{"label":"diox:fix-package-for-2.0","ref":"fix-package-for-2.0","sha":"5037f4d68b451a10f310aa993b9e22ef19adc6c1","user":{"login":"diox","id":187006,"avatar_url":"https://avatars.githubusercontent.com/u/187006?v=3","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false},"repo":{"id":10312455,"name":"fireplace","full_name":"diox/fireplace","owner":{"login":"diox","id":187006,"avatar_url":"https://avatars.githubusercontent.com/u/187006?v=3","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diox/fireplace","description":"Ignition, the Remix","fork":true,"url":"https://api.github.com/repos/diox/fireplace","forks_url":"https://api.github.com/repos/diox/fireplace/forks","keys_url":"https://api.github.com/repos/diox/fireplace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diox/fireplace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diox/fireplace/teams","hooks_url":"https://api.github.com/repos/diox/fireplace/hooks","issue_events_url":"https://api.github.com/repos/diox/fireplace/issues/events{/number}","events_url":"https://api.github.com/repos/diox/fireplace/events","assignees_url":"https://api.github.com/repos/diox/fireplace/assignees{/user}","branches_url":"https://api.github.com/repos/diox/fireplace/branches{/branch}","tags_url":"https://api.github.com/repos/diox/fireplace/tags","blobs_url":"https://api.github.com/repos/diox/fireplace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diox/fireplace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diox/fireplace/git/refs{/sha}","trees_url":"https://api.github.com/repos/diox/fireplace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diox/fireplace/statuses/{sha}","languages_url":"https://api.github.com/repos/diox/fireplace/languages","stargazers_url":"https://api.github.com/repos/diox/fireplace/stargazers","contributors_url":"https://api.github.com/repos/diox/fireplace/contributors","subscribers_url":"https://api.github.com/repos/diox/fireplace/subscribers","subscription_url":"https://api.github.com/repos/diox/fireplace/subscription","commits_url":"https://api.github.com/repos/diox/fireplace/commits{/sha}","git_commits_url":"https://api.github.com/repos/diox/fireplace/git/commits{/sha}","comments_url":"https://api.github.com/repos/diox/fireplace/comments{/number}","issue_comment_url":"https://api.github.com/repos/diox/fireplace/issues/comments{/number}","contents_url":"https://api.github.com/repos/diox/fireplace/contents/{+path}","compare_url":"https://api.github.com/repos/diox/fireplace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diox/fireplace/merges","archive_url":"https://api.github.com/repos/diox/fireplace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diox/fireplace/downloads","issues_url":"https://api.github.com/repos/diox/fireplace/issues{/number}","pulls_url":"https://api.github.com/repos/diox/fireplace/pulls{/number}","milestones_url":"https://api.github.com/repos/diox/fireplace/milestones{/number}","notifications_url":"https://api.github.com/repos/diox/fireplace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diox/fireplace/labels{/name}","releases_url":"https://api.github.com/repos/diox/fireplace/releases{/id}","created_at":"2013-05-27T10:09:58Z","updated_at":"2015-04-22T12:41:27Z","pushed_at":"2015-07-07T16:57:15Z","git_url":"git://github.com/diox/fireplace.git","ssh_url":"git@github.com:diox/fireplace.git","clone_url":"https://github.com/diox/fireplace.git","svn_url":"https://github.com/diox/fireplace","homepage":"https://marketplace.firefox.com/","size":36570,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"mozilla:master","ref":"master","sha":"db8ab30bcc875def7ecd33afebc6223326ae4bd0","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":8046076,"name":"fireplace","full_name":"mozilla/fireplace","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fireplace","description":"Frontend for the Firefox Marketplace","fork":false,"url":"https://api.github.com/repos/mozilla/fireplace","forks_url":"https://api.github.com/repos/mozilla/fireplace/forks","keys_url":"https://api.github.com/repos/mozilla/fireplace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fireplace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fireplace/teams","hooks_url":"https://api.github.com/repos/mozilla/fireplace/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fireplace/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fireplace/events","assignees_url":"https://api.github.com/repos/mozilla/fireplace/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fireplace/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fireplace/tags","blobs_url":"https://api.github.com/repos/mozilla/fireplace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fireplace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fireplace/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fireplace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fireplace/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fireplace/languages","stargazers_url":"https://api.github.com/repos/mozilla/fireplace/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fireplace/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fireplace/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fireplace/subscription","commits_url":"https://api.github.com/repos/mozilla/fireplace/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fireplace/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fireplace/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fireplace/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fireplace/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fireplace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fireplace/merges","archive_url":"https://api.github.com/repos/mozilla/fireplace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fireplace/downloads","issues_url":"https://api.github.com/repos/mozilla/fireplace/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fireplace/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fireplace/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fireplace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fireplace/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fireplace/releases{/id}","created_at":"2013-02-06T06:41:06Z","updated_at":"2015-07-03T06:53:43Z","pushed_at":"2015-07-07T16:57:16Z","git_url":"git://github.com/mozilla/fireplace.git","ssh_url":"git@github.com:mozilla/fireplace.git","clone_url":"https://github.com/mozilla/fireplace.git","svn_url":"https://github.com/mozilla/fireplace","homepage":"https://marketplace.firefox.com/","size":100446,"stargazers_count":66,"watchers_count":66,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":138,"mirror_url":null,"open_issues_count":11,"forks":138,"open_issues":11,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fireplace/pulls/1376"},"html":{"href":"https://github.com/mozilla/fireplace/pull/1376"},"issue":{"href":"https://api.github.com/repos/mozilla/fireplace/issues/1376"},"comments":{"href":"https://api.github.com/repos/mozilla/fireplace/issues/1376/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fireplace/pulls/1376/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fireplace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fireplace/pulls/1376/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fireplace/statuses/5037f4d68b451a10f310aa993b9e22ef19adc6c1"}}}}