How to remove overlay hashtag and trailing menu from the parent overlay Lets say for example we have activated contextual links &amp; overlay modules and when clicking the edit button for the node, which is all the way bottom of the page, it open on overlay. Now when we look at the address bar the link now looks something like this http://localhost:8888/node#overlay=node/25/edit%3Fdestination%3Dnode

The problem with overlay is that it pushes the parent overlay to scroll all the way to the top and when I decide to "cancel" editing I have to scroll all the way to bottom again just to reach the node teaser. So I need to remove the this part from the link above #overlay=node/25/edit%3Fdestination%3Dnode

Now I guess it is being caused by jquery bbq feature. And looking into overlay module and her js files I find it very scary and dont know how to avoid this.

I need some help on where to look into this for starters like me.
If you remove the "#overlay=node/25/edit%3Fdestination%3Dnode" part from the module, you disable the overlay for that page.

if that is what you want to do, then you need to implement hook_admin_paths_alter() in a module, using code similar to the following one (change "mymodule" with the effective short name of the module):

function mymodule_admin_paths_alter(&amp;$paths) {
  $paths['node/*/edit'] = FALSE;
}


The result returned from hook_admin_paths() is used from the Overlay module to decide when a page is rendered in an overlay. The implementation of that hook done by the Node module is the following one:

function node_admin_paths() {
  if (variable_get('node_admin_theme')) {
    $paths = array(
      'node/*/edit' =&gt; TRUE, 
      'node/*/delete' =&gt; TRUE, 
      'node/*/revisions' =&gt; TRUE, 
      'node/*/revisions/*/revert' =&gt; TRUE, 
      'node/*/revisions/*/delete' =&gt; TRUE, 
      'node/add' =&gt; TRUE, 
      'node/add/*' =&gt; TRUE,
    );
    return $paths;
  }
}


The module that implements the hook I reported in the first code snippet should be enabled when the  Overlay module is enabled; alternatively, that hook implementation should check if the Overlay module is enabled.

function mymodule_admin_paths_alter(&amp;$paths) {
  if (module_exists("overlay")) {
    $paths['node/*/edit'] = FALSE;
  }
}


The information returned from hook_admin_paths() could be used from another module to render those pages in a different way, such as using an administrative theme; if the purpose is just to avoid the overlay is used to render that page, then the module should change the information returned by hook_admin_paths() only when the Overlay module is enabled.