Webview2 catch a request for: ?

vmars316 621 Reputation points

TIA , I am working on a KidSafeBrowser
where I catch this request in NavigationStarting ; (users can only visit sites that are Pre-Approved and stored in an Approved-Links-File) .

But problem is if user does a 'search' or 'clicks on a link' .
I am unable to catch that in NavigationStarting .

How/where can I catch that request ?


Thanks for your Help...

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,229 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. XuDong Peng-MSFT 10,341 Reputation points Microsoft Vendor

    Hi @vmars316 ,

    If you need to get the request in the webView2 control, you can try to use CoreWebView2.WebResourceRequested Event to implement this requirement.

    And this must add at least one filter to raise the event, in the request class object you can view its various properties such as Content , Headers, Method and Uri. For more details, you can refer to this doc: CoreWebView2WebResourceRequest Class.

    Xudong Peng

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments