Skip to content

Installation

Install the module with Composer and enable it:

composer require drupal/browserclass
drush en browserclass

Or enable it at Administration > Extend (/admin/modules).

See Installing Drupal Modules for other ways to install it.

Configuration

There is nothing to configure. The module has no settings form and no permissions. Once enabled, it attaches its script to every page, in both the front end and the admin theme.

To check that it works, open any page, inspect the <body> element in your browser's developer tools, and look for classes such as chrome chrome140 win desktop.

Uninstalling

Uninstall the module with drush pmu browserclass or at Administration > Extend > Uninstall. The module stores no configuration or data, so nothing is left behind. Remove any CSS in your theme that relies on the classes, and replace any [browserclass:*] tokens you used.