This extension adds gBrowser.undoRemoveTab(); which can be invoked through the tabbar context menu, browser context menu, middle click on the close button, or by pressing Ctrl+Shift+F12 (Cmd+Shift+F12 on MacOS) which can be changed with the keyconfig extension.
Note:
Firefox has since version 2 a built-in 'Undo Close Tab' (part of nsSessionStore which can be disabled in Firefox 3 and lower by adding browser.sessionstore.enabled to about:config).
If SessionStore is enabled (and browser.sessionstore.max_tabs_undo is not 0) this extension will only add additional UI hooks and a gBrowser.undoRemoveTab > undoCloseTab wrapper.
Configurations:
Code: Select all
prefs.js: (use about:config to edit these)
// How many tabs to cache
user_pref("undoclosetab.cache", 10);
// Where to add the tab menu. 0 is first, 13 is after Close Tab in Firefox 3.6
user_pref("undoclosetab.tabmenu_position", 6);
// Handle middle click on TabsToolbar even if an element has set the .onclick property
user_pref("undoclosetab.TabsToolbar.checkOnclick", false);
userChrome.css:
/* Hide Undo Close Tab in tab bar context menu */
#tab-undoclosetab {display:none}
/* Hide Undo Close Tab in browser context menu */
#undoclosetab, #sep-undoclosetab {display:none}
Changes:
20151105:
- Changed the imported .dtd so it works in Firefox 42 (also restores menuitem translation)
- Changed code to not try legacy code if gMultiProcessBrowser is true
- Added undoclosetab.TabsToolbar.checkOnclick pref to determine if the target element should be checked for an .onclick property
- Added multiprocessCompatible
Full Changelog.