user3795349
user3795349

Reputation: 324

Windows 8 phone c# request desktop website not working

How do I request the desktop website instead of the mobile website in the webBrowser component. I have tried adding "=desktop" after the url but this makes not effect.

String url = "http://www.google.com"; // This could be any website url
Browser.Navigate(New Uri(url + "=desktop", UriKind.Absolute));

Thank you in advance :)

If you need any more details please comment and I will be happy to explain in further detail :)

Upvotes: 2

Views: 168

Answers (3)

b1390893
b1390893

Reputation: 21

Try this:

Browser.Navigate(new Uri(MainUri, UriKind.Absolute), null, "User-Agent:Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)");

I just navigate to google with IE10's UA and it responses with desktop version.

Upvotes: 1

b1390893
b1390893

Reputation: 21

Browser.Navigate(new Uri(MainUri, UriKind.Absolute), null, "User-Agent:Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)");

This should work! FOr most websites

Upvotes: 1

Eddie
Eddie

Reputation: 671

For some websites, use the desktop version User-Agent can fix this problem.

Try this:

Browser.Navigate(new Uri(MainUri, UriKind.Absolute), null, "User-Agent:Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)");

I just navigate to google with IE10's UA and it responses with desktop version.

Upvotes: 1

Related Questions