Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Disable libraries

No security coverage No further development 2 sites

This module allows you to control which CSS and JavaScript libraries are loaded on your site, with different settings for anonymous and logged-in users. You can create allow or deny lists to enable or disable specific libraries or entire modules.

Use allow and block lists for libraries, differentiated by anonymous and authenticated users.

Features

  • disable CSS and JS libraries differentiated by anonymous and authenticated users
  • allow/deny complete modules or only some libraries of modules
  • disable external libraries of all modules (experimental)
  • disable CDN usage of webform module

Post-Installation

By default a allow list is used for anonymous visitors and a deny list for authenticated users. The active theme and it's parent themes are also allowed by default.

To get the old behavior, set the list mode for anonymous visitors from "allow" to "deny".

Allow and deny lists aren't active at the same time. Depending on the list mode, one or the other is used. But both lists are stored independently so you can switch between modes with preconfigured lists.

Allow lists example

system
views/views.module
views/views.ajax/js

Deny lists example

webform
contact
system/base
views/views.ajax/js

Side effects

This module adds a cache context to library_info:theme_name:<anonymous|authenticated> in the cache_discovery table. Without this module, two cached keys are expected:

  • library_info:claro (admin theme)
  • library_info:theme_name (theme)

In theory, the admin theme can’t be loaded as anonymous user, so three cached keys are expected:

  • library_info:claro:authenticated (admin theme)
  • library_info:theme_name:anonymous (theme)
  • library_info:theme_name:authenticated (theme)

Similar projects

  • Library manager (not tested, yet) - can be used to overwrite libraries, but it doesn't differentiate between authenticated and anonymous users. From skimming the source code it also doesn't look like disabling libraries is possible.

Supporting this Module

TODO

Community Documentation

See README.md and CHANGELOG.md in the source code for more details and the technical background.

Drupal 10–11

Ask your assistant about Disable libraries

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
6
Tracked since
Apr 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
0.1.4 Stable 10–11 Jun 30, 2024
0.1.3 Stable 10 Jun 26, 2024
0.1.2 Stable 10 May 4, 2024
0.1.1 Stable 10 Apr 26, 2024
0.1.0 Stable 10 Apr 24, 2024
0.x-dev Dev 10–11 Apr 24, 2024