How to change the User Agent String setting on stock Android Browser


  1. Gambit

    Gambit Active Member

    A while ago I found a tip somewhere on how to get to some additional hidden android browser settings including how to change the user agent string so that the browser would identify itself as a desktop browser or iPhone browser while surfing.
    This setting is reset between sessions, I didn't use it frequently and eventually forgot how to go about making the change.
    Recently I had a need to access these hidden browser settings again and it took quite a long and frustrating search effort to finally locate this information which does not seem to be widely publicized. So, in an effort to save anyone else this trouble, I figured I would post the information on how to do this on a couple Android boards that I frequent and also include a few words that might be picked up as search terms for anyone else trying to find this info. The procedure is very simple. I currently have an HTC Sprint Hero running Android 1.5, so I'm not sure what other devices or builds this will work on...

    Open the Android web browser. In the address bar enter 'about:debug' where you would normally enter a URL and hit enter or Go. Be sure to erase the 'http://www.' that the browser likes to leave in the address bar for you. No page will load and you may or may not get a pop-up message 'Debug mode'. But if you now go to Menu > More > Settings in the browser and scroll to the bottom of the list, you should see a new group of options under the 'Debug' heading. The bottom setting is 'UAString' and if selected will give you the option of enabling your browser to identify itself as Android, Desktop or iPhone. Results after making this switch have been mixed, but go ahead and give it a try if you have a need to. I'm not sure what the other options do, so use at your own risk.

    Feel free to leave a reply if you found this information helpful, or if it does or does not work on your particular device / build.

    EDIT: I Originally posted this in 2009 and have since switch handsets and flashed a custom ROM (CyanogenMod) that has the user agent setting for the stock browser. So I can not verify the tip below but big thanks to jaggu.004 for posting this updated method:
    search terms: Android Browser Hidden Debug Settings Change User Agent String Identify Desktop Firefox iPhone about:debug UAString

    Advertisement
    Pad1, damickens1, tchall and 8 others like this.
  2. pwabbit

    pwabbit Well-Known Member

    I am not sure about the method in the stock browser, but the Dolphin browser has a setting for that.
  3. meangreengdub

    meangreengdub Well-Known Member

    Maybe I missed it or just don't get it, but what are the advantages to this?
  4. pking

    pking Well-Known Member

    The Android WebKit browser is, for all intents and purposes, a fully-fledged web browser (with some minor quirks)

    The advantage of changing your UA string to appear to be a different browser-type or device is that you don't get forced into viewing a 'mobile version' of a particular webpage. Mobile browsing is still very young, and these versions tend to be geared toward browsers that don't know about things like images, JavaScript, flash, etc. That is to say, very ugly and generally not very functional.

    It should only really be necessary if the website you're viewing is overly-agressive about the UA string - I've had a few sites direct me to the 'mobile version' even when the 'Mobile View' option is disabled in the browser settings.
  5. Droidone

    Droidone Well-Known Member

    I used to do this with a patch on my pre and it does help in rendering pages correctly. When I had it set to iphone, I could access special websites that are made to display correctly on that phone. I am gonna give it a shot and see what happens. Worst case if you choose desktop, you can avoid those mobile sites from coming up. Good find
  6. MountainX

    MountainX Well-Known Member

    Is it possible to change the user agent to Palm Pre in any Android browser?

    I'd like to use this:
    Mozilla/5.0 (webOS/1.0; U; en-us) AppleWebKit/525.27.1
    (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0
  7. XanaduL

    XanaduL Member

    Bump, Sticky!!!!!, please
  8. dukezone

    dukezone New Member

    Gambit thank you for the UA tute.. after trying various fixes on my N1 it worked like a treat ~yay~ ! :D

    Can you or anyone please explain any of the other 'Debug' settings [Tracing, rendering, wide viewport, light touch etc]??

    Thank you in advance.
  9. GriZlore

    GriZlore Member

  10. mosey

    mosey New Member

    This reliably causes the browser to crash on my stock, several-days-old Samsung Captivate. Doesn't matter what site(s) are open, as soon as I select desktop and exit the menus, the browser crashes. Who knows why, but if others experience this, to reset the browser settings when the browser itself doesn't work, go to (home screen) Menu->Settings->Applications->Manage Applications->Menu->Filter-select All->Browser->Clear Data.

    I'm surprised this isn't more streamlined...
  11. ashlianne

    ashlianne Member

    yay!!! it worked on my LG Optimus M 2.2
    ** BUT I DID HAVE TO TURN MY POP UP BLOCKER OFF

    my only problem now is it is not letting me view videos on certain sites... like on shufuni.com when I go on my desktop it lets me view it but on my phone it doesn't.


    This did solve my problem that I had before though where it kept going to m.shufuni.com (which it wanted me to pay) since it was set in android view

    **UPDATE** ...ahh well it was using Flash Player so that's why and I lost my Optimus M and had to get a new one :( (and it's 2.2.1 now so meh I guess I'm going to attempt to downgrade and root again)
  12. bestbuds86

    bestbuds86 New Member

  13. bestbuds86

    bestbuds86 New Member

    Thanks, I couldnt figure out how to get it back working. again THANKS. I like the stock android browser better than dolphin skyfire etc
  14. Tnext

    Tnext New Member

    I could view emails but could not send emails or reply to emails in my webmail account from my phone browser. Changing the UAString setting to 'desktop' as described above fixed the problem. Thanks!

    phone: droid2

    Email type: Inotes Lotus notes webmail version
  15. kkeller87

    kkeller87 New Member



    THANK YOU!!!!!!!!!!! Ive been going mad trying to figure out how to do this.

    just got a Droid Charge and it had a user agent in the stock rom, just switched to gummy charge and it was gone. Was almost gonna unroot to get this option back. never liked skyfire much.

    off topic but, does anyone know if firefox will ever support flash?

    Gambit - I would gladly send you a beer for this tip. got a paypal button?



    EDIT - It only worked and rendered the full site once. now nothing. Any thoughts ?
  16. LBPHeretic

    LBPHeretic Well-Known Member

    You could try one of the Dolphin Browser apps from the Android Market. They they have the ability to change the user agent string. :)

    I like Dolphin Browser Mini on the Sprint HTC Hero. I use Dolphin Browser HD on my B&N Nook Color. ;)
  17. jaggu.004

    jaggu.004 New Member

    Just open stock browser and type "about:useragent" and select the one u want!!!:D:cool::cool::eek:
    Gambit and djudji like this.
  18. djudji

    djudji New Member

    That my friends was dead cool simple :).
  19. tchall

    tchall New Member

    Works great on a Droid X...

    Thanks, I was hating the "touch" or "M" site interfaces with a better than VGA screen!
  20. BrokerJB

    BrokerJB New Member

    Seemed like this was the answer for me. I've been trying to figure out how to be able to access a website requiring I.E. on my laptop (tethered to my phone). I've had to do the user-agent switch in I.E. so that MetroPCS would allow the internet to flow into laptop, but then the site won't work... because it thinks my I.E. is an android.

    Didn't realize you could change user agent in droid browsers... but it didn't work anyway :( I used the Custom option in Dolphin (and used the string matching I.E. 9), and now get "MetroPCS does not allow tethering..." message on my phone :p

    Think I'm going to have to suck it up and pay them for making my phone a hot spot so I can do the business I need.

Share This Page