{"action":"created","comment":{"url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/comments/66696597","id":66696597,"diff_hunk":"@@ -75,6 +77,35 @@ SubresourceIntegrityPlugin.prototype.apply = function apply(compiler) {\n     }).join(' ');\n   }\n \n+  /* html-webpack-plugin has added an event so we can pre-process the html tags before they\n+   inject them. This does the work.\n+   */\n+  function processTag(tag, compilation) {\n+    if (!tag.attributes) return;\n+    var src =  tag.attributes.href; // link tags have href\n+    if (!src) {\n+      src = tag.attributes.src; // script tags have src\n+    }\n+    if (!src) {\n+      return;\n+    }\n+    var base = path.basename(src);\n+    var asset = compilation.assets[base];\n+    if (asset && asset.integrity) {\n+      tag.attributes.integrity = asset.integrity;\n+      tag.attributes.crossorigin = 'anonymous';\n+    }","path":"index.js","position":35,"original_position":35,"commit_id":"f86f5cd16488c1c0885b30d6ee9dff349eee1747","original_commit_id":"f86f5cd16488c1c0885b30d6ee9dff349eee1747","user":{"login":"jscheid","id":3514,"avatar_url":"https://avatars.githubusercontent.com/u/3514?v=3","gravatar_id":"","url":"https://api.github.com/users/jscheid","html_url":"https://github.com/jscheid","followers_url":"https://api.github.com/users/jscheid/followers","following_url":"https://api.github.com/users/jscheid/following{/other_user}","gists_url":"https://api.github.com/users/jscheid/gists{/gist_id}","starred_url":"https://api.github.com/users/jscheid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jscheid/subscriptions","organizations_url":"https://api.github.com/users/jscheid/orgs","repos_url":"https://api.github.com/users/jscheid/repos","events_url":"https://api.github.com/users/jscheid/events{/privacy}","received_events_url":"https://api.github.com/users/jscheid/received_events","type":"User","site_admin":false},"body":"I think this should be followed by something like\r\n\r\n```\r\n    } else {\r\n      compilation.warnings.push(new Error(\r\n        \"webpack-subresource-integrity: cannot determine hash for asset '\" +\r\n          base + \"', the resource will be unprotected.\"));\r\n    }\r\n```\r\n\r\nOr perhaps even push to `compilation.errors` considering that all assets should come with a hash.\r\n","created_at":"2016-06-11T00:18:14Z","updated_at":"2016-06-11T00:18:14Z","html_url":"https://github.com/waysact/webpack-subresource-integrity/pull/5#discussion_r66696597","pull_request_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/comments/66696597"},"html":{"href":"https://github.com/waysact/webpack-subresource-integrity/pull/5#discussion_r66696597"},"pull_request":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5","id":73430131,"html_url":"https://github.com/waysact/webpack-subresource-integrity/pull/5","diff_url":"https://github.com/waysact/webpack-subresource-integrity/pull/5.diff","patch_url":"https://github.com/waysact/webpack-subresource-integrity/pull/5.patch","issue_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues/5","number":5,"state":"open","locked":false,"title":"Direct support for html-webpack-plugin courtesy of a nice hook they added","user":{"login":"SPSpwetter","id":12737454,"avatar_url":"https://avatars.githubusercontent.com/u/12737454?v=3","gravatar_id":"","url":"https://api.github.com/users/SPSpwetter","html_url":"https://github.com/SPSpwetter","followers_url":"https://api.github.com/users/SPSpwetter/followers","following_url":"https://api.github.com/users/SPSpwetter/following{/other_user}","gists_url":"https://api.github.com/users/SPSpwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/SPSpwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SPSpwetter/subscriptions","organizations_url":"https://api.github.com/users/SPSpwetter/orgs","repos_url":"https://api.github.com/users/SPSpwetter/repos","events_url":"https://api.github.com/users/SPSpwetter/events{/privacy}","received_events_url":"https://api.github.com/users/SPSpwetter/received_events","type":"User","site_admin":false},"body":"Also updated docs. \r\n\r\nWith this change, anyone using html-webpack-plugin will get integrity attributes added to their script tags. \r\n\r\nAlso bumped revision number. \r\n\r\nThis also addresses issue #3 ","created_at":"2016-06-10T20:19:43Z","updated_at":"2016-06-11T00:18:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32d0bf5aa5b8f8836fbb9ba6f88e436a3ef575f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5/commits","review_comments_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5/comments","review_comment_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues/5/comments","statuses_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/statuses/f86f5cd16488c1c0885b30d6ee9dff349eee1747","head":{"label":"SPSpwetter:html-webpack-hook","ref":"html-webpack-hook","sha":"f86f5cd16488c1c0885b30d6ee9dff349eee1747","user":{"login":"SPSpwetter","id":12737454,"avatar_url":"https://avatars.githubusercontent.com/u/12737454?v=3","gravatar_id":"","url":"https://api.github.com/users/SPSpwetter","html_url":"https://github.com/SPSpwetter","followers_url":"https://api.github.com/users/SPSpwetter/followers","following_url":"https://api.github.com/users/SPSpwetter/following{/other_user}","gists_url":"https://api.github.com/users/SPSpwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/SPSpwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SPSpwetter/subscriptions","organizations_url":"https://api.github.com/users/SPSpwetter/orgs","repos_url":"https://api.github.com/users/SPSpwetter/repos","events_url":"https://api.github.com/users/SPSpwetter/events{/privacy}","received_events_url":"https://api.github.com/users/SPSpwetter/received_events","type":"User","site_admin":false},"repo":{"id":60810024,"name":"webpack-subresource-integrity","full_name":"SPSpwetter/webpack-subresource-integrity","owner":{"login":"SPSpwetter","id":12737454,"avatar_url":"https://avatars.githubusercontent.com/u/12737454?v=3","gravatar_id":"","url":"https://api.github.com/users/SPSpwetter","html_url":"https://github.com/SPSpwetter","followers_url":"https://api.github.com/users/SPSpwetter/followers","following_url":"https://api.github.com/users/SPSpwetter/following{/other_user}","gists_url":"https://api.github.com/users/SPSpwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/SPSpwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SPSpwetter/subscriptions","organizations_url":"https://api.github.com/users/SPSpwetter/orgs","repos_url":"https://api.github.com/users/SPSpwetter/repos","events_url":"https://api.github.com/users/SPSpwetter/events{/privacy}","received_events_url":"https://api.github.com/users/SPSpwetter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SPSpwetter/webpack-subresource-integrity","description":"Webpack plugin for ensuring subresource integrity.","fork":true,"url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity","forks_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/forks","keys_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/teams","hooks_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/hooks","issue_events_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/issues/events{/number}","events_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/events","assignees_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/assignees{/user}","branches_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/branches{/branch}","tags_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/tags","blobs_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/git/refs{/sha}","trees_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/statuses/{sha}","languages_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/languages","stargazers_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/stargazers","contributors_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/contributors","subscribers_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/subscribers","subscription_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/subscription","commits_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/commits{/sha}","git_commits_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/git/commits{/sha}","comments_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/comments{/number}","issue_comment_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/issues/comments{/number}","contents_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/contents/{+path}","compare_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/merges","archive_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/downloads","issues_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/issues{/number}","pulls_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/pulls{/number}","milestones_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/milestones{/number}","notifications_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/labels{/name}","releases_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/releases{/id}","deployments_url":"https://api.github.com/repos/SPSpwetter/webpack-subresource-integrity/deployments","created_at":"2016-06-09T22:04:22Z","updated_at":"2016-06-09T22:04:22Z","pushed_at":"2016-06-10T23:52:52Z","git_url":"git://github.com/SPSpwetter/webpack-subresource-integrity.git","ssh_url":"git@github.com:SPSpwetter/webpack-subresource-integrity.git","clone_url":"https://github.com/SPSpwetter/webpack-subresource-integrity.git","svn_url":"https://github.com/SPSpwetter/webpack-subresource-integrity","homepage":"","size":24,"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":"waysact:master","ref":"master","sha":"d06a46c6b0f384b9189b5f9c024f0fe713c0c3d9","user":{"login":"waysact","id":990273,"avatar_url":"https://avatars.githubusercontent.com/u/990273?v=3","gravatar_id":"","url":"https://api.github.com/users/waysact","html_url":"https://github.com/waysact","followers_url":"https://api.github.com/users/waysact/followers","following_url":"https://api.github.com/users/waysact/following{/other_user}","gists_url":"https://api.github.com/users/waysact/gists{/gist_id}","starred_url":"https://api.github.com/users/waysact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waysact/subscriptions","organizations_url":"https://api.github.com/users/waysact/orgs","repos_url":"https://api.github.com/users/waysact/repos","events_url":"https://api.github.com/users/waysact/events{/privacy}","received_events_url":"https://api.github.com/users/waysact/received_events","type":"Organization","site_admin":false},"repo":{"id":46527115,"name":"webpack-subresource-integrity","full_name":"waysact/webpack-subresource-integrity","owner":{"login":"waysact","id":990273,"avatar_url":"https://avatars.githubusercontent.com/u/990273?v=3","gravatar_id":"","url":"https://api.github.com/users/waysact","html_url":"https://github.com/waysact","followers_url":"https://api.github.com/users/waysact/followers","following_url":"https://api.github.com/users/waysact/following{/other_user}","gists_url":"https://api.github.com/users/waysact/gists{/gist_id}","starred_url":"https://api.github.com/users/waysact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waysact/subscriptions","organizations_url":"https://api.github.com/users/waysact/orgs","repos_url":"https://api.github.com/users/waysact/repos","events_url":"https://api.github.com/users/waysact/events{/privacy}","received_events_url":"https://api.github.com/users/waysact/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/waysact/webpack-subresource-integrity","description":"Webpack plugin for ensuring subresource integrity.","fork":false,"url":"https://api.github.com/repos/waysact/webpack-subresource-integrity","forks_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/forks","keys_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/teams","hooks_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/hooks","issue_events_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues/events{/number}","events_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/events","assignees_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/assignees{/user}","branches_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/branches{/branch}","tags_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/tags","blobs_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/git/refs{/sha}","trees_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/statuses/{sha}","languages_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/languages","stargazers_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/stargazers","contributors_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/contributors","subscribers_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/subscribers","subscription_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/subscription","commits_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/commits{/sha}","git_commits_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/git/commits{/sha}","comments_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/comments{/number}","issue_comment_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues/comments{/number}","contents_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/contents/{+path}","compare_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/merges","archive_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/downloads","issues_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues{/number}","pulls_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls{/number}","milestones_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/milestones{/number}","notifications_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/labels{/name}","releases_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/releases{/id}","deployments_url":"https://api.github.com/repos/waysact/webpack-subresource-integrity/deployments","created_at":"2015-11-19T23:39:06Z","updated_at":"2016-04-15T18:01:04Z","pushed_at":"2016-06-11T00:01:28Z","git_url":"git://github.com/waysact/webpack-subresource-integrity.git","ssh_url":"git@github.com:waysact/webpack-subresource-integrity.git","clone_url":"https://github.com/waysact/webpack-subresource-integrity.git","svn_url":"https://github.com/waysact/webpack-subresource-integrity","homepage":"","size":28,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5"},"html":{"href":"https://github.com/waysact/webpack-subresource-integrity/pull/5"},"issue":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues/5"},"comments":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/waysact/webpack-subresource-integrity/statuses/f86f5cd16488c1c0885b30d6ee9dff349eee1747"}}}}
{"actor":{"display_login":"jscheid"}}