Conversation
The prepublish/highlight callbacks captured the preview iframe's document once during initialize(), then relied on a 10s polling loop to find it. Any navigation after that point left the callbacks pointing at a stale or blank document and could miss the iframe entirely if it wasn't ready in time - causing the intermittent missing "Run content check" button and prepublish checks that found no content/errors. getPreviewDom() now resolves the iframe's document at call time instead of caching it, so callbacks always see the current preview. Bump to 4.3.4 and update the release changelog.
DanielCoelhoOliveira97
approved these changes
Jul 28, 2026
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
siteimprove.jscaptured the preview iframe'sdocumentonce duringinitialize()(via a 10s polling loop), then reused that captured reference in theonHighlightandregisterPrepublishCallbackclosures. Any in-CMS navigation after that point replaces the iframe's document, so the callbacks kept pointing at a stale/blank document - explaining both the missing button (polling loop gave up before the iframe existed) and the empty/scoreless checks (checks ran against a blank or detached document).getPreviewDom(), which resolves the iframe's current document at call time instead of caching it once. Callbacks are now registered immediately after theIsAuthorizedcheck, and the polling loop is removed since there's nothing to wait for anymore..nupkgat the repo root, replacing 4.3.3, per this repo's existing release convention.Test plan
dotnet build(Debug and Release) succeeds with no errors.ZipPluginContentbuild target) contains the updatedsiteimprove.jswith no remaining references to the removed polling loop.