MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Clarify behavior of combination of SetVirtualHostNameToFolderMapping and WebResourceRequestFilter

Open
#2,103 8 comments 0 reactions 1 assignee View on GitHub

@champnic is already working on this.

Since Jan 28, 2022.

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

Description

Hi,

I'm using the WebView2-SDK 1.0.818.41 in C++ and currently trying the following:

  • first I call AddWebResourceRequestedFilter to install a filter for all resources
  • then I add a WebResourceRequested event handler
  • finally I call SetVirtualHostNameToFolderMapping to provide a fall-through for all requests that weren't handled by my event handler. I thought this should work because in one of the samples it is mentioned that "If put_Response is not called, the request will continue as normal."

When I try it like that my WebResourceRequested event handler is never called. It seems that SetVirtualHostNameToFolderMapping grabs the request before. The documentation of SetVirtualHostNameToFolderMapping doesn't contain anything obvious that describes the behavior. So it seems these two functionalities can't be combined.

Can you clarify this and maybe also add some info in the docs?

Thank you in advance!

AB#37954909

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.