B2G/gecko/browser/base/content/browser.js
/**
 * Re-open a closed tab.
 * @param aIndex
 *        The index of the tab (via nsSessionStore.getClosedTabData)
 * @returns a reference to the reopened tab.
 */
Re-open a closed tab.
@param aIndex
The index of the tab (via nsSessionStore.getClosedTabData)
@returns a reference to the reopened tab.
Re - open a closed tab . @param aIndex The index of the tab ( via nsSessionStore . getClosedTabData ) @returns a reference to the reopened tab .
function undoCloseTab(aIndex) {
  var blankTabToRemove = null;
  if (gBrowser.tabs.length == 1 &&
      !gPrefService.getBoolPref("browser.tabs.autoHide") &&
      isTabEmpty(gBrowser.selectedTab))
    blankTabToRemove = gBrowser.selectedTab;
  var tab = null;
  var ss = Cc["@mozilla.org/browser/sessionstore;1"].
           getService(Ci.nsISessionStore);
  if (ss.getClosedTabCount(window) > (aIndex || 0)) {
    TabView.prepareUndoCloseTab(blankTabToRemove);
    tab = ss.undoCloseTab(window, aIndex || 0);
    TabView.afterUndoCloseTab();
    if (blankTabToRemove)
      gBrowser.removeTab(blankTabToRemove);
  }
  return tab;
}
function undoCloseTab ( aIndex ) { var blankTabToRemove = null ; if ( gBrowser . tabs . length == 1 && ! gPrefService . getBoolPref ( "browser.tabs.autoHide" ) && isTabEmpty ( gBrowser . selectedTab ) ) blankTabToRemove = gBrowser . selectedTab ; var tab = null ; var ss = Cc [ "@mozilla.org/browser/sessionstore;1" ] . getService ( Ci . nsISessionStore ) ; if ( ss . getClosedTabCount ( window ) > ( aIndex || 0 ) ) { TabView . prepareUndoCloseTab ( blankTabToRemove ) ; tab = ss . undoCloseTab ( window , aIndex || 0 ) ; TabView . afterUndoCloseTab ( ) ; if ( blankTabToRemove ) gBrowser . removeTab ( blankTabToRemove ) ; } return tab ; }
Re-open a closed tab.
Re - open a closed tab .
// wallpaper patch to prevent an unnecessary blank tab (bug 343895)