Mobile and Desktop Versions of Websites

For very good reasons, many times users want to force a website to specifically send them the mobile or desktop version. It would be really nice if there were a simple HTML header to switch between them, but there isn’t.

The first thing to recognize is that not all websites have different mobile and desktop versions. Those that do typically send different HTML, CSS, JavaScript, and other resources based on a criteria of their choosing. Hopefully, most of this mess will be replaced by responsive web design, where the same code is sent to every browser, but it is designed in such a way that the browser can intelligently decide how to lay it out.

The most common way that web servers decide if they are going to send the mobile or the desktop version is by analyzing the user agent. Typically, if they recognize the user agent as a mobile browser they send the mobile version, otherwise they send the desktop version. Hence, the default PrivacyBrowser/1.0 typically receives the desktop version, while WebView’s default, which contains all types of identifying information, as well as a brief history of the internet, along the lines of Mozilla/5.0 (Linux; Android 8.1.0; Pixel 2 XL Build/OPM4.171019.016.B1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36, typically receives the mobile version.

Of course, web servers are not always very good at parsing user agents. And, they can use anything they want to decide which version of a website to send you. For example, if JavaScript is enabled they can use your screen size, or other attributes about the device.

Changing the user agent can also affect other layout problems, and is typically the first thing I try if enabling JavaScript, cookies, and DOM storage isn’t giving me the expected results. The downside to this is that the standard mobile user agents disclose a lot of information and make it easier to fingerprint the browser.