Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Chromium (so probably Chrome too) crashes when livereload tries to refresh the CSS while the element inspector (aka. Developer Tools) is opened. This is also reported at http://feedback.livereload.com/forums/157942-general/suggestions/4447750.
Proposed resolution
The [livereload module](https://drupal.org/project/livereload) includes a fix for this using hook_css_alter which can easily be ported to Aurora like this:
function MYTHEME_css_alter(&$css) {
// Force CSS to be added with link tags, rather than @import. This prevents
// crashing Chrome when using the inspector while livereload is enabled.
if (theme_get_setting('aurora_livereload')) {
foreach ($css as $key => $value) {
$css[$key]['preprocess'] = FALSE;
}
}
}
Can this fix be added to Aurora, either in the base theme template.php or in the subtheme templates?
Comments
Comment #1
afoster CreditAttribution: afoster commentedJust a quick note - Contrib module Link CSS does this too. https://drupal.org/project/link_css which I run on all projects now.
I agree that adding it to the theme makes sense, but that will kill IE6 through IE9 if you're not aggregating your CSS sheets and there's more the 31 separate css files. This would need some warning in the admin site and perhaps a config setting where you enable it.
http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer...
Comment #2
valgibson CreditAttribution: valgibson commentedAh, thanks for the tip! That saved me a headache. I almost gave up on using livereload.
Comment #4
iamcarrico CreditAttribution: iamcarrico commentedCommitted this patch, I am also making a similar issue to the magic module to fix.