From c80325658f85d24ff82295dd2d55bfdf789f4163 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 14 Jan 2019 07:24:16 +0000 Subject: [PATCH] Customizer: Use the `sandbox` attribute to prevent top navigation from the preview. Props valchovski. Fixes #42341. git-svn-id: https://develop.svn.wordpress.org/trunk@44583 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/wp/customize/controls.js | 1 + src/js/_enqueues/wp/customize/preview.js | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/js/_enqueues/wp/customize/controls.js b/src/js/_enqueues/wp/customize/controls.js index 357964fcf9..2edc498e42 100644 --- a/src/js/_enqueues/wp/customize/controls.js +++ b/src/js/_enqueues/wp/customize/controls.js @@ -6289,6 +6289,7 @@ name: 'customize-' + previewFrame.channel() } ); previewFrame.iframe.attr( 'onmousewheel', '' ); // Workaround for Safari bug. See WP Trac #38149. + previewFrame.iframe.attr( 'sandbox', 'allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts' ); if ( ! hasPendingChangesetUpdate ) { previewFrame.iframe.attr( 'src', urlParser.href ); diff --git a/src/js/_enqueues/wp/customize/preview.js b/src/js/_enqueues/wp/customize/preview.js index 4d971cc628..e8f7d041c0 100644 --- a/src/js/_enqueues/wp/customize/preview.js +++ b/src/js/_enqueues/wp/customize/preview.js @@ -379,11 +379,6 @@ queryParams.customize_messenger_channel = api.settings.channel; } element.search = $.param( queryParams ); - - // Prevent links from breaking out of preview iframe. - if ( api.settings.channel ) { - element.target = '_self'; - } }; /**