How to Change User Agent String in Chrome
Very often old websites does not work in Chrome and asks you specifically to use IE or Firefox. Many a times you would like to change the user agent string in Google Chrome either to check the mobile version of the site on your desktop or to try out it with different browser platforms. Until now, there was no easy way to change the site behaviour, but now with the new Chrome versions, we can alter it either with command line or by chrome extension or from developer tools.
For those of you unfamiliar, User Agent String is an identity text sent by internet browser to the site server to tell about the platform on which the site will be displayed. For example, if my user agent is of mobile then I will see the mobile version of the site even if I am using desktop browser. This is an incredibly useful method to properly run some of the websites that only work in few browsers.
Here are the two convenient ways to switch user agent:
Works only with Dev Chrome 17 or higher versions, this extension is offers extremely easy way to switch user agents. You can choose from Chrome, Firefox, Safari, IE, iPhone, iPad and Android.
For those who do not have latest Chrome version, they can download the same extension from Author’s site. But to install it you will have to first enable “Experimental Extension APIs” from the about:flags page and then restart the browser.
Though Chrome extension is the easiest way to change the string, unfortunately it works with the latest versions only. On the other hand, there is great news that in the upcoming versions, you can change the user agent right from the developer tools. Just hit Ctrl+Shift+i on Windows/Linux, Command+Option+i on Mac OS X and click settings on the bottom right of the window. Now check the box “override user agent” and select one of the given options or enter your self-made custom agent.
If you add a user agent command line parameter, then you can have permanent iPhone browser behaviour in all the tabs. Follow these steps to stimulate this change:
1) Right click on the Chrome icon. Select Properties.
2) Add the following text after the pre-existing text written in the Target box –
–user-agent=”Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3″
3) Click OK and restart the browser.
Now, for all the sites that you open will have iPhone optimized behaviour meaning mobile version with different features, layout and style.
Tell us in your comments about how changing user agent benefitted you or if you have a better way of doing switching them.