Skip to content

Commit

Permalink
cherry-pick(#21283): chore: do not generate history entries on snapsh…
Browse files Browse the repository at this point in the history
…ot switch
  • Loading branch information
pavelfeldman committed Mar 1, 2023
1 parent e9fe663 commit 128b2ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/trace-viewer/src/ui/snapshotTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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) {
}
})();
Expand Down

0 comments on commit 128b2ff

Please sign in to comment.