diff --git a/Optimizely_release_change_log.txt b/Optimizely_release_change_log.txt
index a653b53..4334037 100644
--- a/Optimizely_release_change_log.txt
+++ b/Optimizely_release_change_log.txt
@@ -7,4 +7,5 @@ Date / Plugin Version / Changes made since last version
2023-03-09 / 4.2.1 / Add version number on admin page, update form action url to be more resilient
2025-09-03 / 4.3.1 / Update icons for Siteimprove rebranding
2026-02-09 / 4.3.2 / Removed toolbar button in favor of integrated button in side panel, fixed bug where publishing while logged out would always open the login popup, and fixed intermittent error when registering highlighting and prepublish callbacks
-2026-02-24 / 4.3.3 / Small change on siteimprove.js file
\ No newline at end of file
+2026-02-24 / 4.3.3 / Small change on siteimprove.js file
+2026-07-14 / 4.3.4 / Resolve preview iframe document at check time, fixing intermittent missing "Run content check" button and content checks running against a blank/stale page
\ No newline at end of file
diff --git a/SiteImprove.Optimizely.Plugin.4.3.3.nupkg b/SiteImprove.Optimizely.Plugin.4.3.3.nupkg
deleted file mode 100644
index 61f1893..0000000
Binary files a/SiteImprove.Optimizely.Plugin.4.3.3.nupkg and /dev/null differ
diff --git a/SiteImprove.Optimizely.Plugin.4.3.4.nupkg b/SiteImprove.Optimizely.Plugin.4.3.4.nupkg
new file mode 100644
index 0000000..998f7f0
Binary files /dev/null and b/SiteImprove.Optimizely.Plugin.4.3.4.nupkg differ
diff --git a/SiteImprove.Optimizely.Plugin/SiteImprove.Optimizely.Plugin.csproj b/SiteImprove.Optimizely.Plugin/SiteImprove.Optimizely.Plugin.csproj
index 4a7b3cb..23d61f7 100644
--- a/SiteImprove.Optimizely.Plugin/SiteImprove.Optimizely.Plugin.csproj
+++ b/SiteImprove.Optimizely.Plugin/SiteImprove.Optimizely.Plugin.csproj
@@ -11,7 +11,7 @@
https://github.com/Siteimprove/CMS-plugin-Optimizely
icon.png
Optimizely plugin from SiteImprove
- 4.3.3
+ 4.3.4
diff --git a/SiteImprove.Optimizely.Plugin/modules/_protected/SiteImprove.Optimizely.Plugin_files/1.0.5/ClientResources/Scripts/siteimprove.js b/SiteImprove.Optimizely.Plugin/modules/_protected/SiteImprove.Optimizely.Plugin_files/1.0.5/ClientResources/Scripts/siteimprove.js
index b3ef7a5..c686206 100644
--- a/SiteImprove.Optimizely.Plugin/modules/_protected/SiteImprove.Optimizely.Plugin_files/1.0.5/ClientResources/Scripts/siteimprove.js
+++ b/SiteImprove.Optimizely.Plugin/modules/_protected/SiteImprove.Optimizely.Plugin_files/1.0.5/ClientResources/Scripts/siteimprove.js
@@ -38,38 +38,29 @@
topic.subscribe('epi/shell/context/request', this.contextChange.bind(this));
topic.subscribe('/epi/cms/content/statuschange/', this.statusChange.bind(this));
- this.waitForPreviewIFrame(function (iFrameContentWindow) {
- const dom = iFrameContentWindow?.document;
- if (!dom) return;
- var si = window._si || [];
-
- si.push([
- 'onHighlight',
- function (highlightInfo) {
+ var si = window._si || [];
+ var getPreviewDom = this.getPreviewDom;
+
+ si.push([
+ 'onHighlight',
+ function (highlightInfo) {
+ var dom = getPreviewDom();
+ if (dom) {
si.push(['applyDefaultHighlighting', highlightInfo, dom]);
- },
- ]);
+ }
+ },
+ ]);
- si.push(['registerPrepublishCallback', () => dom]);
- });
- }.bind(this));
+ si.push(['registerPrepublishCallback', getPreviewDom]);
+ }.bind(this));
},
/**
- * Waits for the preview iframe to be available, then executes the callback with the iframe's document as parameter.
- * Will try for a certain amount of attempts before giving up.
+ * Resolves the preview iframe's document at call time. The iframe's document is
+ * replaced on every in-CMS navigation, so it must never be cached.
*/
- waitForPreviewIFrame: async function (callback) {
- const maxAttempts = 10;
-
- for (let i = 0; i < maxAttempts; i++) {
- const previewIFrame = document.querySelector('iframe[name="sitePreview"]');
- if (previewIFrame && previewIFrame.contentWindow) {
- callback(previewIFrame.contentWindow);
- return;
- } else if (i < maxAttempts - 1) {
- await new Promise(resolve => setTimeout(resolve, 1000)); // wait 1 second before trying again
- }
- }
+ getPreviewDom: function () {
+ var previewIFrame = document.querySelector('iframe[name="sitePreview"]');
+ return previewIFrame && previewIFrame.contentWindow ? previewIFrame.contentWindow.document : null;
},
/**
* Event for shell updates. Gets current context. Should only be called one to initialize the _si plugin.