Browscap provides an improved version of PHP's get_browser() function.

The get_browser() function can be used to tell what a visitor's browser is capable of. Unfortunately, the version provided by PHP has a number of limitations, namely:

  • It can be difficult or impossible to configure for shared hosting environments.
  • The data used to identify browsers and determine their capabilities requires consistent maintenance to keep up-to-date.

Browscap automates maintenance by storing browser data in a database and automatically retrieving the latest data on a configurable schedule.

Browscap also provides statistics on visiting browsers.

Requirements

Browscap requires that your server be able to "phone out" (make a http request) to retrieve and update its user agent database.

Note: Some hosting companies have this capability blocked.

Installation

Browscap can be installed via the standard Drupal installation process.

API

Modules can make use of browscap data by calling browscap_get_browser() anywhere they would otherwise call the PHP get_browser() function.

Note: browser_name_regex is not returned.

Related modules

The Mobile Tools module leverages this module to get data about whether a visitor is on a mobile device.

The User Agent Logger works in a similar manner, but with less ability to classify user agents. It does log user agent data for node and comment creators and adds that data into the $node and $comment objects.

Sponsors

Development of Browscap is sponsored by Acquia and the Ontario Ministry of Northern Development and Mines.

A special thanks goes out to Gary Keith who provides regular updates to the browscap user agent database, and specifically for adding a non-zipped CSV version of browscap to support this module.

Downloads

Recommended releases

Version Downloads Date Links
6.x-1.1 tar.gz (13.3 KB) | zip (16.42 KB) 2009-Sep-30 Notes

Development releases

Version Downloads Date Links
7.x-1.x-dev tar.gz (12.57 KB) | zip (14.71 KB) 2012-Feb-02 Notes
6.x-1.x-dev tar.gz (12.69 KB) | zip (14.76 KB) 2012-Feb-02 Notes

Project Information


Maintainers for Browscap

  • Devin Carlson - 28 commits
    last: 1 week ago, first: 2 weeks ago
  • greggles - 19 commits
    last: 49 weeks ago, first: 2 years ago
  • Rob Loach - 11 commits
    last: 2 years ago, first: 3 years ago
  • mikeryan - 6 commits
    last: 3 years ago, first: 6 years ago
  • jjeff - 2 commits
    last: 4 years ago, first: 4 years ago

Issues for Browscap

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Oldest open issue: 7 Jun 09
nobody click here