-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨Add amp-iframe support for Pym.js width and height resize messages (#…
…24917) * Add amp-iframe support for Pym.js width and height resize messages Fixes #22714. Pym.js supports the client window sending several types of messages, including: * `height` * `width` * `parentPositionInfo` * `navigateTo` * `scrollToChildPos` The only two messages that seem relevant in an AMP context are width and height, as they map to the embed-size message that AMP is currently looking for. * Use listen event-helper instead of addEventListner directly * Rename unlisten_ to unlistenPym_ * Use this.win instead of window * Indicate event param is non-nullable MessageEvent * Use getData event helper * Warn user about unsupported Pym.js messages * Replace function binding with arrow function to fix JSC_TYPE_MISMATCH * Add test for Pym.js messages for height and width * Add missing tag argument to user().warn() * Use startsWith string helper * Replace array splice with direct references; fix format comment doc * Add missing ID from Pym message * Populate undefined variable sentinel
- Loading branch information
1 parent
7ac50af
commit 39b1f61
Showing
3 changed files
with
122 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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