View Full Version : Mobile Browser Detection

06-30-2008, 03:09 AM
I'm working on a mobile website and need some help with my mobile browser detection script. I have it working for iPhone, iPod Touch, and Windows Mobile Devices.

I need help getting it to detect for Blackberry Browser (Blackberry Devices), Blazer Browser (Palm Devices), Opera Mini Browser, Opera Mobile Browser, and other mobile browsers if possible.

Does anyone know how to modify (and test if you have a phone to test with, as I don't have all of these devices) this javascript?:

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
if((navigator.appVersion.indexOf("Windows CE")>0))

Thanks for your help!

06-30-2008, 03:30 AM
I'm not sure if this would work, but it is worth a shot. If it works, it should detect all mobiles:

if (screen.width < 800)

Also, if you have those various devices and/or have a friend with one, you can use this to at least see what they report:


06-30-2008, 04:19 AM
Interesting script, but I'm more interested in pointing visitors at web pages specifically tailored to their mobile device.

The second link is something that hopefully I might be able to use if I can get a hold of those devices.

I'll keep my eyes open for something more specific.

06-30-2008, 10:28 AM
You can probably Google that information, for example:

http://na.blackberry.com/eng/developers/resources/journals/mar_2007/bdjs.jsp#Object: navigator Properties

Where you will find that the:


returns 'BlackBerry'

for the Blackberry Browser.

This page has a wealth of info:


and seems to indicate that:

On PalmOS, the appName is "Blazer"

Anyways, to Google this for any other device and/or browser, just use as search terms:

device name browser name navigator object



07-07-2009, 09:59 AM
I have published the last version of "Apache Mobile Filter", this open source project have, in the first six months, more than 600 downloads from sourceforge and I think the same from CPAN.

The Apache Mobile Filter allows you to access WURFL from any programming language, not just Java and php that is traditionally used for dynamic mobile web sites.

The module detects the mobile device and passes the WURFL capabilities on to the other web application as environment variables. It can also be used to resize images on the fly to adapt to the screen size of the mobile device.

Try it and let me know your opinion.

For more info: http://www.idelfuschini.it/it/apache-mobile-filter-v2x.html
Test Page: http://apachemobilefilter.nogoogle.it/php_test.php

06-26-2011, 02:54 PM
I'm working on a mobile website and need some help with my mobile browser detection script. I have it working for iPhone, iPod Touch, and Windows Mobile Device

06-26-2011, 04:35 PM
Detection is rather easy. As an example, this is how Slimbox 2.04 detects many of them:

/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)

It does them all at once in order to avoid them. Slimbox 2.04 doesn't work on them.

But you can see the keywords and test individually and branch if that's you're intention.

If you have a device/browser that's not represented, use a little script to find out what might be unique about its navigator.userAgent string:


You can also go here:


to find these strings for virtually any browser.