rem:  deleteHistoryItems( aParent ); var count = shistory.count; var index = shistory.index; switch (aMenu) 
add: var webNavigation = docShell.QueryInterface(Components.interfaces.nsIWebNavigation); if (webNavigation) 
context: function FillHistoryMenu( aParent, aMenu )  {    if (webNavigation)      {        var shistory = webNavigation.sessionHistory;        if (shistory)          {            //Remove old entries if any            deleteHistoryItems( aParent );            var count = shistory.count;            var index = shistory.index;            switch (aMenu)              {                case "back":                  var end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0;                  for ( var j = index - 1; j >= end; j--)                     {                      var entry = shistory.getEntryAtIndex(j, false);                      if (entry)                         createMenuItem( aParent, j, entry.title );                    }                  break;                case "forward":                  var end  = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count;                  for ( var j = index + 1; j < end; j++)                    {                      var entry = shistory.getEntryAtIndex(j, false);                      if (entry)                        createMenuItem( aParent, j, entry.title );                    }                  break;                case "go":                  var end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0;                  for( var j = count - 1; j >= end; j-- )                    {                      var entry = shistory.getEntryAtIndex(j, false);                      if (entry)                        createCheckboxMenuItem( aParent, j, entry.title, j==index );                    }                  break;              }          }      }  }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/a4bb6136f492196ee4b882ccbfc6c8d7fd95cd5a/sessionHistoryUI.js/buggy/xpfe/browser/resources/content/sessionHistoryUI.js