Repository navigation
Conversation
Some themes and security plugins reload themselves as the top-level page when framed. That replaced the editor's preview with the si_preview_nonce copy, where our scripts are excluded, so the check never ran. Sandbox the frame without allow-top-navigation, and make it invisible and inert so editors see the loading indicator instead of a second page.
mostergaard
approved these changes
Nov 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the remaining Prepublish failure in CST-5609. On the customer's site, clicking Prepublish replaced the editor's preview with the
si_preview_noncecopy of the page. Our scripts are excluded on that URL, so the overlay vanished and no check was sent. The likely cause is a theme or security plugin script that reloads itself as the top-level page when it detects a frame.allow-scriptsis kept so script-rendered content is still captured as before. The frame keeps a full viewport so the page lays out the same.Evidence
New browser tests in
tests/browser/prepublish.spec.js, run for both the toolbar and overlay entry points:window._siis gone (Cannot read properties of undefined (reading 'some')).After: all 25 browser tests pass locally in Chrome.
Not run locally: Firefox and the WordPress/multisite suites (the test browser and WordPress downloads time out from my machine). CI covers both.
Merge Danger
Door: two-way
A single JS change; revert restores 2.1.4 behaviour.
Blast Radius: Prepublish
The sandbox applies to the framed page only. Inside it, popups, form submission,
alert/confirmand top navigation are blocked. None are needed to read the DOM, but a site that renders content only after one of them would capture differently. A test build (2.1.5-beta.1) is going to the customer's dev environment to confirm the fix before release.