Skip to content

Commit

Permalink
Add sandbox attributes to amp-video-iframe (#18228)
Browse files Browse the repository at this point in the history
- `allow-popups-to-escape-sandbox`
- `allow-top-navigation-by-user-activation`

This is so that video-ad clickthrough targets can be reached.
  • Loading branch information
klipstein authored and alanorozco committed Nov 12, 2018
1 parent 661ee28 commit d823cc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extensions/amp-video-iframe/0.1/amp-video-iframe.js
Expand Up @@ -54,6 +54,8 @@ const ANALYTICS_EVENT_TYPE_PREFIX = 'video-custom-';
const SANDBOX = [
SandboxOptions.ALLOW_SCRIPTS,
SandboxOptions.ALLOW_SAME_ORIGIN,
SandboxOptions.ALLOW_POPUPS_TO_ESCAPE_SANDBOX,
SandboxOptions.ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION,
];

/**
Expand Down
3 changes: 3 additions & 0 deletions src/iframe-video.js
Expand Up @@ -26,6 +26,9 @@ import {tryParseJson} from './json';
export const SandboxOptions = {
ALLOW_SCRIPTS: 'allow-scripts',
ALLOW_SAME_ORIGIN: 'allow-same-origin',
ALLOW_POPUPS_TO_ESCAPE_SANDBOX: 'allow-popups-to-escape-sandbox',
ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION:
'allow-top-navigation-by-user-activation',
};


Expand Down

0 comments on commit d823cc4

Please sign in to comment.