Mimic a mobile device browser by spoofing user agent

Mimic a mobile device browser by spoofing user agent

Introduction

Ever wanted to see how a website renders for mobile devices such as the IPhone or IPad? Well using Firefox or another web kit browser along with the user agent switcher extension, you can do just that.

I use the world "Mimic" because this method does not provide a true way of testing websites, merely a way of examining them. If you wish to truly test the response a device has, you are better off purchasing a device running that agent or using an emulator.

For Android devices, the android emulator can be freely obtained from Google and is multi-platform. For I-OS, you will need XCode and Mac OSX.

Get The Extension

To install the extension for Firefox, visit mozilla website, https://addons.mozilla.org/en-US/firefox/addon/59/> and hit 'Add to Firefox' or go to Chris Pederick's website and hit 'Download for Firefox/Flock/Seamonkey/Songbird'.

Once installed and browser reset, the extension should be active. In Firefox, there should be a new tab under the Tools menu, titled 'Default User Agent'. This menu can be used to swap and modify user agents on the fly.

Try switching your user agent to the IPhone agent, then visiting a big site like Gizmodo, you should be forwarded to their mobile view: Gizmodo.

How It Works

When your browser requests a page from a server, header information is sent from your browser to that server. This information contains a field for user agent, which can be used to identify your client. By determining a client's browser and version web pages can be tailored to display differently for each given agent.

For example, the layout of a website on a smart phone should be different to that on a desktop computer, as the given devices have much different screen sizes, bandwidth and line up/down speeds, etc.

User agents may also be spoofed for security purposes as they reveal both browser name and browser version, an easy target for version-specific exploits. Using this extension, you can spoof your true user agent to something more generic.

Additional User Agents

Here are a few user agents I find handy:

Android: Mozilla/5.0 (Linux; U; Android 1.0; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2

IPad: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10

IPod: Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A101a Safari/419.3

Share