@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
|
-
*
|
|
3867
|
-
*
|
|
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
|
-
*
|
|
3870
|
-
*
|
|
3871
|
-
*
|
|
3872
|
-
*
|
|
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
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
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.
|