@arsedizioni/ars-utils 21.2.358 → 21.2.360

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.
@@ -3863,17 +3863,28 @@ class ClipperDocumentComponent extends ClipperDocumentManager {
3863
3863
  }
3864
3864
  }
3865
3865
  /**
3866
- * Sets the iframe `src` ensuring a reload happens even when the URL is identical
3867
- * to the current one (some browsers skip the navigation otherwise).
3866
+ * Navigates the iframe to the given URL, always pushing a new entry into its
3867
+ * session history — even when the URL is identical to the current one.
3868
+ *
3869
+ * We use `location.assign` instead of setting `src` directly so that:
3870
+ * - the navigation is guaranteed to happen across browsers (assigning the same
3871
+ * string to `src` is a no-op in some engines);
3872
+ * - a new history entry is added, keeping the iframe's Back stack independent
3873
+ * from the parent window's history. Otherwise, repeated Back presses would
3874
+ * eventually fall through to the host page and close the dialog.
3875
+ *
3876
+ * If the iframe is cross-origin and `contentWindow.location` access throws,
3877
+ * we fall back to a plain `src` assignment.
3878
+ *
3868
3879
  * @param el - The iframe element to update.
3869
3880
  * @param url - The URL to navigate to.
3870
3881
  */
3871
3882
  setIframeSrc(el, url) {
3872
- if (el.src === url) {
3873
- el.src = 'about:blank';
3874
- setTimeout(() => { el.src = url; }, 0);
3883
+ try {
3884
+ el.contentWindow?.location.assign(url);
3875
3885
  }
3876
- else {
3886
+ catch {
3887
+ // Cross-origin access denied: fall back to the standard src assignment.
3877
3888
  el.src = url;
3878
3889
  }
3879
3890
  }