Skip to content

window.opener should not be readonly #23032

@lediur

Description

@lediur

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions