How to target non admin pages (front end) from a module? From my custom module I'd like to target essentially all front end pages on my site whether it be a node, front page, a views page or taxonomy page. I started out thinking it would be better to use logic that said if not admin or node edit / add but did not seem to have much luck. I came up with this and it seems to work fine but I don't know if accounts for every possible front end type of page that I have mentioned.

function mymodule_page_build(&amp;$vars) {

  // Global node.
  $node = menu_get_object ();

  // Target front end pages
      if ((!empty($node) &amp;&amp; arg(2) === null) || (drupal_is_front_page())) {

// do stuff

  }
}


I have a feeling the code does not account for all possible conditions I have mentioned so I am looking for some suggestions. I was thinking to exclude by path would be good except that node edit and node add don't have /admin in the url.

Note: By Target, I simply mean to focus or act upon. Example: If you want to add javascript or css to a specific page or pages from a module, you are "targeting" those pages.
You can use the path_is_admin() function to determine whether or not a path is an admin page, so you can just use the reverse to determine if it's a non-admin page:

if (!path_is_admin(current_path())) {

}