@arsedizioni/ars-utils 21.2.358 → 21.2.359

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3865,17 +3865,26 @@ class ClipperDocumentComponent extends ClipperDocumentManager {
3865
3865
  /**
3866
3866
  * Sets the iframe `src` ensuring a reload happens even when the URL is identical
3867
3867
  * to the current one (some browsers skip the navigation otherwise).
3868
+ *
3869
+ * When the URL is unchanged we use `location.replace`, which forces a reload without
3870
+ * adding a new entry to the iframe's history — this preserves the Back/Forward
3871
+ * behaviour driven by the iframe itself. If the iframe is cross-origin and the
3872
+ * replace throws, we fall back to a plain `src` assignment.
3873
+ *
3868
3874
  * @param el - The iframe element to update.
3869
3875
  * @param url - The URL to navigate to.
3870
3876
  */
3871
3877
  setIframeSrc(el, url) {
3872
3878
  if (el.src === url) {
3873
- el.src = 'about:blank';
3874
- setTimeout(() => { el.src = url; }, 0);
3875
- }
3876
- else {
3877
- el.src = url;
3879
+ try {
3880
+ el.contentWindow?.location.replace(url);
3881
+ return;
3882
+ }
3883
+ catch {
3884
+ // Cross-origin access denied: fall through to the standard src assignment.
3885
+ }
3878
3886
  }
3887
+ el.src = url;
3879
3888
  }
3880
3889
  /**
3881
3890
  * Called by the iframe when a document has finished rendering.