Skip to content

How do I listen for sub-page requests? #2845

Description

@hanfeige

When a page has an IFRame (and possibly a cross-domain) and cannot get a network request, I try two methods

1, use WebResourceResponseReceived

        await webView.EnsureCoreWebView2Async(null);
        webView.CoreWebView2.WebResourceResponseReceived += Test_WebResourceResponseReceived;
  1. Use DevToolsProtocol
        await webView.EnsureCoreWebView2Async(null);
        webView.CoreWebView2.Settings.AreDevToolsEnabled = true;
        await webView.CoreWebView2.CallDevToolsProtocolMethodAsync("Network.enable", "{}");
        var eventReceiver = webView.CoreWebView2.GetDevToolsProtocolEventReceiver("Network.responseReceived");
        eventReceiver.DevToolsProtocolEventReceived += Test_ResponseReceived;

I try to use the Playwright Edge way, through the monitoring page, get all requests, including the IFrame, so speculation has nothing to do with the Edge should be, but I need to use the WPF, Playwright doesn't suit me

But I can only get home page requests. What do I do?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions