{"action":"created","comment":{"url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/comments/44518511","id":44518511,"diff_hunk":"@@ -1,5 +1,31 @@\n   var fetchTextFromURL;\n-  if (typeof XMLHttpRequest != 'undefined') {\n+  if (typeof fetch != 'undefined') {\n+    fetchTextFromURL = function(url, authorization, fulfill, reject) {\n+      var opts = {\n+        headers: {'Accept': 'application/x-es-module, */*'}\n+      };\n+\n+      if(authorization) {","path":"src/system-fetch.js","position":9,"original_position":9,"commit_id":"a9fbf1ce51f74e4afca7d551d881517a9bbbc134","original_commit_id":"a9fbf1ce51f74e4afca7d551d881517a9bbbc134","user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"body":"`if (authorization)`","created_at":"2015-11-11T10:18:59Z","updated_at":"2015-11-11T10:18:59Z","html_url":"https://github.com/ModuleLoader/es6-module-loader/pull/448#discussion_r44518511","pull_request_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/comments/44518511"},"html":{"href":"https://github.com/ModuleLoader/es6-module-loader/pull/448#discussion_r44518511"},"pull_request":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448","id":50137539,"html_url":"https://github.com/ModuleLoader/es6-module-loader/pull/448","diff_url":"https://github.com/ModuleLoader/es6-module-loader/pull/448.diff","patch_url":"https://github.com/ModuleLoader/es6-module-loader/pull/448.patch","issue_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues/448","number":448,"state":"open","locked":false,"title":"Add support for new async fetch API","user":{"login":"jgraichen","id":800848,"avatar_url":"https://avatars.githubusercontent.com/u/800848?v=3","gravatar_id":"","url":"https://api.github.com/users/jgraichen","html_url":"https://github.com/jgraichen","followers_url":"https://api.github.com/users/jgraichen/followers","following_url":"https://api.github.com/users/jgraichen/following{/other_user}","gists_url":"https://api.github.com/users/jgraichen/gists{/gist_id}","starred_url":"https://api.github.com/users/jgraichen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgraichen/subscriptions","organizations_url":"https://api.github.com/users/jgraichen/orgs","repos_url":"https://api.github.com/users/jgraichen/repos","events_url":"https://api.github.com/users/jgraichen/events{/privacy}","received_events_url":"https://api.github.com/users/jgraichen/received_events","type":"User","site_admin":false},"body":"This commit adds a `fetchTextFromURL` strategy using the new fetch API required for service workers. #374\r\n\r\nIt can be used in a service worker like this:\r\n\r\n```js\r\nimportScripts('babel-browser.js')\r\nimportScripts('es6-module-loader-dev.js')\r\n\r\nself.addEventListener('install', function(event) {\r\n    event.waitUntil(System.import('sw.jsx').then(function(sw) {\r\n        return sw.install(event);\r\n    }));\r\n});\r\n\r\n// [..]\r\n```\r\n\r\nI did not get a reliable test case working registering and unregistering a service worker due to mismatching URL scopes in test runners.","created_at":"2015-11-09T15:43:23Z","updated_at":"2015-11-11T10:18:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab6a49c67b5a35a87f85a01ae4067983c5d31f48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448/commits","review_comments_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448/comments","review_comment_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues/448/comments","statuses_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/statuses/a9fbf1ce51f74e4afca7d551d881517a9bbbc134","head":{"label":"jgraichen:service-worker-fetch","ref":"service-worker-fetch","sha":"a9fbf1ce51f74e4afca7d551d881517a9bbbc134","user":{"login":"jgraichen","id":800848,"avatar_url":"https://avatars.githubusercontent.com/u/800848?v=3","gravatar_id":"","url":"https://api.github.com/users/jgraichen","html_url":"https://github.com/jgraichen","followers_url":"https://api.github.com/users/jgraichen/followers","following_url":"https://api.github.com/users/jgraichen/following{/other_user}","gists_url":"https://api.github.com/users/jgraichen/gists{/gist_id}","starred_url":"https://api.github.com/users/jgraichen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgraichen/subscriptions","organizations_url":"https://api.github.com/users/jgraichen/orgs","repos_url":"https://api.github.com/users/jgraichen/repos","events_url":"https://api.github.com/users/jgraichen/events{/privacy}","received_events_url":"https://api.github.com/users/jgraichen/received_events","type":"User","site_admin":false},"repo":{"id":45781912,"name":"es6-module-loader","full_name":"jgraichen/es6-module-loader","owner":{"login":"jgraichen","id":800848,"avatar_url":"https://avatars.githubusercontent.com/u/800848?v=3","gravatar_id":"","url":"https://api.github.com/users/jgraichen","html_url":"https://github.com/jgraichen","followers_url":"https://api.github.com/users/jgraichen/followers","following_url":"https://api.github.com/users/jgraichen/following{/other_user}","gists_url":"https://api.github.com/users/jgraichen/gists{/gist_id}","starred_url":"https://api.github.com/users/jgraichen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgraichen/subscriptions","organizations_url":"https://api.github.com/users/jgraichen/orgs","repos_url":"https://api.github.com/users/jgraichen/repos","events_url":"https://api.github.com/users/jgraichen/events{/privacy}","received_events_url":"https://api.github.com/users/jgraichen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgraichen/es6-module-loader","description":"Polyfill for the ES6 Module Loader","fork":true,"url":"https://api.github.com/repos/jgraichen/es6-module-loader","forks_url":"https://api.github.com/repos/jgraichen/es6-module-loader/forks","keys_url":"https://api.github.com/repos/jgraichen/es6-module-loader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgraichen/es6-module-loader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgraichen/es6-module-loader/teams","hooks_url":"https://api.github.com/repos/jgraichen/es6-module-loader/hooks","issue_events_url":"https://api.github.com/repos/jgraichen/es6-module-loader/issues/events{/number}","events_url":"https://api.github.com/repos/jgraichen/es6-module-loader/events","assignees_url":"https://api.github.com/repos/jgraichen/es6-module-loader/assignees{/user}","branches_url":"https://api.github.com/repos/jgraichen/es6-module-loader/branches{/branch}","tags_url":"https://api.github.com/repos/jgraichen/es6-module-loader/tags","blobs_url":"https://api.github.com/repos/jgraichen/es6-module-loader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgraichen/es6-module-loader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgraichen/es6-module-loader/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgraichen/es6-module-loader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgraichen/es6-module-loader/statuses/{sha}","languages_url":"https://api.github.com/repos/jgraichen/es6-module-loader/languages","stargazers_url":"https://api.github.com/repos/jgraichen/es6-module-loader/stargazers","contributors_url":"https://api.github.com/repos/jgraichen/es6-module-loader/contributors","subscribers_url":"https://api.github.com/repos/jgraichen/es6-module-loader/subscribers","subscription_url":"https://api.github.com/repos/jgraichen/es6-module-loader/subscription","commits_url":"https://api.github.com/repos/jgraichen/es6-module-loader/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgraichen/es6-module-loader/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgraichen/es6-module-loader/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgraichen/es6-module-loader/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgraichen/es6-module-loader/contents/{+path}","compare_url":"https://api.github.com/repos/jgraichen/es6-module-loader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgraichen/es6-module-loader/merges","archive_url":"https://api.github.com/repos/jgraichen/es6-module-loader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgraichen/es6-module-loader/downloads","issues_url":"https://api.github.com/repos/jgraichen/es6-module-loader/issues{/number}","pulls_url":"https://api.github.com/repos/jgraichen/es6-module-loader/pulls{/number}","milestones_url":"https://api.github.com/repos/jgraichen/es6-module-loader/milestones{/number}","notifications_url":"https://api.github.com/repos/jgraichen/es6-module-loader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgraichen/es6-module-loader/labels{/name}","releases_url":"https://api.github.com/repos/jgraichen/es6-module-loader/releases{/id}","created_at":"2015-11-08T13:39:01Z","updated_at":"2015-11-08T13:39:03Z","pushed_at":"2015-11-08T17:37:06Z","git_url":"git://github.com/jgraichen/es6-module-loader.git","ssh_url":"git@github.com:jgraichen/es6-module-loader.git","clone_url":"https://github.com/jgraichen/es6-module-loader.git","svn_url":"https://github.com/jgraichen/es6-module-loader","homepage":"","size":3902,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ModuleLoader:master","ref":"master","sha":"83f69845ffbdb39b692795f00709c84dc3f603ad","user":{"login":"ModuleLoader","id":4904197,"avatar_url":"https://avatars.githubusercontent.com/u/4904197?v=3","gravatar_id":"","url":"https://api.github.com/users/ModuleLoader","html_url":"https://github.com/ModuleLoader","followers_url":"https://api.github.com/users/ModuleLoader/followers","following_url":"https://api.github.com/users/ModuleLoader/following{/other_user}","gists_url":"https://api.github.com/users/ModuleLoader/gists{/gist_id}","starred_url":"https://api.github.com/users/ModuleLoader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ModuleLoader/subscriptions","organizations_url":"https://api.github.com/users/ModuleLoader/orgs","repos_url":"https://api.github.com/users/ModuleLoader/repos","events_url":"https://api.github.com/users/ModuleLoader/events{/privacy}","received_events_url":"https://api.github.com/users/ModuleLoader/received_events","type":"Organization","site_admin":false},"repo":{"id":4380969,"name":"es6-module-loader","full_name":"ModuleLoader/es6-module-loader","owner":{"login":"ModuleLoader","id":4904197,"avatar_url":"https://avatars.githubusercontent.com/u/4904197?v=3","gravatar_id":"","url":"https://api.github.com/users/ModuleLoader","html_url":"https://github.com/ModuleLoader","followers_url":"https://api.github.com/users/ModuleLoader/followers","following_url":"https://api.github.com/users/ModuleLoader/following{/other_user}","gists_url":"https://api.github.com/users/ModuleLoader/gists{/gist_id}","starred_url":"https://api.github.com/users/ModuleLoader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ModuleLoader/subscriptions","organizations_url":"https://api.github.com/users/ModuleLoader/orgs","repos_url":"https://api.github.com/users/ModuleLoader/repos","events_url":"https://api.github.com/users/ModuleLoader/events{/privacy}","received_events_url":"https://api.github.com/users/ModuleLoader/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ModuleLoader/es6-module-loader","description":"Polyfill for the ES6 Module Loader","fork":false,"url":"https://api.github.com/repos/ModuleLoader/es6-module-loader","forks_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/forks","keys_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/teams","hooks_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/hooks","issue_events_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues/events{/number}","events_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/events","assignees_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/assignees{/user}","branches_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/branches{/branch}","tags_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/tags","blobs_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/git/refs{/sha}","trees_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/statuses/{sha}","languages_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/languages","stargazers_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/stargazers","contributors_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/contributors","subscribers_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/subscribers","subscription_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/subscription","commits_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/commits{/sha}","git_commits_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/git/commits{/sha}","comments_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/comments{/number}","issue_comment_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues/comments{/number}","contents_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/contents/{+path}","compare_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/merges","archive_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/downloads","issues_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues{/number}","pulls_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls{/number}","milestones_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/milestones{/number}","notifications_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/labels{/name}","releases_url":"https://api.github.com/repos/ModuleLoader/es6-module-loader/releases{/id}","created_at":"2012-05-19T21:11:56Z","updated_at":"2015-11-11T01:17:47Z","pushed_at":"2015-11-09T15:43:24Z","git_url":"git://github.com/ModuleLoader/es6-module-loader.git","ssh_url":"git@github.com:ModuleLoader/es6-module-loader.git","clone_url":"https://github.com/ModuleLoader/es6-module-loader.git","svn_url":"https://github.com/ModuleLoader/es6-module-loader","homepage":"","size":9092,"stargazers_count":1292,"watchers_count":1292,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":117,"mirror_url":null,"open_issues_count":11,"forks":117,"open_issues":11,"watchers":1292,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448"},"html":{"href":"https://github.com/ModuleLoader/es6-module-loader/pull/448"},"issue":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues/448"},"comments":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/ModuleLoader/es6-module-loader/statuses/a9fbf1ce51f74e4afca7d551d881517a9bbbc134"}}}}