{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/60108994","id":60108994,"diff_hunk":"@@ -15,14 +15,31 @@\n  */\n \n import {BaseElement} from './base-element';\n+import {getMode} from '../src/mode'\n \n \n /** @type {!Array} */\n export const stubbedElements = [];\n \n+let ampAdScriptInserted = false;\n+\n export class ElementStub extends BaseElement {\n   constructor(element) {\n     super(element);\n+    if((element.tagName.toLowerCase() == \"amp-ad\"\n+      || element.tagName.toLowerCase() == \"amp-embed\") \n+      && (!ampAdScriptInserted)) {\n+      var ampAdScript = this.getWin().document.createElement('script');\n+      ampAdScript.async = true;\n+      ampAdScript.setAttribute('custom-element', 'amp-ad');\n+      if (getMode().localDev) {\n+        ampAdScript.src = \"http://localhost:8000/dist/v0/amp-ad-0.1.max.js\";\n+      } else {\n+        ampAdScript.src = \"https://cdn.ampproject.org/v0/amp-ad-0.1.js\";","path":"src/element-stub.js","position":24,"original_position":24,"commit_id":"d3a23248e74cf497a95361056ab3ae1679a58329","original_commit_id":"d3a23248e74cf497a95361056ab3ae1679a58329","user":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"body":"Ping @erwinmombay about inserting the `rtv` version here.","created_at":"2016-04-18T18:24:06Z","updated_at":"2016-04-18T18:24:06Z","html_url":"https://github.com/ampproject/amphtml/pull/2902#discussion_r60108994","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/2902","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/60108994"},"html":{"href":"https://github.com/ampproject/amphtml/pull/2902#discussion_r60108994"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2902"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/2902","id":66410569,"html_url":"https://github.com/ampproject/amphtml/pull/2902","diff_url":"https://github.com/ampproject/amphtml/pull/2902.diff","patch_url":"https://github.com/ampproject/amphtml/pull/2902.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/2902","number":2902,"state":"open","locked":false,"title":"RFC: Factor amp-ad into extension","user":{"login":"zhouyx","id":5419904,"avatar_url":"https://avatars.githubusercontent.com/u/5419904?v=3","gravatar_id":"","url":"https://api.github.com/users/zhouyx","html_url":"https://github.com/zhouyx","followers_url":"https://api.github.com/users/zhouyx/followers","following_url":"https://api.github.com/users/zhouyx/following{/other_user}","gists_url":"https://api.github.com/users/zhouyx/gists{/gist_id}","starred_url":"https://api.github.com/users/zhouyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhouyx/subscriptions","organizations_url":"https://api.github.com/users/zhouyx/orgs","repos_url":"https://api.github.com/users/zhouyx/repos","events_url":"https://api.github.com/users/zhouyx/events{/privacy}","received_events_url":"https://api.github.com/users/zhouyx/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-13T23:56:19Z","updated_at":"2016-04-18T18:24:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ac4070274621a970d169a27cd6a240d10b99ff2","assignee":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/2902/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/2902/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/2902/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/d3a23248e74cf497a95361056ab3ae1679a58329","head":{"label":"zhouyx:ads-extension","ref":"ads-extension","sha":"d3a23248e74cf497a95361056ab3ae1679a58329","user":{"login":"zhouyx","id":5419904,"avatar_url":"https://avatars.githubusercontent.com/u/5419904?v=3","gravatar_id":"","url":"https://api.github.com/users/zhouyx","html_url":"https://github.com/zhouyx","followers_url":"https://api.github.com/users/zhouyx/followers","following_url":"https://api.github.com/users/zhouyx/following{/other_user}","gists_url":"https://api.github.com/users/zhouyx/gists{/gist_id}","starred_url":"https://api.github.com/users/zhouyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhouyx/subscriptions","organizations_url":"https://api.github.com/users/zhouyx/orgs","repos_url":"https://api.github.com/users/zhouyx/repos","events_url":"https://api.github.com/users/zhouyx/events{/privacy}","received_events_url":"https://api.github.com/users/zhouyx/received_events","type":"User","site_admin":false},"repo":{"id":55454453,"name":"amphtml","full_name":"zhouyx/amphtml","owner":{"login":"zhouyx","id":5419904,"avatar_url":"https://avatars.githubusercontent.com/u/5419904?v=3","gravatar_id":"","url":"https://api.github.com/users/zhouyx","html_url":"https://github.com/zhouyx","followers_url":"https://api.github.com/users/zhouyx/followers","following_url":"https://api.github.com/users/zhouyx/following{/other_user}","gists_url":"https://api.github.com/users/zhouyx/gists{/gist_id}","starred_url":"https://api.github.com/users/zhouyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhouyx/subscriptions","organizations_url":"https://api.github.com/users/zhouyx/orgs","repos_url":"https://api.github.com/users/zhouyx/repos","events_url":"https://api.github.com/users/zhouyx/events{/privacy}","received_events_url":"https://api.github.com/users/zhouyx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhouyx/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/zhouyx/amphtml","forks_url":"https://api.github.com/repos/zhouyx/amphtml/forks","keys_url":"https://api.github.com/repos/zhouyx/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhouyx/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhouyx/amphtml/teams","hooks_url":"https://api.github.com/repos/zhouyx/amphtml/hooks","issue_events_url":"https://api.github.com/repos/zhouyx/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/zhouyx/amphtml/events","assignees_url":"https://api.github.com/repos/zhouyx/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/zhouyx/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/zhouyx/amphtml/tags","blobs_url":"https://api.github.com/repos/zhouyx/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhouyx/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhouyx/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhouyx/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhouyx/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/zhouyx/amphtml/languages","stargazers_url":"https://api.github.com/repos/zhouyx/amphtml/stargazers","contributors_url":"https://api.github.com/repos/zhouyx/amphtml/contributors","subscribers_url":"https://api.github.com/repos/zhouyx/amphtml/subscribers","subscription_url":"https://api.github.com/repos/zhouyx/amphtml/subscription","commits_url":"https://api.github.com/repos/zhouyx/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhouyx/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhouyx/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhouyx/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhouyx/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/zhouyx/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhouyx/amphtml/merges","archive_url":"https://api.github.com/repos/zhouyx/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhouyx/amphtml/downloads","issues_url":"https://api.github.com/repos/zhouyx/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/zhouyx/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/zhouyx/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/zhouyx/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhouyx/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/zhouyx/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/zhouyx/amphtml/deployments","created_at":"2016-04-05T00:10:42Z","updated_at":"2016-04-05T00:10:45Z","pushed_at":"2016-04-18T18:04:37Z","git_url":"git://github.com/zhouyx/amphtml.git","ssh_url":"git@github.com:zhouyx/amphtml.git","clone_url":"https://github.com/zhouyx/amphtml.git","svn_url":"https://github.com/zhouyx/amphtml","homepage":"https://ampproject.org","size":32132,"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":"ampproject:master","ref":"master","sha":"d47bf25e011249083962798e8900ec080929b014","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2016-04-18T17:53:26Z","pushed_at":"2016-04-18T18:08:38Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":43565,"stargazers_count":7218,"watchers_count":7218,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":920,"mirror_url":null,"open_issues_count":367,"forks":920,"open_issues":367,"watchers":7218,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2902"},"html":{"href":"https://github.com/ampproject/amphtml/pull/2902"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/2902"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/2902/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2902/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2902/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/d3a23248e74cf497a95361056ab3ae1679a58329"}}}}