In running live reload I've ran into multiple issues with Chrome crashing should I have the inspector open and after a while of just dealing with it I found that there's a relatively simple solution for it all. I found this solution at #2148717: Chrome (Chromium) crashes when using livereload and the element inspector which changes the css from being imported to being linked. This helps Chrome deal with them better. Offering up a patch that when the live-reload is turned on it changes this over to allow for compatibility.

Hope this helps others!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Cellar Door’s picture

Assigned: Unassigned » fubhy
Issue summary: View changes
FileSize
644 bytes

Attaching the patch

Cellar Door’s picture

Issue summary: View changes

late in the day and after re-reading I realized I had import and link swapped in my description. It changes everything to being imported rather than linked so it handles better.

Cellar Door’s picture

Issue summary: View changes

Sheesh - I've got 3 comments on my own issue! Long day brain tired and I realized I was right the first time. Imports become links which allow Chrome to work with them instead of crashing. This is what the live reload module does just no need for the module with what we're doing. K - I'm done before I have to post another comment on my own issue :)

C13L0’s picture

Thanks for this patch!

fubhy’s picture

Status: Active » Needs work
  1. +++ b/omega/template.php
    @@ -280,6 +280,16 @@ function omega_css_alter(&$css) {
    +  ¶
    

    Empty whitespace on line 284.

  2. +++ b/omega/template.php
    @@ -280,6 +280,16 @@ function omega_css_alter(&$css) {
    +  //than @import. This prevents crashing Chrome when using the inspector while
    +  //livereload is enabled.
    

    Please add a whitespace after the //.

  3. +++ b/omega/template.php
    @@ -280,6 +280,16 @@ function omega_css_alter(&$css) {
    +  // When using omega_livereload orce CSS to be added with link tags, rather
    

    "force" not "orce" :)

  4. +++ b/omega/template.php
    @@ -280,6 +280,16 @@ function omega_css_alter(&$css) {
    +  if(omega_extension_enabled('development') && (omega_theme_get_setting('omega_livereload', TRUE)) {
    

    In Drupal we have a whitespace between 'if' and the brackets.

  5. +++ b/omega/template.php
    @@ -280,6 +280,16 @@ function omega_css_alter(&$css) {
    +  }
    ...
    +    }
    ...
    +      }
    ...
    +        $css[$key]['preprocess'] = FALSE;
    ...
    +      foreach ($css as $key => $value) {
    

    The indentation looks weird there. Might be missing a closing curly bracket before this code block?

fubhy’s picture

Yep, definitely wrong indentation / incorrect number of curly brackets there. Can you provide a fixed patch? Thanks!

Cellar Door’s picture

Status: Needs work » Needs review
FileSize
638 bytes
basvredeling’s picture

You can also use https://drupal.org/project/link_css module to work around the crashes.

fubhy’s picture

Status: Needs review » Fixed

You can also use https://drupal.org/project/link_css module to work around the crashes.

Yeah but I hate having to temporarly enable module for development purposes (other than "devel").

Thanks for the re-roll Chris. Committed.

basvredeling’s picture

Glad, this has been committed. I wholly agree it's undesirable to use link_css as a workaround. Just wanted to document this for other developers.

Status: Fixed » Closed (fixed)

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