Skip to content

window.opener should not be readonly #577

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Reposting microsoft/tslint-microsoft-contrib#293 here:

https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/

If you use window.open then you must do this:

let newWnd = window.open();
newWnd.opener = null;

For example, Monaco has to any cast around this:

https://github.com/Microsoft/vscode/blob/d01d178b3b7792d8bc91c03493d5be76b9c4eae8/src/vs/base/browser/dom.ts#L1146

However, opener is marked as readonly. It should not be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions