Sunday, December 21, 2008

Changing your user agent

For those of you who do not know, every time you visit a website you are giving out some information. In most cases, a website can record your IP address, the time of viewing, the amount of bandwidth you used, and the browser you are using. Giving out this information is fine, but some websites will display different content or restrict access to content based on the browser you are using. You could always just switch browsers. But then again, why should you switch browsers when you can just modify your user agent?

A basic user agent is a string of text allows the web server to know what browser, operating system and rendering engine you are using. Since this information is just a simple string of text, you can easily change it and fool websites into thinking you are using the browser they want you to. (Please note that some websites may have a good reason to change content based on browser, such as changing a stylesheet to make the website appear best as possible on each browser, etc.) Click HERE to find your user agent. (You must have JavaScript enabled) On some browsers, changing the user agent is extremely simple. However, some browsers have made it difficult or nearly impossible to do it without some clever trickery.
  • Firefox - Firefox is one of the easiest browsers to change the user agent on. There are two main ways to change your user agent on Firefox. You can download an addon to manage and easily switch between multiple user agents, or you can switch by hand each time you feel you need to. For the latter, type in "about:config" (without the quotes) into your URL bar. Into the filter, type in "useragent" (without the quotes). You should have a list of 5-7 options which you can now edit to your liking. You may have to restart Firefox for changes to take effect using this method. If you do not like manually editing, you could also try using User Agent Switcher. After installing the User Agent Switcher addon for Firefox, simply click on Tools and locate the User Agent Switcher. It should give you a list of default user agents to use. You can also import lists of other user agents from an XML file on your computer.
  • Internet Explorer - Changing the Internet Explorer user agent can be somewhat risky if you do not know what you are doing. To change it, you need to open up Registry Editor (Start -> Run, then type in "regedit" without the quotes.) Navigate to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent" (without the quotes) and you can change the values. Not everything can be changed in here depending on your browser version. As an alternative, IE8 users can download Bayden UAPick. Please note that this addon can only fool some methods of changing your user agent and others are able to detect your real browser.
  • Chrome - Editing the user agent in this browser is impossible without modification to the Chrome.dll file. (C:\Documents and Settings\(your windows username)\Local Settings\Application Data\Google\Chrome\Application\(your chrome version) Close Chrome. Make a backup copy of Chrome.dll. Open up Chrome.dll in a hex editor. (I recommend XVI32, its free!) Search for a string that starts with "Mozilla" and overwrite it with your new user agent. Search for a second string starting with "Mozilla" and overwrite it with the same user agent. (Don't ask me why, but it shows up twice in Chrome.dll) Save the file, and open up Chrome. If Chrome refuses to open, replace it with the backup and try again.
  • Opera - For users with earlier versions of Opera (before version 9), your user agent can be modified by simply going to Properties, Advanced, Network, Browser Identification. From there you will be able to edit your user agent for your browser for all pages that you view. However, in version 9 and above, you can only edit preferences on a site by site basis. Press F12 (or Tools->Quick Preferences), then click on Edit Site Preferences and finally Network. At the bottom of that screen, there is a drop down box which lets you pick from a list of user agents.
Hopefully, in the near future, sites that restrict access to content based on your web browser will disappear and you should not have to change your user agent. But for now, at least you know how!

0 comments:

Post a Comment