undoclosetab 20151105

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

undoclosetab 20151105

Post by dorando »

undoclosetab allows recently closed tabs to be reopened. [Firefox]

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.
Last edited by dorando on November 26th, 2015, 4:53 am, edited 23 times in total.
Support mozilla.dorando.at through donations/contributions.
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post by AnonEmoose »

i can confirm..... works with Mozilla Suite/Netscape
alcatraz52
Posts: 372
Joined: August 17th, 2003, 11:27 pm

Post by alcatraz52 »

Is there a userChrome.css hack to remove the "undo close tab" from the context menu? I just like to middleclick the close button.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

alcatraz52 wrote:Is there a userChrome.css hack to remove the "undo close tab" from the context menu? I just like to middleclick the close button.

#undoclosetab, #sep-undoclosetab { display:none; }

AnonEmoose wrote:i can confirm..... works with Mozilla Suite/Netscape

Might break any other version though...
alcatraz52
Posts: 372
Joined: August 17th, 2003, 11:27 pm

Post by alcatraz52 »

dorando wrote:
alcatraz52 wrote:Is there a userChrome.css hack to remove the "undo close tab" from the context menu? I just like to middleclick the close button.

#undoclosetab, #sep-undoclosetab { display:none; }


Thank you :evil:
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post by AnonEmoose »

dorando wrote:
AnonEmoose wrote:i can confirm..... works with Mozilla Suite/Netscape

Might break any other version though...
probably not is my guess... i poked through the jar besides testing it on FF/Moz/Netscape and nothing there (to me) to be strange unless elements are renamed....

Only trouble i had was with a FF bug concerning eventListeners not starting/finishing ... which was solved by switching the order of some extensions in the overlay.rdf....

Just for completeness...the extensions which interacted strangely with Undo Close Tab were:
SessionSaver (rue's rewrite)
showfailedURL
Toolbar Enhancements 0.13 (the combined stop/reload button didn't work)

As i said solved by playing around with the overlay.rdf in my profile folder....
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

AnonEmoose wrote:
dorando wrote:
AnonEmoose wrote:i can confirm..... works with Mozilla Suite/Netscape

Might break any other version though...
probably not is my guess... i poked through the jar besides testing it on FF/Moz/Netscape and nothing there (to me) to be strange unless elements are renamed....
Nah, I meant that it might break because I won't test it in SeaMonkey before releasing an update.

AnonEmoose wrote:Only trouble i had was with a FF bug concerning eventListeners not starting/finishing ... which was solved by switching the order of some extensions in the overlay.rdf....
Sounds a bit like Bug 174320 actually.
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post by AnonEmoose »

yep that's the bug...
User avatar
Moonwolf
Posts: 531
Joined: December 7th, 2003, 2:50 pm
Location: Hertfordshire, England
Contact:

Post by Moonwolf »

...and it only has 4 votes. Everybody get voting now and we can get rid of it! This bug is probably responsible for the majority of extension "incompatibilities", and is very annoying.
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
Thunderbird 1.0 (20041206)
EMbuttons: Buttons & options for the Extension Manager. Easy Get Mail Button is here too.
User avatar
y3k
Posts: 2279
Joined: March 7th, 2003, 2:33 pm
Location: London

Post by y3k »

coolest extension ever :D
[ ♦ Win7 Firefox 19 ♦ PowerUser ♦ ]
User avatar
soccer_dude182
Posts: 720
Joined: July 11th, 2003, 10:50 pm
Location: Waco, TX

Post by soccer_dude182 »

Works great here. Thanks for an even better extension.
bdwelle
Posts: 30
Joined: September 21st, 2003, 8:40 am

Post by bdwelle »

Another cool extension I've been looking for... though it doesn't seem to be working. I can see key_undoclosetab in my keyconfig list, I set it to accel+shift+Z, no dice. I also can't seem to find Undo Close Tab any menus anywhere... (I do have SessionSaver 0.2d installed, btw. )

undoclosetab 20040430
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

any clues?
bdwelle
Posts: 30
Joined: September 21st, 2003, 8:40 am

Post by bdwelle »

actually, sometimes Undo Close Tab is there in the context menu, but it's always greyed out. hmm...?
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post by AnonEmoose »

it only activates when at least one tab has *already* been closed
Last edited by AnonEmoose on May 18th, 2004, 12:24 pm, edited 1 time in total.
bdwelle
Posts: 30
Joined: September 21st, 2003, 8:40 am

Post by bdwelle »

er. well, yes, I did imagine I'd have to close a tab first. That's what I mean -- it remains greyed out, even after closing a tab.
Post Reply