Authenticating HTTP requests with cookies from an embedded WebView2 browser in WPF

Authenticating HTTP requests using cookies from an embedded browser in a desktop application can be useful for automating tasks on websites protected by Cloudflare Turnstile . This article demonstrates how to extract cookies from a WebView2 control and add them to the headers of an HttpRequestMessage in a WPF application. To achieve this, we need to create a DelegatingHandler that holds a…