cherry-pick(#21283): chore: do not generate history entries on snapshot switch
This commit is contained in:
parent
e9fe663e89
commit
128b2ff1d5
|
|
@ -77,7 +77,12 @@ export const SnapshotTab: React.FunctionComponent<{
|
||||||
if (!iframeRef.current)
|
if (!iframeRef.current)
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
iframeRef.current.src = snapshotUrl + (pointX === undefined ? '' : `&pointX=${pointX}&pointY=${pointY}`);
|
const newUrl = snapshotUrl + (pointX === undefined ? '' : `&pointX=${pointX}&pointY=${pointY}`);
|
||||||
|
// Try preventing history entry from being created.
|
||||||
|
if (iframeRef.current.contentWindow)
|
||||||
|
iframeRef.current.contentWindow.location.replace(newUrl);
|
||||||
|
else
|
||||||
|
iframeRef.current.src = newUrl;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue