amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Whitelist amp-lightbox as part of an AMP ad

Open jasti opened this issue 9 years ago • 5 comments

amp-lightbox is currently not allowed in an AMP ad. Here is a legitimate use case. https://joystick.app.box.com/s/oo42mzgbx8t6leohqfl4se98pvtcxzyp CC @ampproject/a4a

Can we whitelist it?

jasti avatar Jan 12 '17 16:01 jasti

@dvoytenko / @tdrl do you recall if there was a reason we did not allow it to start? Do we expect it to behave properly when within a friendly frame?

keithwrightbos avatar Jan 12 '17 16:01 keithwrightbos

amp-lightbox (and amp-image-lightbox) take over the whole viewport. This is what we want to do here as well?

In A4A we can do this. I'm pretty sure it doesn't currently fully work.

In 3p case, however, we need to establish some form of control. This would have to be done via messaging from the 3p iframe. We can't blankly allow all such requests from 3p. We have to ensure that request is sent on user action. This is similar how requestFullscreen API works. That being said, I think we can find a way to do this, we just need some research.

Btw, this is something we've been talking to browsers about. See https://github.com/whatwg/html/issues/1983 and https://bugs.chromium.org/p/chromium/issues/detail?id=621631

dvoytenko avatar Jan 12 '17 19:01 dvoytenko

@dvoytenko, I do mean just whitelisting it for A4A. Any more detail on what's blocking there?

jasti avatar Feb 21 '17 14:02 jasti

The full-screen overlay cannot escape the boundary of an iframe. So to make this work correctly in AMP, the whole iframe should be temporarily resized to take over the whole viewport. That by itself is ok, but we need to make sure the transition itself is not overly disruptive.

dvoytenko avatar Feb 21 '17 17:02 dvoytenko

Closing this in preference of #2736.

jasti avatar Mar 30 '17 22:03 jasti