It's documented, but the variable does not exists. How about adding it via hook_process_HOOK() until #865536: drupal_add_js() is missing the 'browsers' option has been fixed?

/**
 * Implements hook_process_HOOK().
 */
function html5_tools_process_html(&$variables) {
  // @todo: Append html5shim until #865536: drupal_add_js() is missing the 'browsers' option is fixed.
  $default_query_string = variable_get('css_js_query_string', '0');
  $variables['scripts'] .= '<!--[if lt IE 9]>' . "\n";
  $variables['scripts'] .= '<script src="' . file_create_url(drupal_get_path('module', 'html5_tools') . '/js/html5shiv-printshiv.js') . '?' . $default_query_string . '"></script>' . "\n";
  $variables['scripts'] .= '<![endif]-->' . "\n";
}

I've added this to my themes template.php.

Comments

hass’s picture

Issue summary: View changes

A

bleen’s picture

I have no problem adding this ... my only question really is wether or not there is ever a situation where we would be forcing html5shiv on a site that doesnt want it? I cant think of a case where this would be true, but if so we should have a setting somewhere.

hass’s picture

That's a good point. It's highly theme related, but html5, too. Maybe won't fix here - I'm not sure.

bleen’s picture

We could form_alter the theme settings form and add a checkbox ... not a big deal

bleen’s picture

Issue summary: View changes

A