MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Bug: Empty Referrer when opening link in new window

Open
#4,722 3 comments 0 reactions 1 assignee View on GitHub

@JosephJin0815 is already working on this.

Since Aug 1, 2024.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

When a link is opened in the same window or automatically in a new window (i.e. target="_blank"), then the referrer will be available for the opened page, but if a link is opened in a new window manually (by using "Open in new window" from the context menu or Ctrl + clicking), then the referrer will be empty.

This behavior is not reproducible in Microsoft Edge, i.e. in that browser the referrer is available to the opened page when it is manually opened in a new tab/window.

The behavior is not reproducible with WebView2 if the link is opened with Shift+Click.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

WPF

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

Open a link in a new window manually in WebView2WpfBrowser
For minimal repro I'm using the WebView2WpfBrowser sample app with the following change:

  • MainWindow.xaml: remove Source="https://www.bing.com/" from the <wv2:WebView2> tag.

Steps:

  1. Modify, build and start the WebView2WpfBrowser sample app
  2. Visit https://duckduckgo.com/?q=what%27s+my+referrer
  3. Ctrl + click the result that links to whatsmyreferer.com (or right-click it and select "Open link in new window")
    Result: The reported referrer is blank

image

Open a link in a new window manually in Microsoft Edge

  1. Start Microsoft Edge
  2. Visit https://duckduckgo.com/?q=what%27s+my+referrer
  3. Ctrl + click the result that links to whatsmyreferer.com (or right-click it and select "Open link in new tab")
    Result: The reported referrer is duckduckgo.com

image

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

AB#53005507

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.