From d823cc477158f42f8148d0095b033d473efd79c1 Mon Sep 17 00:00:00 2001 From: Tobias von Klipstein Date: Mon, 12 Nov 2018 22:45:24 +0200 Subject: [PATCH] Add sandbox attributes to amp-video-iframe (#18228) - `allow-popups-to-escape-sandbox` - `allow-top-navigation-by-user-activation` This is so that video-ad clickthrough targets can be reached. --- extensions/amp-video-iframe/0.1/amp-video-iframe.js | 2 ++ src/iframe-video.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/extensions/amp-video-iframe/0.1/amp-video-iframe.js b/extensions/amp-video-iframe/0.1/amp-video-iframe.js index dd46bb3db77f..17dcdf217315 100644 --- a/extensions/amp-video-iframe/0.1/amp-video-iframe.js +++ b/extensions/amp-video-iframe/0.1/amp-video-iframe.js @@ -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, ]; /** diff --git a/src/iframe-video.js b/src/iframe-video.js index 74c032ca5c51..be3bb6af1ce5 100644 --- a/src/iframe-video.js +++ b/src/iframe-video.js @@ -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', };