Injector

Component ID

2329375

Component name

Injector

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This project merges work from JS Injector and CSS Injector into a single module that can handle both CSS and JS with CTool framework.

Several years ago for a presentation at Drupal 4 Design in Boston I needed to add a few lines of javascript to a D7 install profile. I wanted to do the demo without "hacking" the distribution, so I forked 1.x branch of the D7 version of CSS Injector to #1018156: Port JS injector module to drupal 7.

We recently lost some client CSS due to an issue with the way CSS Injector worked and how Pantheon handles skipping files in backups they believed are dynamically generated from the database. The result was I reforked the much improved JS Injector back to #2329285: Restart CSS Injector 2.x as fork of JS Injector 2.x

After forking this code in both directions, I'm convinced there is no reason these projects should exist independently. The code used to save what was being injected with drupal_add_css and drupal_add_js has always been largely identical. There are only 10-15 lines that are actually different between the modules to handle the CSS or JS specifics.

Similar Modules in D7:

Similar Modules in D8:

Modules that just add syntax aware editors for CSS and/or JS: