Skip to content

🐛 check message source for embed-size in Bento amp-iframe - #40575

Open
mrdevel2002-ui wants to merge 1 commit into
ampproject:mainfrom
mrdevel2002-ui:bento-iframe-embed-size-source
Open

mrdevel2002-ui wants to merge 1 commit into
ampproject:mainfrom
mrdevel2002-ui:bento-iframe-embed-size-source

Conversation

@mrdevel2002-ui

Copy link
Copy Markdown

BentoIframe (extensions/amp-iframe/1.0/component.js) listens for embed-size on the parent window but never checks event.source, unlike the send-intersections handler in the same file, the 0.1 element (which goes through listenFor), and the shared preact IframeEmbed. 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).

@slo741599-code slo741599-code left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ตั้งค่า

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants