this.isEmbedded_ is false in a WebView
https://github.com/ampproject/amphtml/blob/master/src/service/viewer-impl.js#L144
In a WebView, there is no win.parent so the above check is false.
What browsers are affected?
WebView
Which AMP version is affected?
All
To expand, the window.parent is actually window, even though the WebView is a managed viewer context. We'll need a bit more to determine if we are inside a viewer, though the win.parent === win is a good check for other environments.
Viewer.isEmbedded() is a bad name. It should be isIframed() - most of code that uses it actually cares whether or not the page is in iframe. I suggest we renamed isEmbedded to isIframed and then we can start using isEmbedded for viewer-based things.
+1
On Thu, May 5, 2016 at 3:57 PM, Dima Voytenko [email protected] wrote:
Viewer.isEmbedded() is a bad name. It should be isIframed() - most of code that uses it actually cares whether or not the page is in iframe. I suggest we renamed isEmbedded to isIframed and then we can start using isEmbedded for viewer-based things.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/ampproject/amphtml/issues/3117#issuecomment-217303982
Putting this in the backlog, but please feel free to change if there's a task here with a more specific target
Already in review.