Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.open signature has a replace parameter that the docs don't have #31246

Closed
pushkin- opened this issue May 3, 2019 · 6 comments
Closed
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Milestone

Comments

@pushkin-
Copy link

pushkin- commented May 3, 2019

TypeScript Version: 3.4.3

Search Terms: window open replace

Code window.open(

Intellisense shows a replace property found here in lib.dom.d.ts:

open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;

However, the docs don't have such a parameter.

I did see that parameter listed here on W3Schools, but that's not a trustworthy source. Maybe it's an old parameter that was removed.

@weswigham weswigham added Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Needs Investigation This issue needs a team member to investigate its status. labels May 8, 2019
@fatcerberus
Copy link

fatcerberus commented May 8, 2019

MSDN lists the replace parameter:
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-
Copy link
Author

pushkin- commented May 8, 2019

@fatcerberus Hmm found another page that lists that parameter and indicates that it's supported by Chrome and FF...

@pushkin-
Copy link
Author

pushkin- commented May 9, 2019

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.

@RyanCavanaugh RyanCavanaugh added Question An issue which isn't directly actionable in code and removed Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Needs Investigation This issue needs a team member to investigate its status. labels Aug 22, 2019
@scottt13
Copy link

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
Copy link

azack commented Mar 19, 2021

@RyanCavanaugh RyanCavanaugh reopened this Mar 19, 2021
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript and removed Question An issue which isn't directly actionable in code labels Mar 19, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 19, 2021
@jakebailey
Copy link
Member

Just looking at old issues; this was fixed in #44684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Projects
None yet
Development

No branches or pull requests

7 participants