diff --git a/content/treestyletab/windowHelperHacks.js b/content/treestyletab/windowHelperHacks.js index b0e4ed5a..ca6510fe 100644 --- a/content/treestyletab/windowHelperHacks.js +++ b/content/treestyletab/windowHelperHacks.js @@ -1353,6 +1353,32 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte } } + // Tab Control + // https://addons.mozilla.org/firefox/addon/tab-control/ + if ( + TreeStyleTabUtils.getTreePref('compatibility.TabControl') && + 'gTabControl' in window + ) { + let listener = { + handleEvent : function(aEvent) + { + switch (aEvent.type) + { + case sv.kEVENT_TYPE_FOCUS_NEXT_TAB: + if (TreeStyleTabUtils.prefs.getPref('tabcontrol.focusLeftOnClose')) + aEvent.preventDefault(); + break; + + case 'unload': + document.removeEventListener(sv.kEVENT_TYPE_FOCUS_NEXT_TAB, this, false); + break; + } + } + }; + document.addEventListener(sv.kEVENT_TYPE_FOCUS_NEXT_TAB, listener, false); + document.addEventListener('unload', listener, false); + } + // Firefox Sync (Weave) // http://www.mozilla.com/en-US/firefox/sync/ if ( diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js index 3ba3dad0..73880a88 100644 --- a/defaults/preferences/treestyletab.js +++ b/defaults/preferences/treestyletab.js @@ -677,6 +677,7 @@ pref("extensions.treestyletab.compatibility.STM.warnForNewTabPosition", true); pref("extensions.treestyletab.compatibility.STM", true); // Super Tab Mode pref("extensions.treestyletab.compatibility.SuperDragAndGo", true); pref("extensions.treestyletab.compatibility.Tabberwocky", true); +pref("extensions.treestyletab.compatibility.TabControl", true); pref("extensions.treestyletab.compatibility.TabUtilities", true); pref("extensions.treestyletab.compatibility.TMP", true); // Tab Mix Plus pref("extensions.treestyletab.compatibility.TooManyTabs", true); diff --git a/modules/browser.js b/modules/browser.js index 06fcf401..a91bc29b 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -14,7 +14,7 @@ * The Original Code is the Tree Style Tab. * * The Initial Developer of the Original Code is YUKI "Piro" Hiroshi. - * Portions created by the Initial Developer are Copyright (C) 2011-2013 + * Portions created by the Initial Developer are Copyright (C) 2011-2014 * the Initial Developer. All Rights Reserved. * * Contributor(s): YUKI "Piro" Hiroshi