MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: missing WebResourceRequest with COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT context

Open
#5,293 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What happened?

For each navigation start event there are generaly
(at least for normal https pages)
a first WebResourceRequest event with context
equal to COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT

That seems perfectly normal and useful,

but when a new page is created via NewWindowRequest/put_NewWindow,
there are a navigation start event but
no WebResourceRequest event with context
equal to COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT.
The document is loaded but the corresponding WebResourceRequest event
is missing.

the documention say :

Other methods which should affect the new web contents like
add_WebResourceRequested have to be called after setting NewWindow (put_NewWindow);

It's exactly what I did.

Importance

Low. My app is not very affected, or this only affects development.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

137.0.3296.93

SDK Version

1.0.2739.15

Framework

Win32

Operating System

Windows 10

OS Version

No response

Repro steps

just code and test.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

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.

Research direction

Start with the NewWindowRequest and put_NewWindow flow described in the issue, then compare navigation-start events with WebResourceRequested events using the COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT context. Build a minimal code reproduction and determine whether the missing event is expected or an implementation defect; the issue is resolved when the behavior is explained or reproduced with actionable evidence.

Written by the indexing model from the issue text.

Assessment

Domain
api, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.