You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
window.open signature has a replace parameter that the docs don't have #31246
So it's either IE-specific, or else something that existed in a previous standard and is no longer officially a thing. (I’m guessing it’s the former because MDN usually still documents obsolete features)
At least in Chrome, this doesn't appear to have an effect.
window.open("https://google.com", "a"); // opens new tab to google
window.open("https://google.com", "a"); // navigates that tab to google
// press and hold the tab's back button to see the history
window.open("https://google.com", "a", "", true); // navigates the tab to google again
// the history is still updated with an entry even though the w3schools page suggests that the new page should replace the existing page in history.
Activity
fatcerberus commentedon May 8, 2019
MSDN lists the
replaceparameter:https://msdn.microsoft.com/en-us/ie/ms536651(v=vs.94)
So it's either IE-specific, or else something that existed in a previous standard and is no longer officially a thing. (I’m guessing it’s the former because MDN usually still documents obsolete features)
pushkin- commentedon May 8, 2019
Bruce Pascoe (@fatcerberus) Hmm found another page that lists that parameter and indicates that it's supported by Chrome and FF...
pushkin- commentedon May 9, 2019
At least in Chrome, this doesn't appear to have an effect.
scottt13 commentedon Mar 18, 2021
This has popped its head up for me recently. Chrome dropped support for the 4th parameter in version 89 and using it now causes an error.
MDN does not mention the replace parameter at all:
https://developer.mozilla.org/en-US/docs/Web/API/Window/open
azack commentedon Mar 19, 2021
Reference for the Chrome change https://chromium.googlesource.com/chromium/src/+/0ed07dc3f70fb426b64f886fc2f0018243443f9e
Related bug and discussion:
https://bugs.chromium.org/p/chromium/issues/detail?id=1164959
jakebailey commentedon Jul 9, 2023
Just looking at old issues; this was fixed in #44684.