-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype: Quick, dirty implementation of ad lightboxes #7934
Conversation
@@ -0,0 +1,103 @@ | |||
<!doctype html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add copyright section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
examples/ad-lightbox.amp.html
Outdated
<html ⚡> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>AMP #0</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
properly under normal circumstances. | ||
--> | ||
|
||
<amp-ad-banner layout="fill"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corresponding <script async custom-element="amp-app-banner" src="https://cdn.ampproject.org/v0/amp-app-banner-0.1.js"></script>
is not there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amp-ad-banner
is unimplemented, so it's not needed. The document is not supposed to validate :)
// fallback. | ||
const iframeDoc = iframe.contentDocument; | ||
const iframeBody = iframeDoc.body; | ||
const adBannerRoot = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this has to be a direct child, use childElementByTag
from dom.js
return; | ||
} | ||
|
||
if (!isExperimentOn(this.getAmpDoc().win, A4A_PROTOTYPE_EXPERIMENT)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this up before the isInMainDocument to make the experiment completely side-effect free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
return; | ||
} | ||
|
||
if (!isExperimentOn(this.getAmpDoc().win, A4A_PROTOTYPE_EXPERIMENT)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And done.
This is not production ready.
This PR corresponds to an in-progress prototype. Using an
amp-lightbox
in an ad will not pass validation and will not function properly under normal circumstances.Guarded under
amp-lightbox-a4a-proto
experiment./cc @jasti
Future work
amp-lightbox
module.amp-ad-banner
extension (design pending).