Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Asset Injector

Security covered Maintenance fixes only 46,441 sites

This module allows site administrators to easily inject custom CSS and JavaScript into a Drupal site without modifying theme files. It's useful for making quick tweaks or site-specific adjustments, and can be configured for export and use across multiple sites. An optional submodule also provides GDPR compliance by allowing JavaScript to be blocked until user consent is given.

This combines the two modules, JS Injector and CSS Injector, into a single module for simplicity.

As described from those modules, this functions the same. This module is definitely not a replacement for full-fledged theming, but it provides site administrators with a quick and easy way of tweaking things without diving into full-fledged theme hacking.

CSS Injector

Allows administrators to inject CSS into the page output based on configurable rules. It's useful for adding simple CSS tweaks without modifying a site's official theme.

JS Injector

Allows administrators to inject JS into the page output based on configurable rules. It's useful for adding simple JS tweaks without modifying a site's official theme.

These configurations uses Drupal 8 Entity API and therefore all configurations are held in the database. This means they are exportable using features or custom module installs using yml files.

This is great for multi-site installations where each site may have a few minor differences. It is sometimes easiest to allow for single site configurations.

Overrides

This module does currently not work well with asset overrides, be it in settings.php, from the language system or contrib modules. You can help in #2870153: Work well with overrides to fix that.

GDPR-Compliance:
The COOKiES Asset Injector submodule provides the additional option to block Asset Injector JavaScript, until consent is given.

Drupal 10–11

Ask your assistant about Asset Injector

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
5
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-2.21 Stable 10–11 Aug 7, 2024
8.x-2.20 Stable 9–10 May 3, 2024
8.x-2.19 Stable 9–10 Sep 14, 2023
8.x-2.18 Stable 9–10 Sep 11, 2023
8.x-2.17 Stable 9–10 May 5, 2023