Are absolute paths allowed in info files? I'm writing a .info file for a module, and I want to include a script which has been installed in /sites/all/libraries:

So I have included the line below in my .info file:

scripts[] = /sites/all/libraries/zeroclipboard-2.2.0/dist/ZeroClipboard.js


However, with or without the leading slash on this path, I always get the same result: Drupal treats this as relative to the module directory and tries and fails to load 

/sites/all/modules/custom/clipboard//sites/all/libraries/zeroclipboard-2.2.0/dist/ZeroClipboard.js?nsnrjh


So maybe I've answered my own question, but I can't find any definitive answer to this in the Drupal docs? 

Thanks all,

MB
_system_rebuild_module_data is responsible for that. There is a whole section in code just to make sure:

// Prefix stylesheets and scripts with module path.
$path = dirname($module-&gt;uri);
if (isset($module-&gt;info ['stylesheets'])) {
  $module-&gt;info ['stylesheets'] = _system_info_add_path($module-&gt;info ['stylesheets'], $path);
}
if (isset($module-&gt;info ['scripts'])) {
  $module-&gt;info ['scripts'] = _system_info_add_path($module-&gt;info ['scripts'], $path);
}


My guess is that module should never assume that something exists if module itself does not install it. It's a way to introduce errors. Also, allowing modules to reach outside their directory might be a security breach.

If you need a script you can't include in your module, use Libraries API. Of course there are other ways, but most of them is problematic, and fixing all problems would pretty much result in cloning this ready module anyway.