chore: do not generate history entries on snapshot switch (#21283)

This commit is contained in:
Pavel Feldman 2023-03-01 13:44:58 -08:00 committed by GitHub
parent 2cbafd7adf
commit c42a1205b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,12 @@ export const SnapshotTab: React.FunctionComponent<{
if (!iframeRef.current)
return;
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) {
}
})();