@arsedizioni/ars-utils 21.2.359 → 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,28 +3863,30 @@ 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
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.
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.
3873
3878
  *
3874
3879
  * @param el - The iframe element to update.
3875
3880
  * @param url - The URL to navigate to.
3876
3881
  */
3877
3882
  setIframeSrc(el, url) {
3878
- if (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
- }
3883
+ try {
3884
+ el.contentWindow?.location.assign(url);
3885
+ }
3886
+ catch {
3887
+ // Cross-origin access denied: fall back to the standard src assignment.
3888
+ el.src = url;
3886
3889
  }
3887
- el.src = url;
3888
3890
  }
3889
3891
  /**
3890
3892
  * Called by the iframe when a document has finished rendering.