# Does Any Browser Support Per-Website User Agent Switching?



## chrisyetter (Oct 10, 2011)

Does anyone know if there is an android browser that supports per-website user agent switching?

I know several browsers let your forge the user agent for all sites, but I would like to run everything in one browser and have the user agent switch on the fly.

What I would like is for a browser to forge a user agent based on a whitelist.

For example, identify as an iPad for *.google.com, an iPhone for *.facebook.com but identify as a Mac running OSX Lion for all other sites.

Inversely I could identify as a Windows 7 machine for *.hulu.com, *.rdio.com, *.last.fm, *.amazon.com and as an iPad for everything else.

The reasoning behind this should be obvious, but it's because some sites serve different versions of their website based on the user agent. I'd love to see the desktop version of rdio.com, the iPad version of Gmail, and the iPhone version of Facebook all within the same browser.


----------



## anothernewbie (Oct 22, 2011)

X-Scope does but there are only 3 user agent choices. I also haven't found a way to set the user agent for a domain without being on a page in the domain. That's an issue on a few web sites that immediately switch you to another domain when they see the default mobile browser agent.


----------



## yarly (Jun 22, 2011)

anothernewbie said:


> X-Scope does but there are only 3 user agent choices. I also haven't found a way to set the user agent for a domain without being on a page in the domain. That's an issue on a few web sites that immediately switch you to another domain when they see the default mobile browser agent.


Opera mobile will let you set it per website....but it's not done with a click of a button. You pretty much have to set up and edit a file made for site preferences like you have on Opera's pc browser and then add the site/useragent there. There's nothing really documented about it (though there is documentation I think for editing site preferences on the PC version), but I know it can be done from doing it myself.


----------



## chrisyetter (Oct 10, 2011)

Thanks yarly.

Here's a basic walkthrough I put together. It's not complete, but hopefully I can point someone in the right direction.

Install FileExpert. Go into Settings (Menu, More, Settings, File Explorer Settings) and enable Root Explorer
Navigate to /data/data/com.opera.browser/opera

On your PC, build your custom override.ini, using this template.

```
<br />
Opera Preferences version 2.1<br />
; Do not edit this file while Opera is running<br />
; This file is stored in UTF-8 encoding<br />
[www.google.com]<br />
User Prefs|Ignore Target=0<br />
User Prefs|Target Destination=0<br />
User Prefs|Ignore Unrequested Popups=1<br />
User Prefs|Force Encoding<br />
User Prefs|Local CSS File={Resources}styles/user.css<br />
User Prefs|Allow script to raise window=1<br />
User Prefs|Allow script to lower window=1<br />
User Prefs|User JavaScript=0<br />
User Prefs|Always Load User JavaScript=0<br />
User Agent|Spoof UserAgent ID=2<br />
User Prefs|Geolocation site state=-1<br />
User Prefs|Strategy On Application Cache=1<br />
[Overrides]<br />
www.google.com<br />
```
Use these values in Spoof UserAgent


```
<br />
Browser to identify as<br />
Global values:<br />
1 = Opera<br />
2 = Mozilla<br />
3 = Internet Explorer<br />
Site-specific values:<br />
4 = Mozilla, Opera not mentioned<br />
5 = Internet Explorer, Opera not mentioned<br />
```
Copy override.ini to /data/data/com.opera.browser/opera


----------



## yarly (Jun 22, 2011)

chrisyetter said:


> Thanks yarly.
> 
> Here's a basic walkthrough I put together. It's not complete, but hopefully I can point someone in the right direction.
> 
> ...


4 and 5 I believe are "Mask as Mozilla and Mask as Internet Explorer" meaning they totally remove ways a site can tell you are using a browser different than those (while the other two are Identify as those browsers, but they still have some elements of detection).

I was hoping something like this would work:


```
<br />
[Overrides]<br />
whatsmyuseragent.com<br />
[whatsmyuseragent.com]<br />
User Prefs|Custom User-Agent="Mozilla/5.0 (Windows NT 6.1; WOW64; [URL=rv:7.0.1)]rv:7.0.1)[/URL] Gecko/20100101 Firefox/7.0.1"<br />
```
but the way you mentioned is the only way it seems to work out (despite that being a setting in opera:config)


----------



## thehappyjoe (Oct 23, 2011)

chrisyetter said:


> Here's a basic walkthrough I put together. It's not complete, but hopefully I can point someone in the right direction.


Thanks so much for the info. Is there a page with documentation on this feature? I'd love to dig deeper. I'd probably need to be able to write custom user agents to be completely satisfied, but at least one browser is getting us somewhere. As is, I have some websites that need Internet Explorer, some that need Android, one that needs iPad, and who knows what else we'll find.


----------

