mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 05:37:20 +03:00
chore: do not generate history entries on snapshot switch (#21283)
This commit is contained in:
parent
2cbafd7adf
commit
c42a1205b1
@ -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) {
|
||||
}
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user