Using a Desktop Browser’s User Agent to Open Mobile Websites
UA stands for User Agent. It refers to browser information including the hardware platform, operating system, application software, and the user's personal preferences. Changing the UA lets a desktop browser identify itself as a mobile browser so we can visit the mobile version of a site. Most browsers in use today are based on WebKit, including the well-known Google Chrome. Chrome lets you switch its UA through Inspect Element. Other fast browsers using newer WebKit versions, such as 360 Extreme Explorer and Cheetah Browser, also support changing the UA through Inspect Element. If you do not want to use Inspect Element, here is a simple way to open websites in a WebKit browser with a custom UA. In Chrome, start by creating a desktop shortcut to the browser executable. Right-click the shortcut and open Properties. At the end of the Target field, add a space followed by –user-agent=”Android”, then click OK. Reopen the browser through the shortcut and enter a URL; it will open the mobile site directly, since the browser's UA now identifies Android. This method works with all WebKit-based browsers, such as Chrome and the fast browsers from 360, Cheetah, Baidu, and UC. Using a custom UA to access mobile websites makes it easy to design and debug them locally. Customizing the UA in Firefox is also simple. Enter about:config in Firefox's address bar and press Enter. In the search field at the top of the configuration screen, look for general.useragent.override. If it does not exist, right-click an empty area and create a new string named general.useragent.override. Set its value to Mozilla/5.0 (Android; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5 and click OK. Firefox's UA will now identify Android, and websites opened in new tabs will automatically use their mobile versions.
Published 01/31/2016 · Krunk Zhou
Join the conversation