View Full Version : Mobile Browser Detection

06-30-2008, 05:08 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!

07-10-2008, 09:07 AM
for handset detection, mobile screen size and mobile phone capabilities, it might be worth you checking out www.handsetdetection.com

They have a service which you can link into your website. after the mobile browser is detected, you can then display the appropriate view for each device.

07-30-2009, 10:15 AM
I have published the last version(2.04) of "Apache Mobile Filter", this open source project has in the first seven months, more than 900 downloads from sourceforge and I suppose 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

I have made two test pages:

PC Test Page: http://apachemobilefilter.nogoogle.it/php_test.php

Mobile Test Page: http://apachemobilefilter.nogoogle.it

07-09-2010, 10:11 PM
I have created this article on mobile browser detection and redirection using php. There is a download link for the examples that you may feel free to use. My example enables automatic redirection based on device type with the ability to let the user specify a preference for a page other than the default for their device using cookies.


Hope you enjoy!


12-17-2010, 11:05 PM
Where could i find a list of all mobile browsers ? I need to write a condition that will show the proper page depending on the user-agent. The javascript condition is easy but the list of mobile handsets is constantly changing :mad:
Anyway it could be valuable if someone would develop a feed that would maintain this list (of user-agents) up to date.

Assurance auto

03-07-2012, 08:57 PM
I have post 2 years ago about Apache Mobile Filter, now there is several news about AMF.
My project now got a dedicate domain:


a wiki:


and support 3 of common used device repository 51Degrees, DetectRight and WURFL.

03-08-2012, 11:33 AM
One option is to use Media Queries to assign stylesheets according to the device the visitor is using.