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.opener should not be readonly #23032

Closed
lediur opened this issue Mar 30, 2018 · 3 comments
Closed

window.opener should not be readonly #23032

lediur opened this issue Mar 30, 2018 · 3 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue

Comments

@lediur
Copy link

lediur commented Mar 30, 2018

TypeScript Version: 2.8.1 (not present in 2.7.2)

Search Terms: opener (found #10379, but this was back in 2.0 / 2016), window readonly, set window opener to null typescript 2.8

Code

const newWindow = window.open(url);
if (newWindow) {
  newWindow.opener = null;
}

Expected behavior:
window.opener should be assignable to null for security reasons (e.g. microsoft/monaco-editor#601). Setting the noopener window feature only works in modern browsers.

Actual behavior:
window.opener is declared as readonly. This appears to be a 2.8 regression of #10379

Playground Link: here

Related Issues:
#10379

@mhegazy
Copy link
Contributor

mhegazy commented Mar 30, 2018

Should be fixed by microsoft/TypeScript-DOM-lib-generator#397. Fix should be included in 2.8.2 release.

@mhegazy mhegazy closed this as completed Mar 30, 2018
@mhegazy mhegazy added Fixed A PR has been merged for this issue Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Mar 30, 2018
@mhegazy mhegazy added this to the TypeScript 2.8.2 milestone Mar 30, 2018
@mhegazy mhegazy self-assigned this Mar 30, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Mar 30, 2018

reported earlier in #10379 (comment)

@lediur
Copy link
Author

lediur commented Mar 30, 2018

Oops, I saw that yesterday but for some reason didn't see the last comment. Good to know! Thanks for following up.

@mhegazy mhegazy added Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet and removed Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet labels Apr 2, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants