Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
6913662
add String() for all setTabValue param 3, workaround for Firefox 33+.
yfdyh000 Sep 3, 2014
d9f8e29
Fix urlbar enter hook for Fx33+.
yfdyh000 Sep 3, 2014
cb70a86
Fix the 'scrollbutton' in Tabbar is always not visible in Firefox 32+.
yfdyh000 Sep 7, 2014
cbc6465
Merge branch 'fix-33' into Fixed
yfdyh000 Sep 7, 2014
d92e335
Merge branch 'fix-878020' into Fixed
yfdyh000 Sep 7, 2014
9721253
Fix 'let' changes in Fx35
yfdyh000 Dec 5, 2014
7b42031
Merge branch 'fix-let-fx35' into Fixed
yfdyh000 Dec 5, 2014
0112dee
Fix undoSubmenu be null on Fx35+
yfdyh000 Jan 19, 2015
5e6f516
Merge branch 'fix-undosubmenu-fx35' into Fixed
yfdyh000 Jan 19, 2015
0c76404
Fix lastTab error in gBrowser.onTabSelect
yfdyh000 Jan 24, 2015
355bb1e
Try replace arguments.callee.name using tabmixplus/modules
yfdyh000 Jan 25, 2015
04998c8
Merge branch 'Fx35-callee' into Fixed
yfdyh000 Jan 25, 2015
9bc2434
Fix onTabOpen not works with "Distill Web Monitor (formerly AlertBox)…
yfdyh000 Jan 26, 2015
b872721
Revert "Fix onTabOpen not works with "Distill Web Monitor (formerly A…
yfdyh000 Jan 27, 2015
fe7c916
refine undoclosetab-button icon
yfdyh000 Jan 27, 2015
09a3006
Merge branch 'refine_undo_icon' into Fixed
yfdyh000 Jan 27, 2015
8d22eac
Fix the PhantomTabs break on Fx31+
yfdyh000 Feb 12, 2015
889f841
mark some 'Fail on Fx31+' code
yfdyh000 Feb 14, 2015
d3be5df
Fix the Tab Counter may stop on Fx31+
yfdyh000 Feb 14, 2015
4782531
Fix the urlbar stop works with NoScript enabled
yfdyh000 Feb 15, 2015
546c18e
Fix the extensions.tabutils.closeLastWindowWithLastTab on Fx31+
yfdyh000 Feb 17, 2015
87a3b94
Preparations for release to the AMO
yfdyh000 Feb 19, 2015
2366232
Fixes for release
yfdyh000 Feb 19, 2015
4cefda9
Fix the description l10n
yfdyh000 Feb 19, 2015
3ce96c9
Fix the browser window does not appear in Fx37+
yfdyh000 Feb 19, 2015
4da116f
Remove the extra space when tabs overflow
yfdyh000 Feb 20, 2015
22a64f8
Fix toolbars popup break during FullScreen in Fx35+
yfdyh000 Feb 23, 2015
97cad9b
Fix the vertical tabbar may get stuck on Fx29+
yfdyh000 Feb 26, 2015
54a9825
Written README.md
yfdyh000 Feb 26, 2015
060697d
Fix a typo for vertical tabbar fixing
yfdyh000 Feb 28, 2015
9d6da47
Mark the closeButtons fail on Fx29+
yfdyh000 Mar 7, 2015
2046d1b
Replace a `getPreventDefault()` to `defaultPrevented`
yfdyh000 Mar 8, 2015
4b9f54f
Eliminate the 'let expressions', including rewrite the 'extensions.ta…
yfdyh000 Mar 8, 2015
5d24578
Fix a broken on Fx38+
yfdyh000 Mar 9, 2015
b2550e2
Fix a typo in shouldStack
yfdyh000 Mar 12, 2015
81a93fa
Invalidate a replacement, its purpose is unknown and has broken since…
yfdyh000 Mar 13, 2015
1504830
Update preferences.dtd
Kamui-Solo Mar 29, 2015
7253f2a
Update prefs.js
Kamui-Solo Mar 29, 2015
1484f70
Update preferences.dtd
Kamui-Solo Mar 29, 2015
48f22df
Update preferences.xul
Kamui-Solo Mar 29, 2015
c5c5775
Update tabutils.css
Kamui-Solo Mar 29, 2015
52f7314
Update tabutils.js
Kamui-Solo Mar 29, 2015
ad4a2f0
Update tabutils_mac.css
Kamui-Solo Mar 29, 2015
f10f41d
Options: Disable "Close Tab button"
Kamui-Solo Mar 29, 2015
473bfdc
Merge pull request #17 from Kamui-Solo/Fixed
yfdyh000 Mar 29, 2015
9c7b5b9
Refine the closebutton pref
yfdyh000 Mar 29, 2015
a5c2d31
Bump 2015.03.30
yfdyh000 Mar 29, 2015
d999da7
Merge pull request #18 from Kamui-Solo/Fixed
Kamui-Solo Mar 31, 2015
c66c400
Fix opening external links always in a new window and reuseBlank pref…
yfdyh000 Apr 5, 2015
a8d815c
Fix export settings not works in Fx37+ due to String.quote(), fix #28
yfdyh000 May 25, 2015
dc5d166
Fix many listener failure in Fx40+
yfdyh000 Jul 2, 2015
6de104e
Bump 2015.07.03
yfdyh000 Jul 3, 2015
718ba90
Disable bookmarkWithHistory feature in Fx40+ to save Bookmarks feature
yfdyh000 Jul 3, 2015
01c0d40
refine variable name
yfdyh000 Jul 3, 2015
3d86a3b
Bump 2015.07.03.1
yfdyh000 Jul 3, 2015
2ab6d2c
Fix empty pinned tabs styling
fix-fix Jul 5, 2015
4834011
Merge pull request #33 from fix-fix/Fixed
yfdyh000 Jul 5, 2015
8dcdc9e
Bump to 2015.07.06
yfdyh000 Jul 5, 2015
b3c777c
Fix the Statusbar buttons icon wrong in Fx29+ (Australis)
yfdyh000 Jul 17, 2015
db510a7
convert status_buttons to toolbar_buttons
yfdyh000 Jul 18, 2015
fe1d31f
Fix the status_buttons and some icons shows as blank in some themes
yfdyh000 Jul 18, 2015
9dff027
Fix the 'All but New Tab' not recognize "about:newtab"
yfdyh000 Jul 18, 2015
af34c53
Bump to 2015.07.18
yfdyh000 Jul 18, 2015
e37b50d
Check if toolbar buttons are present in UI
fix-fix Jul 19, 2015
124faea
Merge pull request #39 from fix-fix/Fixed
yfdyh000 Jul 19, 2015
69a4e02
Fix the ALL broken in recent Firefox 42.0a2 & 43.0a1
yfdyh000 Aug 17, 2015
eb4d24d
Skip invisible links in 'open selected links in tab' function, close #45
yfdyh000 Aug 27, 2015
f4f11e1
Fix some icons may missing or incorrect, #48
yfdyh000 Sep 10, 2015
bf926da
Bump to 2015.09.10 and refine README.md
yfdyh000 Sep 10, 2015
8e5fc8c
Fix some icon may still incorrect, #48
yfdyh000 Sep 10, 2015
684571c
Fix bookmarks items cannot be opened in recent Nightly, #50
yfdyh000 Sep 11, 2015
d2421f4
Merge from "Mozilla Add-ons: Tab Utilities Fixed has been automatical…
yfdyh000 Dec 4, 2015
0654531
Fix SyntaxError: missing ] after element list tabutils.js:2396:28, #67
yfdyh000 Jan 11, 2016
bf66b26
Reduce burrs for Undo button in dark theme, #4
yfdyh000 Jan 11, 2016
8153e2d
[Fix] Use "new RegExp" instead of deprecated flags for string.replace()
yfdyh000 Mar 19, 2016
d886800
[workaround] Avoid Bookmark Properties dialog appears as blank
yfdyh000 Mar 19, 2016
45fa49a
[Adjust] extensions.tabutils.disableTabMoveAnimation to false by default
yfdyh000 Mar 19, 2016
da2b5de
[Fix] Avoid TU Preferences dialog is partially broken in Fx46+
yfdyh000 Mar 20, 2016
2aa55a4
[Fix] prevent tooltip of tabs become null string after changes to "ne…
yfdyh000 Mar 20, 2016
446e2e0
[Fix] Adapt to new _tabListeners and _tabFilters Map objects in Fx46+
yfdyh000 Mar 20, 2016
114d23c
[Fix] _setEffectAllowedForDataTransfer changed in Fx44+
yfdyh000 Mar 20, 2016
2ae1648
[Fix-follow] Fix tab counter become invisible after "new RegExp"
yfdyh000 Mar 20, 2016
9d157ab
[Fix-follow] replace "new RegExp" to /text/g form
yfdyh000 Mar 20, 2016
11cb150
Bump 2016.03.20
yfdyh000 Mar 20, 2016
e34ab33
Use a high-DPI resource for Undo closed tab button. #4
yfdyh000 Mar 21, 2016
63c7493
[Fix-follow] fix some broken after "new RegExp"
yfdyh000 Mar 21, 2016
31e077a
[Fix-follow] Fix compatibility broken for Fx28 and earlier, including…
yfdyh000 Mar 22, 2016
a1a7bf5
[Fix] Fix the "tab-twisty" (tab stacking) isn't shown in Fx45+. fix #79
yfdyh000 Mar 22, 2016
3d7cdce
Revert "Use a high-DPI resource for Undo closed tab button. #4"
yfdyh000 Mar 23, 2016
994c573
Bump 2016.03.23
yfdyh000 Mar 23, 2016
5468cb5
[Fix] Back/forward menu and Session History Menu be broken since Fx43
yfdyh000 Jun 5, 2016
99186a5
Bump 2016.06.05
yfdyh000 Jun 5, 2016
abc5920
[Fix] gBrowser.mFaviconService has been removed since Fx47, it causes…
yfdyh000 Jun 7, 2016
f124880
[Add] "extensions.tabutils.autoCleanupStack". fix #94
yfdyh000 Jul 31, 2016
3821e20
Bump 2016.07.31
yfdyh000 Jul 31, 2016
cd8c8c5
[Fix] mouse scroll to focus tab broken since Fx48, fix #97
yfdyh000 Aug 23, 2016
557228e
[Fix] Enter key on Address bar to open in new tab, since Fx50, fix #115
yfdyh000 Dec 24, 2016
18b2b09
[Fix] Avoid Bookmark Properties dialog appears as blank since Fx49
yfdyh000 Dec 25, 2016
c0f7dea
[Fix] Datetime as title for "Bookmark All Tabs…" now works for Fx44+
yfdyh000 Dec 25, 2016
e0cdf39
[workaround] Fix middle click on link get it open in the foreground i…
yfdyh000 Dec 26, 2016
b35d6f5
[Fix] extensions.tabutils.openTabNext=1[All] not work since Fx51
yfdyh000 Dec 26, 2016
af74ac3
[Fix] Allow open new privacy-browsing or non-e10s window when single-…
yfdyh000 Dec 26, 2016
5da6c46
[Fix] Sound indicator should be located on right side of tab
yfdyh000 Dec 27, 2016
6a73b08
Bump 2016.12.27
yfdyh000 Dec 27, 2016
a07c0a0
[Fix] Mouse scroll to focus a tab advances two tabs at a time, #122
Jan 5, 2017
ec5c0d6
Update README.md
yfdyh000 Jan 12, 2017
488a1e1
Merge pull request #123 from erdemuncuoglu/Fixed
yfdyh000 Jan 27, 2017
60db9c5
[Fix] handleDroppedLink fail since Fx52b1
yfdyh000 Jan 29, 2017
6989801
Improve responsiveness of context menu under e10s
yfdyh000 Jan 29, 2017
d49103d
Improve openSelectedLinksInTab's performance
yfdyh000 Jan 29, 2017
d1fc233
[Fix] autoStack for loadTabs is broken since Fx52b1
yfdyh000 Jan 30, 2017
65b844f
[Fix] Fix two "Failed to hook" since Fx52
yfdyh000 Jan 30, 2017
001cf0e
[Fix-follow] Code cleanup
yfdyh000 Feb 1, 2017
b06031b
[Fix-follow] Code cleanup
yfdyh000 Feb 1, 2017
ec1d389
Reduce blinking for page's context menu showing, #121
yfdyh000 Feb 2, 2017
1631871
[workaround] Avoid breaking with Add Bookmark Here ², #110
yfdyh000 Feb 3, 2017
a88bcd6
Modify the error message for "Failed to hook "
yfdyh000 Feb 3, 2017
dde7178
[Fix] behavior of reuseBlank in gBrowser.addTab, resolve broken
yfdyh000 Feb 4, 2017
e9be107
Bump 2017.02.04
yfdyh000 Feb 4, 2017
e611527
update locale/de, close #130
yfdyh000 Feb 6, 2017
5a0334a
[Fix-follow] Fix Bookmark All Tabs broken in the previous version, #110
yfdyh000 Feb 7, 2017
342bc3e
[Fix] textStyle of Tabs has broken since Fx53 [Bug 658467]
yfdyh000 Mar 8, 2017
87b5665
Update README.md
yfdyh000 Aug 4, 2017
079d4a1
[Fix] Tabs tooltip always shown as "Collapse Stack" in Fx55+
yfdyh000 Aug 17, 2017
236fee1
Set multiprocessCompatible to true, although this support is incomple…
yfdyh000 Aug 17, 2017
c1a9f05
Add badges to README.md
yfdyh000 Aug 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[![Mozilla Add-on](https://img.shields.io/amo/v/tab-utilities-fixed.svg)](https://addons.mozilla.org/firefox/addon/tab-utilities-fixed/)
[![Mozilla Add-on](https://img.shields.io/amo/d/tab-utilities-fixed.svg)]()
[![Mozilla Add-on](https://img.shields.io/amo/users/tab-utilities-fixed.svg)]()
[![GitHub release](https://img.shields.io/github/release/yfdyh000/tabutils/all.svg)]()

# Tab Utilities Fixed (Deprecated)

[Tab Utilities](https://addons.mozilla.org/firefox/addon/tab-utilities/)'s compatibility fixes release.

The project's focused goal: Compatibility fixes for Firefox 28 (with orange 'Firefox' button or Pale Moon) to the latest Firefox Beta (tested for Windows).

Issue reports and patches are welcome.

## Deprecated
This project has been deprecated due to the new browser extension standard ([WebExtensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions); [W3C](https://browserext.github.io/browserext/); [Terminology](https://wiki.mozilla.org/Add-ons/Terminology)) to Firefox 57 and difficult to maintain, it still has some bugs in the final version, such as full screen support, as well as other quirks.

If you would, you can continue to report problems (but no guaranteed for repair) or recommend alternatives on the issues.

### My collections on AMO site
* [WebExtensions for tabs](https://addons.mozilla.org/firefox/collections/yfdyh000/webextensions-for-tabs/)
* [WebExtensions](https://addons.mozilla.org/firefox/collections/yfdyh000/webextensions/)

## Resources
[newer TODO board](https://github.com/yfdyh000/tabutils/projects);
[older TODO and notes](https://github.com/yfdyh000/tabutils/wiki/TODO).

[Release versions and notes](https://github.com/yfdyh000/tabutils/releases) < may include the latest unsigned version.
1 change: 1 addition & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
content tabutils chrome/content/
skin tabutils classic/1.0 chrome/skin/
resource tabmixplus modules/

overlay chrome://browser/content/browser.xul chrome://tabutils/content/tabutils.xul
overlay chrome://browser/content/places/placesOverlay.xul chrome://tabutils/content/placesOverlay.xul
Expand Down
5 changes: 4 additions & 1 deletion chrome/content/bookmarkProperties.xul
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
<script type="application/javascript" src="tulib.js"/>
<script type="application/javascript">
<![CDATA[
if (!("abHere2" in window)) { // Compatibility with Add Bookmark Here ²
TU_hookCode("BookmarkPropertiesPanel._determineItemInfo",
["{", "var BOOKMARK_ITEM = 0;var BOOKMARK_FOLDER = 1;var LIVEMARK_CONTAINER = 2;var ACTION_EDIT = 0;var ACTION_ADD = 1;"],
['this._strings.getString("bookmarkAllTabsDefault")', "dialogInfo.URIList[0] instanceof Ci.nsIURI ? $& : new Date().toLocaleString()"]
);
TU_hookCode("BookmarkPropertiesPanel._getTransactionsForURIList",
[/(?=.*_getURITitleFromHistory.*)/, "var annos; if (!(uri instanceof Ci.nsIURI)) [uri, annos] = uri;"],
[/(?=.*(uri\s*instanceof\s*Ci\.nsIURI|_getURITitleFromHistory).*)/, "var annos; if (!(uri instanceof Ci.nsIURI)) [uri, annos] = uri;"],
[/title(?=\))/, "$&, null, annos"]
);
}
]]>
</script>
</overlay>
20 changes: 20 additions & 0 deletions chrome/content/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// This frame script is used to assist Tab Utilities Fixed, to avoid performance degradation in e10s.

var getLinksSelected = function() {
let links = content.document.links;
let selection = content.getSelection();
if (!links || !selection) return [];

let linkURLs = [];
//console.time('checkLinkSelected');
for (let link of links) {
if (selection.containsNode(link, true) && (link.offsetHeight > 0) && linkURLs.indexOf(link.href) == -1)
linkURLs.push(link.href);
}
//console.timeEnd('checkLinkSelected');
return linkURLs;
};

sendAsyncMessage("tabutils-fixed:LinksSelected", {
links : getLinksSelected()
});
30 changes: 15 additions & 15 deletions chrome/content/preferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<!DOCTYPE prefwindow [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
%tabBrowserDTD;
<!ENTITY % tabsDTD SYSTEM "chrome://browser/locale/preferences/tabs.dtd">
%tabsDTD;
<!ENTITY % contentDTD SYSTEM "chrome://browser/locale/preferences/content.dtd">
Expand All @@ -21,8 +19,8 @@

<prefwindow id="tabutils-preferences"
title="&prefwindow.title;"
helpURI="http://addons.mozilla.org/addon/59961"
donateURI="https://addons.mozilla.org/addon/59961/developers"
helpURI="https://addons.mozilla.org/firefox/addon/tab-utilities-fixed/"
donateURI="https://addons.mozilla.org/firefox/addon/tab-utilities-fixed/developers"
buttons="accept,cancel,extra1,extra2"
buttonlabelcancel="&prefwindow.close;"
buttonlabelextra1="&prefwindow.donate;"
Expand Down Expand Up @@ -480,7 +478,7 @@
<prefpane id="pane4" label="&pane4.title;" helpTopic2="pane4" persist="lastSelected" onpaneload="onPaneLoad(this);" onselect="onPaneSelect(this);">
<preferences>
<preference id="tabBarPosition" name="extensions.tabutils.tabBarPosition" type="int" onchange="tabBarPosition();"/>
<preference id="closeButtons" name="extensions.tabutils.closeButtons" type="int" suggest="33" onchange="closeButtons();"/>
<preference id="closeButtons" name="extensions.tabutils.closeButtons" type="int" suggest="10" onchange="closeButtons();"/>
<preference id="showTabCounter" name="extensions.tabutils.showTabCounter" type="bool" suggest="true"/>
<preference id="showLeftSpace" name="extensions.tabutils.showLeftSpace" type="bool"/>
<preference id="showRightSpace" name="extensions.tabutils.showRightSpace" type="bool"/>
Expand Down Expand Up @@ -575,16 +573,14 @@
<checkbox preference="closeButtons" label="&button.label1;&closeTab.label;&button.label2;"
onsyncfrompreference="return $('closeButtons').value != 2;"
onsynctopreference="return this.checked ? this.nextSibling.value : 2;"/>
<menulist preference="closeButtons" value="1"
<menulist id="c.closeButtons" preference="closeButtons" value="10"
onsyncfrompreference="return $('closeButtons').value == 2 ? this.value : $('closeButtons').value;">
<menupopup>
<menuitem value="10" label="&closeButtons.10.label;"/>
<menuitem value="0" label="&closeButtons.0.label;"/>
<menuitem value="1" label="&closeButtons.1.label;"/>
<menuitem value="18" label="&closeButtons.18.label;"/>
<menuitem value="16" label="&closeButtons.16.label;"/>
<menuitem value="1" label="&closeButtons.1.label;"/>
<menuitem value="3" label="&closeButtons.3.label;"/>
<menuitem value="50" label="&closeButtons.50.label;"/>
<menuitem value="33" label="&closeButtons.33.label;"/>
<menuitem value="2" label="&closeButtons.2.label;" hidden="true"/>
</menupopup>
</menulist>
Expand Down Expand Up @@ -1052,9 +1048,9 @@
var preferences = document.getElementsByTagName("preference");
for (let preference of preferences) {
str += 'pref(';
str += preference.name.quote();
str += JSON.stringify(preference.name);
str += ', ';
str += preference.type == typeof preference.value ? preference.value.quote() :
str += preference.type == typeof preference.value ? JSON.stringify(preference.value) :
preference.inverted ? !preference.value : preference.value;
str += ');\n';
}
Expand Down Expand Up @@ -1155,7 +1151,9 @@
}

function closeButtons() {
$("tabClipWidth").disabled = ($("closeButtons").value & 0x0f) != 1;
var value = $("closeButtons").value;
$("tabClipWidth").disabled = (value != 1) && (value != 10);
$("c.closeButtons").disabled = value == 2;
}

function hideLoadInBackground() {
Expand Down Expand Up @@ -1313,8 +1311,10 @@
if(!aPane._inited)
return;

aPane.setAttribute('lastSelected', [tabbox.selectedIndex for (tabbox of aPane.getElementsByTagName('tabbox'))].join());
let tabbox = aPane.getElementsByTagName('tabbox')[0];
if (tabbox)
aPane.setAttribute('lastSelected', tabbox.selectedIndex);
}
]]>
</script>
</prefwindow>
</prefwindow>
8 changes: 4 additions & 4 deletions chrome/content/tabutils-mt.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ tabutils._multirowTabs = function() {
}, false);

TU_hookCode("gBrowser.mTabContainer._getDropIndex",
[/event.screenX.*width \/ 2/g, function(s) s + " && " + s.replace("screenX", "screenY", "g").replace("width / 2", "height")
+ " || " + s.replace("screenX", "screenY", "g").replace("width / 2", "height * 0")]
[/event.screenX.*width \/ 2/g, function(s) s + " && " + s.replace(/screenX/g, "screenY").replace("width / 2", "height")
+ " || " + s.replace(/screenX/g, "screenY").replace("width / 2", "height * 0")]
);

tabutils.addEventListener(gBrowser.mTabContainer, "dragover", function(event) {
Expand Down Expand Up @@ -75,7 +75,7 @@ tabutils._multirowTabs = function() {
if (TU_getPref("extensions.tabutils.disableTabMoveAnimation", true)) {
TU_hookFunc(arguments.callee.caller.toString().match(/^.*{|var (ind|tabStrip|ltr).*|var pixelsToScroll[\s\S]*$/g).join("\n"),
[/.*scrollByPixels.*/, ";"],
[/.*effects == "move"[\s\S]*?(?=var (newIndex|scrollRect|rect))/, ""]
[/.*effects == "move"[\s\S]*?(?=var (newIndex|scrollRect|rect))/, ""] // needs fix
).apply(this, arguments);
return;
}
Expand All @@ -95,7 +95,7 @@ tabutils._multirowTabs = function() {
}, true);

TU_hookCode("gBrowser.moveTabTo", "{", function() {
if (["onxbldrop", "ondrop"].indexOf(arguments.callee.caller.name) > -1) {
if (TMP_console.isCallerInList(["onxbldrop", "ondrop"])) {
if (aTab.pinned) {
if (aIndex >= this._numPinnedTabs)
this.pinTab(aTab, false);
Expand Down
27 changes: 18 additions & 9 deletions chrome/content/tabutils-st.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ tabutils._stackTabs = function() {
if (bTab.getAttribute("group-counter") == 1) {
bTab.setAttribute("group-collapsed", !options.expand && TU_getPref("extensions.tabutils.autoCollapseNewStack", true));
this.mTabContainer.mTabstrip.ensureElementIsVisible(bTab);
if (bTab.image && TU_getPref('extensions.tabutils.colorStackFromFavicon', false))
Services.mozIColorAnalyzer.findRepresentativeColor(makeURI(bTab.image), function(success, color) {
if (success)
this.updateStack(bTab, {color: "#" + ("000000" + color.toString(16)).slice(-6)});
}.bind(this));
}

//must happen after "group" is set to avoid bypassing stack, and
Expand Down Expand Up @@ -221,6 +226,10 @@ tabutils._stackTabs = function() {
let tabs = this.siblingTabsOf(aTab);
if (tabs.length == 0)
return;
if (tabs.length == 1 && TU_getPref("extensions.tabutils.autoCleanupStack", false)) {
gBrowser.detachTab(aTab);
return;
}

if (typeof aTab == "string") {
aTab = tabs[0];
Expand Down Expand Up @@ -471,7 +480,7 @@ tabutils._stackTabs = function() {
}
}

let lastTab = this.getLastSelectedTab();
lastTab = this.getLastSelectedTab();
if (lastTab && lastTab.hasAttribute("group") &&
lastTab.getAttribute("group") != aTab.getAttribute("group") &&
TU_getPref("extensions.tabutils.autoCollapseStackOnBlur", false))
Expand All @@ -495,8 +504,8 @@ tabutils._stackTabs = function() {
});

TU_hookCode("gBrowser.loadTabs",
[/(?=var tabNum)/, "var tabs = [firstTabAdded || this.mCurrentTab];"],
[/(?=.*aReplace.*\n.*moveTabTo.*)/, "tabs.push(tab);"],
[/(?=(?:var|let) tabNum)/, "var tabs = [firstTabAdded || this.mCurrentTab];"],
[/(?=if\s*\(.*\n.*moveTabTo.*tab.*)/, "tabs.push(tab);"],
[/(?=.*!aLoadInBackground.*)/, function() {
if (tabs.length > 1 && TU_getPref("extensions.tabutils.autoStack", false))
this.stackTabs(tabs);
Expand All @@ -505,16 +514,16 @@ tabutils._stackTabs = function() {

TU_hookCode("gBrowser.mTabContainer._selectNewTab", "aNewTab.hidden", "$& || aNewTab.collapsed");

TU_hookCode("gBrowser.createTooltip", /(tab|tn).getAttribute\("label"\)/, function(s, s1) (function() {
$1.mOverTwisty ? $1.hasAttribute("group-collapsed") ?
TU_hookCode("gBrowser.createTooltip", /(?:tab\._.+)(tab|tn).getAttribute\("label"\)/, function(s, s1) (function() {
a1.mOverTwisty ? a1.hasAttribute("group-collapsed") ?
document.getElementById("context_collapseStack").getAttribute("label_expand") :
document.getElementById("context_collapseStack").getAttribute("label_collapse")
: this.isCollapsedStack($1) ?
: this.isCollapsedStack(a1) ?
TU_getPref("extensions.tabutils.mouseHoverPopup", true) ?
event.preventDefault() :
this.siblingTabsOf($1).map(function($1) ($1.hasAttribute("group-selected") ? "> " : "# ") + $0).join("\n") :
$0
}).toString().replace(/^.*{|}$/g, "").replace("$0", s, "g").replace("$1", s1, "g"));
this.siblingTabsOf(a1).map(function(a1) (a1.hasAttribute("group-selected") ? "> " : "# ") + a0).join("\n") :
a0
}).toString().replace(/^.*{|}$/g, "").replace(/a0/g, s).replace(/a1/g, s1));

gBrowser._setMenuitemAttributes = function _setMenuitemAttributes(aItem, aTab) {
["label", "crop", "image"].forEach(function(aProp) {
Expand Down
66 changes: 41 additions & 25 deletions chrome/content/tabutils-vt.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ tabutils._verticalTabs = function() {
var [start, end, size] = vertical ? ["top", "bottom", "height"]
: ["left", "right", "width"];
}],
["left:", "[start]:", "g"], // Bug 971630 [Fx29]
["right:", "[end]:", "g"],
[".left", "[start]", "g"],
[".right", "[end]", "g"],
[".width", "[size]", "g"]
Expand All @@ -31,34 +33,48 @@ tabutils._verticalTabs = function() {
gBrowser.mTabContainer.visible = aShow;
});

TU_hookCode("FullScreen.toggle", /.*_expandCallback.*\n.*_expandCallback.*/, function() {
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
}
});

TU_hookCode("FullScreen.enterDomFullscreen", /.*_expandCallback.*\n.*_expandCallback.*/, function() {
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
}
});
if (tabutils.fxVersion >= 35.0) { // Bug 1071821 [Fx35]
// I did not find a compatible approach
TU_hookCode("FullScreen.toggle", /.*if.*\(\!this\._fullScrToggler\).*\n.*\n.*\n.*\n.*\}/, function() {
if (!this._eventLoaded) { // the equivalent to "if (!this._fullScrToggler)"
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
fullScrToggler.collapsed = false;
}
this._eventLoaded = true;
}
});

TU_hookCode("FullScreen.cleanup", /.*_expandCallback.*\n.*_expandCallback.*/, function() {
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
}
});
} else { // Earlier than Fx35
TU_hookCode("FullScreen.toggle", /.*_expandCallback.*\n.*_expandCallback.*/, function() {
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
fullScrToggler.hidden = false;
}
});
TU_hookCode("FullScreen.enterDomFullscreen", /.*_expandCallback.*\n.*_expandCallback.*/, function() {
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
}
});

TU_hookCode("FullScreen.mouseoverToggle", /.*collapsed = aShow.*/, function() {
TU_hookCode("FullScreen.cleanup", /.*_expandCallback.*\n.*_expandCallback.*/, function() {
for (let fullScrToggler of this._fullScrTogglers) {
fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
}
});
}
TU_hookCode("FullScreen.mouseoverToggle", /.*(collapsed|hidden) = aShow.*/, function() {
let tabBarPosition = TU_getPref("extensions.tabutils.tabBarPosition");
this._fullScrTogglers[0].collapsed = aShow;
this._fullScrTogglers[1].collapsed = aShow || tabBarPosition != 1;
this._fullScrTogglers[2].collapsed = aShow || tabBarPosition != 2;
this._fullScrTogglers[3].collapsed = aShow || tabBarPosition != 3;
});
this._fullScrTogglers[0].$1 = aShow;
this._fullScrTogglers[1].$1 = aShow || tabBarPosition != 1;
this._fullScrTogglers[2].$1 = aShow || tabBarPosition != 2;
this._fullScrTogglers[3].$1 = aShow || tabBarPosition != 3;
}); // Note: mozFullScreen is Fx9+. I did not add " || document.mozFullScreen" because it seems always return to false, unknown reason.

TU_hookCode("FullScreen.showXULChrome",
['fullscreenctls.parentNode == navbar', 'document.getElementById("TabsToolbar").parentNode == gNavToolbox'],
Expand Down
Loading