Monday, May 3, 2010

How to make Google Chrome spoof as the Android Browser

Did you know you can make Google Chrome lie to websites that it is a completely different browser? You can even make the websites think it is the Android browser?

Most people may never want to do this, but my mom just bought herself a new laptop. Since she lives out in the sticks where broadband is only available at 5GB per month from Verizon over the cellular network, I needed to come up with a way to stretch her browsing a little further.

Many websites support mobile versions that will display their content in a more bandwidth friendly way if they detect you are on a mobile browser. This is great, but doesn't help my mom who is using a regular browser on a regular laptop, just a mobile network.

Thankfully, Google Chrome is awesome. You can use a command line switch to have Chrome report any user-agent string you like.

C:\[Google Chrome Install Path]\chrome.exe --user-agent="[your user agent string of choice]"

To spoof the Android browser, I just used:

>chrome.exe --user-agent="Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3"

Browse to to confirm... and I get the mobile version of the website. This won't help everything, but in many popular websites this should help with the bandwidth at least a bit. Just create a shortcut where the call to chrome includes your mobile user agent string and you've now essentially got Chrome and ChromeMobile.