{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/comments/58509382","id":58509382,"diff_hunk":"@@ -54,34 +32,62 @@ class Manifest extends Gather {\n     };\n   }\n \n+  /**\n+   * Creates a listener for manifests in network requests, a load timeout, and\n+   * a promise they resolve when complete.\n+   * @private\n+   */\n+  static _resolveOnManifest() {\n+    let manifestResolve;\n+    const manifestPromise = new Promise((resolve, reject) => {\n+      manifestResolve = resolve;\n+    });\n+\n+    setTimeout(_ => manifestResolve(null), MANIFEST_LOAD_TIMEOUT);\n+\n+    const manifestListener = function(request) {\n+      const resourceType = request.resourceType();\n+      if (resourceType && resourceType.name() === 'manifest') {\n+        manifestResolve(request);\n+      }\n+    };\n+\n+    return {\n+      listener: manifestListener,\n+      promise: manifestPromise\n+    };\n+  }\n+\n   static gather(options) {\n     const driver = options.driver;\n-    /**\n-     * This re-fetches the manifest separately, which could\n-     * potentially lead to a different asset. Using the original manifest\n-     * resource is tracked in issue #83\n-     */\n-    return driver.querySelector('head link[rel=\"manifest\"]')\n-      .then(node => {\n-        if (!node) {\n-          return this._errorManifest('No <link rel=\"manifest\"> found in DOM.');\n-        }\n \n-        return node.getAttribute('href').then(manifestURL => {\n-          if (!manifestURL) {\n-            return this._errorManifest('No href found on <link rel=\"manifest\">.');\n-          }\n+    const manifestLoad = this._resolveOnManifest();\n+\n+    return driver.beginNetworkCollect(manifestLoad.listener)","path":"gatherers/manifest.js","position":85,"original_position":85,"commit_id":"f850cdb3e17c2fddbe571c8e56670ca97b7484e1","original_commit_id":"f850cdb3e17c2fddbe571c8e56670ca97b7484e1","user":{"login":"brendankenny","id":316891,"avatar_url":"https://avatars.githubusercontent.com/u/316891?v=3","gravatar_id":"","url":"https://api.github.com/users/brendankenny","html_url":"https://github.com/brendankenny","followers_url":"https://api.github.com/users/brendankenny/followers","following_url":"https://api.github.com/users/brendankenny/following{/other_user}","gists_url":"https://api.github.com/users/brendankenny/gists{/gist_id}","starred_url":"https://api.github.com/users/brendankenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendankenny/subscriptions","organizations_url":"https://api.github.com/users/brendankenny/orgs","repos_url":"https://api.github.com/users/brendankenny/repos","events_url":"https://api.github.com/users/brendankenny/events{/privacy}","received_events_url":"https://api.github.com/users/brendankenny/received_events","type":"User","site_admin":false},"body":"definitely. I thought you needed something with this, though, so I wanted to get a semi-working change in before I retired for the evening :)","created_at":"2016-04-05T09:38:43Z","updated_at":"2016-04-05T09:38:43Z","html_url":"https://github.com/GoogleChrome/lighthouse/pull/137#discussion_r58509382","pull_request_url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/comments/58509382"},"html":{"href":"https://github.com/GoogleChrome/lighthouse/pull/137#discussion_r58509382"},"pull_request":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137","id":65268602,"html_url":"https://github.com/GoogleChrome/lighthouse/pull/137","diff_url":"https://github.com/GoogleChrome/lighthouse/pull/137.diff","patch_url":"https://github.com/GoogleChrome/lighthouse/pull/137.patch","issue_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/137","number":137,"state":"open","locked":false,"title":"gather manifest by intercepting requestAppBanner load","user":{"login":"brendankenny","id":316891,"avatar_url":"https://avatars.githubusercontent.com/u/316891?v=3","gravatar_id":"","url":"https://api.github.com/users/brendankenny","html_url":"https://github.com/brendankenny","followers_url":"https://api.github.com/users/brendankenny/followers","following_url":"https://api.github.com/users/brendankenny/following{/other_user}","gists_url":"https://api.github.com/users/brendankenny/gists{/gist_id}","starred_url":"https://api.github.com/users/brendankenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendankenny/subscriptions","organizations_url":"https://api.github.com/users/brendankenny/orgs","repos_url":"https://api.github.com/users/brendankenny/repos","events_url":"https://api.github.com/users/brendankenny/events{/privacy}","received_events_url":"https://api.github.com/users/brendankenny/received_events","type":"User","site_admin":false},"body":"WIP stab at loading the manifest via the page itself. Works great for e.g. guitar-tuner and airhorner.\r\n\r\nA few problems I'm running into. Advice would be appreciated:\r\n- when this works, it only works the first time you open chrome and run lighthouse. If you leave Chrome open and re-run lighthouse, the manifest request always times out for me (even when testing a different site)\r\n- Looks like UA-emulation isn’t working for this request, at least. The request is sent with a UA string for my desktop, not what’s in emulation.js. For flipkart, this means I’m still getting a 404 when the page requests `https://www.flipkart.com/manifest.json`\r\n- for the Opera PWA list, even though `https://operasoftware.github.io/pwa-list/.webmanifest` finishes loading and status code is 200, I always get `No data found for resource with given identifier` from `Network.getResponseBody`","created_at":"2016-04-05T08:52:01Z","updated_at":"2016-04-05T09:38:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"507b7e644247f9c0f334b75732cf1791d0c21dea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137/commits","review_comments_url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137/comments","review_comment_url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/137/comments","statuses_url":"https://api.github.com/repos/GoogleChrome/lighthouse/statuses/f850cdb3e17c2fddbe571c8e56670ca97b7484e1","head":{"label":"brendankenny:manifestcapture","ref":"manifestcapture","sha":"f850cdb3e17c2fddbe571c8e56670ca97b7484e1","user":{"login":"brendankenny","id":316891,"avatar_url":"https://avatars.githubusercontent.com/u/316891?v=3","gravatar_id":"","url":"https://api.github.com/users/brendankenny","html_url":"https://github.com/brendankenny","followers_url":"https://api.github.com/users/brendankenny/followers","following_url":"https://api.github.com/users/brendankenny/following{/other_user}","gists_url":"https://api.github.com/users/brendankenny/gists{/gist_id}","starred_url":"https://api.github.com/users/brendankenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendankenny/subscriptions","organizations_url":"https://api.github.com/users/brendankenny/orgs","repos_url":"https://api.github.com/users/brendankenny/repos","events_url":"https://api.github.com/users/brendankenny/events{/privacy}","received_events_url":"https://api.github.com/users/brendankenny/received_events","type":"User","site_admin":false},"repo":{"id":53702738,"name":"lighthouse","full_name":"brendankenny/lighthouse","owner":{"login":"brendankenny","id":316891,"avatar_url":"https://avatars.githubusercontent.com/u/316891?v=3","gravatar_id":"","url":"https://api.github.com/users/brendankenny","html_url":"https://github.com/brendankenny","followers_url":"https://api.github.com/users/brendankenny/followers","following_url":"https://api.github.com/users/brendankenny/following{/other_user}","gists_url":"https://api.github.com/users/brendankenny/gists{/gist_id}","starred_url":"https://api.github.com/users/brendankenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendankenny/subscriptions","organizations_url":"https://api.github.com/users/brendankenny/orgs","repos_url":"https://api.github.com/users/brendankenny/repos","events_url":"https://api.github.com/users/brendankenny/events{/privacy}","received_events_url":"https://api.github.com/users/brendankenny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brendankenny/lighthouse","description":null,"fork":true,"url":"https://api.github.com/repos/brendankenny/lighthouse","forks_url":"https://api.github.com/repos/brendankenny/lighthouse/forks","keys_url":"https://api.github.com/repos/brendankenny/lighthouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brendankenny/lighthouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brendankenny/lighthouse/teams","hooks_url":"https://api.github.com/repos/brendankenny/lighthouse/hooks","issue_events_url":"https://api.github.com/repos/brendankenny/lighthouse/issues/events{/number}","events_url":"https://api.github.com/repos/brendankenny/lighthouse/events","assignees_url":"https://api.github.com/repos/brendankenny/lighthouse/assignees{/user}","branches_url":"https://api.github.com/repos/brendankenny/lighthouse/branches{/branch}","tags_url":"https://api.github.com/repos/brendankenny/lighthouse/tags","blobs_url":"https://api.github.com/repos/brendankenny/lighthouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brendankenny/lighthouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brendankenny/lighthouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/brendankenny/lighthouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brendankenny/lighthouse/statuses/{sha}","languages_url":"https://api.github.com/repos/brendankenny/lighthouse/languages","stargazers_url":"https://api.github.com/repos/brendankenny/lighthouse/stargazers","contributors_url":"https://api.github.com/repos/brendankenny/lighthouse/contributors","subscribers_url":"https://api.github.com/repos/brendankenny/lighthouse/subscribers","subscription_url":"https://api.github.com/repos/brendankenny/lighthouse/subscription","commits_url":"https://api.github.com/repos/brendankenny/lighthouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/brendankenny/lighthouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/brendankenny/lighthouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/brendankenny/lighthouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/brendankenny/lighthouse/contents/{+path}","compare_url":"https://api.github.com/repos/brendankenny/lighthouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brendankenny/lighthouse/merges","archive_url":"https://api.github.com/repos/brendankenny/lighthouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brendankenny/lighthouse/downloads","issues_url":"https://api.github.com/repos/brendankenny/lighthouse/issues{/number}","pulls_url":"https://api.github.com/repos/brendankenny/lighthouse/pulls{/number}","milestones_url":"https://api.github.com/repos/brendankenny/lighthouse/milestones{/number}","notifications_url":"https://api.github.com/repos/brendankenny/lighthouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brendankenny/lighthouse/labels{/name}","releases_url":"https://api.github.com/repos/brendankenny/lighthouse/releases{/id}","deployments_url":"https://api.github.com/repos/brendankenny/lighthouse/deployments","created_at":"2016-03-11T23:23:05Z","updated_at":"2016-03-11T23:23:06Z","pushed_at":"2016-04-05T08:50:02Z","git_url":"git://github.com/brendankenny/lighthouse.git","ssh_url":"git@github.com:brendankenny/lighthouse.git","clone_url":"https://github.com/brendankenny/lighthouse.git","svn_url":"https://github.com/brendankenny/lighthouse","homepage":null,"size":2419,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"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":"GoogleChrome:master","ref":"master","sha":"28e0aeaf8083be1ee07580f6a2454b7c3be2c02c","user":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"repo":{"id":53370988,"name":"lighthouse","full_name":"GoogleChrome/lighthouse","owner":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleChrome/lighthouse","description":null,"fork":false,"url":"https://api.github.com/repos/GoogleChrome/lighthouse","forks_url":"https://api.github.com/repos/GoogleChrome/lighthouse/forks","keys_url":"https://api.github.com/repos/GoogleChrome/lighthouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleChrome/lighthouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleChrome/lighthouse/teams","hooks_url":"https://api.github.com/repos/GoogleChrome/lighthouse/hooks","issue_events_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleChrome/lighthouse/events","assignees_url":"https://api.github.com/repos/GoogleChrome/lighthouse/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleChrome/lighthouse/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleChrome/lighthouse/tags","blobs_url":"https://api.github.com/repos/GoogleChrome/lighthouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleChrome/lighthouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleChrome/lighthouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleChrome/lighthouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleChrome/lighthouse/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleChrome/lighthouse/languages","stargazers_url":"https://api.github.com/repos/GoogleChrome/lighthouse/stargazers","contributors_url":"https://api.github.com/repos/GoogleChrome/lighthouse/contributors","subscribers_url":"https://api.github.com/repos/GoogleChrome/lighthouse/subscribers","subscription_url":"https://api.github.com/repos/GoogleChrome/lighthouse/subscription","commits_url":"https://api.github.com/repos/GoogleChrome/lighthouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleChrome/lighthouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleChrome/lighthouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleChrome/lighthouse/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleChrome/lighthouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleChrome/lighthouse/merges","archive_url":"https://api.github.com/repos/GoogleChrome/lighthouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleChrome/lighthouse/downloads","issues_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleChrome/lighthouse/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleChrome/lighthouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleChrome/lighthouse/labels{/name}","releases_url":"https://api.github.com/repos/GoogleChrome/lighthouse/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleChrome/lighthouse/deployments","created_at":"2016-03-08T01:03:11Z","updated_at":"2016-04-04T06:57:53Z","pushed_at":"2016-04-05T09:10:30Z","git_url":"git://github.com/GoogleChrome/lighthouse.git","ssh_url":"git@github.com:GoogleChrome/lighthouse.git","clone_url":"https://github.com/GoogleChrome/lighthouse.git","svn_url":"https://github.com/GoogleChrome/lighthouse","homepage":null,"size":2461,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":30,"forks":11,"open_issues":30,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137"},"html":{"href":"https://github.com/GoogleChrome/lighthouse/pull/137"},"issue":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/137"},"comments":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleChrome/lighthouse/statuses/f850cdb3e17c2fddbe571c8e56670ca97b7484e1"}}}}