Adding js and css from a module but only to node view, not node edit I'm adding js and css from a custom module and it works except for the fact that it also adds to the node edit page which I don't want. 

I have this in my custom module:

function MYMODULE_preprocess_page(&amp;$vars) {

// Global node.
$node = menu_get_object();
 if (!empty($node) &amp;&amp; $node-&gt;type == 'my_node_type') {

// do stuff here like add_js, add_css

  }
}


... this works except that it also adds js and css files to the node edit page which I do not want. I've been playing around with this now for a while and any searches I've done have come up blank so I'm out of ideas for now. I suspect I need an extra argument to only add this to a node view and not node edit.
A quick, dirty way would be to check the current path for 'edit':

$node = menu_get_object();
if (!empty($node) &amp;&amp; $node-&gt;type == 'my_node_type' &amp;&amp; arg(2) != 'edit') {
  // ...
}