Skip to content

fix(web-components): pass noopener to window.open in anchor-button navigation - #36902

Open
iyoriovo wants to merge 2 commits into
microsoft:masterfrom
iyoriovo:fix/anchor-button-noopener
Open

iyoriovo wants to merge 2 commits into
microsoft:masterfrom
iyoriovo:fix/anchor-button-noopener

Conversation

@iyoriovo

Copy link
Copy Markdown

Fixes #36901

Description

<fluent-anchor-button> routes modified activations (Ctrl/Cmd+Click and
Ctrl/Cmd+Enter) through window.open(this.href, '_blank') without a
noopener features argument. window.open does not receive the
implicit-noopener protection that browsers apply to target="_blank"
anchor navigation, so the opened document gets access to window.opener,
even when the author explicitly sets rel="noopener noreferrer".

Plain clicks go through the component's internal proxy anchor, which does
forward rel="noopener noreferrer", so the behavior is inconsistent within
the same component (repro in #36901).

Change

Pass noopener,noreferrer in the features argument of window.open so
modified activations honor the same protection as plain clicks and native
anchors.

Verified against published @fluentui/web-components@3.1.3: Ctrl+Click on
fluent-anchor-button yields window.opener in the opened tab, while a
native <a target="_blank" rel="noopener noreferrer"> control yields
null.

…vigation

Modified activations (Ctrl/Cmd+Click, Ctrl/Cmd+Enter) opened links via
window.open without noopener, bypassing rel="noopener noreferrer".

Fixes microsoft#36901

Signed-off-by: iyoriovo <iyorixy1@gmail.com>
Signed-off-by: iyoriovo <iyorixy1@gmail.com>
@iyoriovo
iyoriovo requested a review from a team as a code owner October 16, 2026 03:54
@iyoriovo

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: fluent-anchor-button: Ctrl/Cmd+Click and Ctrl/Cmd+Enter bypass rel="noopener noreferrer" via window.open

1 participant