Skip to content

Strange 3P iframe postMessages #2943

@jridgewell

Description

@jridgewell

Short description of your issue:

I'm seeing some weird postMessages that fail origin checks. Seems to be that we're posing a message to an ad's iframe (Let's call this iframe B) using the iframe A's origin (A and B are really the same ad iframe, but A is the from the original request to the page, and B is after back-buttoning).

This is blocking intersection observers, which I think is a high priority issue.

v0.js:66 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://d-42722960602249103560.ampproject.net') does not match the recipient window's origin ('https://d-14131338191735336809.ampproject.net').
  Gb.postMessage @ v0.js:66
  b.sendEmbedInfo_ @ v0.js:345
  (anonymous function) @ v0.js:343
  (anonymous function) @ v0.js:64
  D.fire @ v0.js:64
  M.onVisibilityChange_ @ v0.js:182
  M.setVisibilityState_ @ v0.js:184
  M.recheckVisibilityState_ @ v0.js:183
  (anonymous function) @ v0.js:64
  D.fire @ v0.js:64
  od.onVisibilityChanged_ @ v0.js:171

How do we reproduce the issue?

  1. Open up the ads example
  2. Open up the dev console
  3. Filter the console using ^[^X], using regex search and ignoring network messages
  4. Click the "Google" link on top
  5. Hit the back button to go back to the ads example
  6. Open a new tab, then close it (alternatively, tab to your next open tab, then back to ads)
  7. Voilà

What browsers are affected?

Latest chrome, at least. Firefox, and Safari.

Which AMP version is affected?

Current. Maybe since we started giving each ad its own d-XXXXXX.ampproject.net domains.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions