To fix this the only solution that I found was to override the HTTP query done every time the WebView started navigating to another page. In this I was lucky as we have a NavigationStarting event that is fired when this happens, thus I have NavigationStarting += Wb_NavigationStarting; when I am creating my WebView.
Now that ce have caught this event we need to edit it in Wb_NavigationStarting method, I will unbind the event (so that it dosent fire multiple times), tell the WebView that I am handling the event with args.Cancel = true; and now edit the HTTP query with a method that I will call NavigateWithHeader .
In the method NavigateWithHeader I will just add again my header and my authorization token so that the HTTP query has all of the values it is supposed to have, you will have something like this:
var requestMsg = new Windows.Web.Http.HttpRequestMessage(HttpMethod.Get, uri); requestMsg.Headers.Add("User-Agent", "some user agent");requestMsg.Headers.Add("Authorization", "token abc");
MyWebView.NavigateWithHttpRequestMessage(requestMsg); MyWebView.NavigationStarting += Wb_NavigationStarting;
Here is the full code: