Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In Drupal 8 the drupal_add_js() function $options parameter now also supports a browsers option just like drupal_add_css(). This allows JavaScript to be wrapped in conditional comments. Example:

drupal_add_js($some_path . '/file.js', array('browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE))); ?>

Outputs:

<!--[if lte IE 8]>
<script type="text/javascript" src="http://example.com/some/path/file.js"></script>
<![endif]-->
Impacts: 
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done

Comments

Sam Moore’s picture

Any chance of a backport for this? Sorry if I'm asking in the wrong place.