>>607
それで基本OKだけど進む・戻るボタンの状態が更新されないのと
現在のページから次のページに進んだ時に元のページに戻れなくなるのを対策したのが以下

(function(){
  var history = gBrowser.webNavigation.sessionHistory;
  if(history.count > 0){
    var currentEntry = history.getEntryAtIndex(history.index, false);
    history.PurgeHistory(history.count);
    history.QueryInterface(Ci.nsISHistoryInternal);
    history.addEntry(currentEntry, true);
    ["Back", "BackOrBackDuplicate", "Forward", "ForwardOrForwardDuplicate"].forEach(function(id){
      document.getElementById("Browser:" + id).setAttribute("disabled", "true");
    });
  }
})();