You are here

function js_injector_file_download in JS injector 6.2

Implementation of hook_file_download().

File

./js_injector.module, line 50
Allows administrators to inject js into the page output based on configurable rules. Useful for adding simple js tweaks without modifying a site's official theme.

Code

function js_injector_file_download($filepath) {

  // Check if the file is controlled by the current module.
  if (preg_match('/^js_injector_\\d+.js$/', $filepath)) {
    return array(
      'Content-Type: Content-Type: application/x-javascript',
    );
  }
  return NULL;
}