Repository navigation
🐛 check message source for embed-size in Bento amp-iframe - #40575
Open
mrdevel2002-ui wants to merge 1 commit into
Open
mrdevel2002-ui wants to merge 1 commit into
mrdevel2002-ui wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BentoIframe (
extensions/amp-iframe/1.0/component.js) listens forembed-sizeon the parent window but never checksevent.source, unlike thesend-intersectionshandler in the same file, the 0.1 element (which goes throughlistenFor), and the shared preactIframeEmbed. Any frame on the page, such as an ad or another embed, can post{type: 'embed-size', height, width}and every Bento amp-iframe will request a resize to those dimensions, immediately when it is out of view and otherwise the next time it leaves the viewport. The handler now ignores messages that don't come from the component's own iframe, and the new component tests cover both the accepted and the rejected case (the rejection test fails on the current tree with a 1000x1000 resize from a foreign window).