I'm working on a UWP app and have a page with a WebView. In the WebView I need to set the user-agent to a custom value.
I have tried the following:
var requestMessage = new HttpRequestMessage(HttpMethod.Get, baseUri);
requestMessage.Headers.Add("User-Agent", "MyCustomValue");
webview.NavigateWithHttpRequestMessage(requestMessage);
However the WebView doesn't use my custom user-agent but instead use the original default value of the user-agent. This is confirmed by this thread at MSDN.
Any good input to alternative solutions or workarounds is appreciated.