{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/12964","repository_url":"https://api.github.com/repos/ampproject/amphtml","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/12964/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/12964/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/12964/events","html_url":"https://github.com/ampproject/amphtml/issues/12964","id":290684966,"number":12964,"title":"amp-iframe same-origin error cannot be avoided when streaming AMP page with amp-shadow","user":{"login":"mattwomple","id":29927572,"avatar_url":"https://avatars0.githubusercontent.com/u/29927572?v=4","gravatar_id":"","url":"https://api.github.com/users/mattwomple","html_url":"https://github.com/mattwomple","followers_url":"https://api.github.com/users/mattwomple/followers","following_url":"https://api.github.com/users/mattwomple/following{/other_user}","gists_url":"https://api.github.com/users/mattwomple/gists{/gist_id}","starred_url":"https://api.github.com/users/mattwomple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattwomple/subscriptions","organizations_url":"https://api.github.com/users/mattwomple/orgs","repos_url":"https://api.github.com/users/mattwomple/repos","events_url":"https://api.github.com/users/mattwomple/events{/privacy}","received_events_url":"https://api.github.com/users/mattwomple/received_events","type":"User","site_admin":false},"labels":[{"id":530198426,"url":"https://api.github.com/repos/ampproject/amphtml/labels/Category:%20PWA","name":"Category: PWA","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ampproject/amphtml/milestones/20","html_url":"https://github.com/ampproject/amphtml/milestone/20","labels_url":"https://api.github.com/repos/ampproject/amphtml/milestones/20/labels","id":1884542,"number":20,"title":"Pending Triage","description":"These issues need to get put into another milestone. They should be assigned to the person who can best decide the appropriate milestone. Optionally, the issue can then be assigned to the most likely implementer.","creator":{"login":"rudygalfi","id":3888212,"avatar_url":"https://avatars3.githubusercontent.com/u/3888212?v=4","gravatar_id":"","url":"https://api.github.com/users/rudygalfi","html_url":"https://github.com/rudygalfi","followers_url":"https://api.github.com/users/rudygalfi/followers","following_url":"https://api.github.com/users/rudygalfi/following{/other_user}","gists_url":"https://api.github.com/users/rudygalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/rudygalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudygalfi/subscriptions","organizations_url":"https://api.github.com/users/rudygalfi/orgs","repos_url":"https://api.github.com/users/rudygalfi/repos","events_url":"https://api.github.com/users/rudygalfi/events{/privacy}","received_events_url":"https://api.github.com/users/rudygalfi/received_events","type":"User","site_admin":false},"open_issues":168,"closed_issues":796,"state":"open","created_at":"2016-07-14T23:13:22Z","updated_at":"2018-03-23T20:25:14Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2018-01-23T02:15:28Z","updated_at":"2018-03-23T23:18:18Z","closed_at":"2018-02-23T00:44:36Z","author_association":"NONE","body":"## What's the issue?\r\n\r\nWhen using `AMP.attachShadowDocAsStream()` as described in the [shadow doc API](https://github.com/ampproject/amphtml/blob/master/spec/amp-shadow-doc.md), there's no way to avoid the inclusion of `amp-iframe` elements that point to the same origin as where the shadow document is being loaded. Then, even before setting the `visibilityState` of the shadow document to `visible`, errors are recorded in the console concerning amp-iframe:\r\n\r\n> Origin of &lt;amp-iframe&gt; must not be equal to container\r\n\r\nWould it be possible to delay the generation of `amp-iframe` same-origin src errors until the `visibilityState` is set to `visible`? This would give me an opportunity to remove/alter the amp-iframe before it shows. I'm open to other suggestions about how to handle this as well.\r\n\r\n## How do we reproduce the issue?\r\n\r\n1. Create a page at _amp.example.com_ that includes an `amp-iframe` pointing to _www.example.com_\r\n2. At _www.example.com_, create a PWA that loads pages from _amp.example.com_ using the streaming API (`attachShadowDocAsStream`).\r\n3. Load the PWA and notice the error quoted above in the console.\r\n\r\n## What browsers are affected?\r\n\r\nTested on the following browsers:\r\n\r\n- Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Mobile Safari/537.36\r\n- Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1\r\n\r\n## Which AMP version is affected?\r\n\r\n1516337355291\r\n"},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/375822818","html_url":"https://github.com/ampproject/amphtml/issues/12964#issuecomment-375822818","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/12964","id":375822818,"user":{"login":"timbur","id":7020411,"avatar_url":"https://avatars0.githubusercontent.com/u/7020411?v=4","gravatar_id":"","url":"https://api.github.com/users/timbur","html_url":"https://github.com/timbur","followers_url":"https://api.github.com/users/timbur/followers","following_url":"https://api.github.com/users/timbur/following{/other_user}","gists_url":"https://api.github.com/users/timbur/gists{/gist_id}","starred_url":"https://api.github.com/users/timbur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbur/subscriptions","organizations_url":"https://api.github.com/users/timbur/orgs","repos_url":"https://api.github.com/users/timbur/repos","events_url":"https://api.github.com/users/timbur/events{/privacy}","received_events_url":"https://api.github.com/users/timbur/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T23:18:18Z","updated_at":"2018-03-23T23:18:18Z","author_association":"NONE","body":"@aghassemi ETA on the solution?"}}
{"actor":{"display_login":"timbur"}}