Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can we create a thorough question/answers post with the core methods that allow browser detection in Joomla 2.5 and 3 ? After a quick research in the web, I feel that there is not sufficient information on a single page the fulfills the topic.

share|improve this question
up vote 10 down vote accepted

A more thorough walk through should really be added to the docs wiki IMO, but sharing what I can via mobile now.

For 2.5 and 3.x compatibility, you can use JBrowser to do some browser detection. However, this class may not work well with newer browsers or versions. To use it to get the browser:

$browser = JBrowser::getInstance()->getBrowser();

For 3.2 and newer, you can use JApplicationWebClient, which is a newer class designed to be more flexible with today's browser options. To use it to get the browser:

$client = JFactory::getApplication()->client->browser;

Both classes are documented on the API site, will link you to the base page for 3.3 docs.

share|improve this answer
I would not use JBrowser, especially if you want to check if the device is mobile or not or what kind. It's really buggy. – Valentin Despa May 7 '14 at 7:25

In addition to Michael's answer, the JApplicationWebClient Class has a few other useful properties:

$client = JFactory::getApplication()->client;

// The detected browser used by the web client (returns an integer)

// The detected browser version used by the web client. (string)

// True if the web client is a mobile device (Boolean)

// The detected platform on which the web client runs (integer)

//The web client's user agent string. (string)

// True if the web client is a robot (Boolean)

JApplicationWebClient Class API Documentation

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.