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

afoster’s picture

Just 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...

valgibson’s picture

Ah, thanks for the tip! That saved me a headache. I almost gave up on using livereload.

iamcarrico’s picture

Status: Active » Fixed

Committed this patch, I am also making a similar issue to the magic module to fix.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.