Skip to content

isSafeFrame detection not detecting AMP forced SafeFrame #242

@Sir-Will

Description

@Sir-Will

Describe the bug
While testing an integration in AMP environment, I encountered the issue of it not resizing the iframe. It turns out that the isSafeFrame check does not work for the forced SafeFrame by AMP.

The moment SafeFrame is being enabled in GAM, the detection works.

export function isSafeFrame(win) {
return !!(win.$sf && win.$sf.ext);
}

The only workaround seems to be to create dedicated line items and creatives for AMP, which has SafeFrame enabled in GAM.

It might make sense to always send the resize message for AMP, if there is no possibility without SafeFrame.

if (isSafeFrame(window)) {

To Reproduce
Steps to reproduce the behavior:

  1. AMP environment page
  2. Serve GAM creative with SafeFrame off
  3. Set breakpoint on isSafeFrame, in amp.js
  4. See it resulting in false and iframe src containing "safeframe" URL

Expected behavior
Outgoing AMP embed-siz message when the creative does not have SafeFrame checked.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Ready for Dev

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions