Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

User Agent Class

Security covered Under active development 61 sites

This module adds CSS classes to the `<body>` tag based on the visitor's user agent information, such as their browser and device type. These classes can be applied either via JavaScript on the frontend or PHP on the backend.

This module helps you to set css class in body depends on header user agent, device.

Configuration module:

- User agent (Browser) admin/config/system/user-agent

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Trident
  • etc. ability to add any browsers by trigger from Header User-Agent:

- Device (Phone, Table, etc) admin/config/system/device

  • Android
  • iPhone
  • iPad
  • Blackberry
  • Windows Phone
  • etc. ability to add any devices by trigger from Header User-Agent:

- Responsibility (Frontend/Backend) admin/config/system/provide

It is possible to select a method for adding a class in body by Frontend-js (by default) and Backend-php (Advanced need to disable "internal page cache" module and only keep "dynamic page cache" enabled.)

An example Header -> User Agent:

- Chrome

Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/60.0.3112.90 Safari/537.36

Drupal 9–11

Ask your assistant about User Agent Class

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
May 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
8.x-6.21 Stable 9–11 Feb 17, 2024
8.x-6.2 Stable 9–10 Feb 17, 2024
8.x-6.1 Stable 9–10 May 13, 2023