On Fri, Jul 13, 2012 at 4:50 AM, Matt Atterbury <
matte...@google.com> wrote:
> Can you control anything in the generated JS? If you can set the type or
> lang attributes of the script element we might be able to trick
> defer_javascript into skipping it.
Well ... maybe. Sort of.
Drupal's css/js load can be controlled on a per-file basis:
http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_js/7
http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_css/7
An individual *js can be config'd to load, e.g., as
drupal_add_js(
$my_theme_dir . '/js/my.js',
array(
'type' => 'file',
'scope' => 'header',
'group' => JS_LIBRARY,
'every_page' => FALSE,
'weight' => -198,
'defer' => TRUE,
'cache' => TRUE,
'preprocess' => TRUE,
)
);
Iiuc, those flags are exposed only to the internal prepreocessing
system -- and not to any external functionality, ala MPS.
But ...
those parameters might be 'hook-able' -- code written to export as a
ENV, _SESSION or global var, or somesuch. I've never tried it myself,
and still think crude, app-specific workarounds are not the best idea.