[Pkg-mozext-commits] [tree-style-tab] 01/04: New upstream version 0.18.2016111701

Ximin Luo infinity0 at debian.org
Sun Jan 15 12:16:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository tree-style-tab.

commit 22c978a1b2758ed34d881bca334769e5d6b1f541
Author: Ximin Luo <infinity0 at debian.org>
Date:   Sun Jan 15 13:11:27 2017 +0100

    New upstream version 0.18.2016111701
---
 META-INF/manifest.mf                       |  58 +++++------
 META-INF/mozilla.rsa                       | Bin 4189 -> 4188 bytes
 META-INF/mozilla.sf                        |   4 +-
 content/treestyletab/res/tabsDragUtils.js  |  78 +++++++++++++-
 content/treestyletab/windowHelper.js       |  23 ++++-
 content/treestyletab/windowHelperHacks.js  |  72 +++++++------
 defaults/preferences/treestyletab.js       |   5 +
 install.rdf                                |  17 ++-
 modules/base.js                            |  17 +--
 modules/browser.js                         | 125 ++++++++--------------
 modules/lib/extensions.js                  | 161 -----------------------------
 modules/lib/prefs.js                       |  66 +++++++++---
 modules/tabbarDNDObserver.js               |   4 +-
 skin/classic/treestyletab/metal/Darwin.css |  10 +-
 skin/classic/treestyletab/metal/tab.css    |  17 ---
 skin/classic/treestyletab/ui-base.css      |   6 ++
 treestyletab.update.rdf                    |  30 ------
 17 files changed, 299 insertions(+), 394 deletions(-)

diff --git a/META-INF/manifest.mf b/META-INF/manifest.mf
index bd43b41..109187a 100644
--- a/META-INF/manifest.mf
+++ b/META-INF/manifest.mf
@@ -2,8 +2,8 @@ Manifest-Version: 1.0
 
 Name: install.rdf
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: KZw09McTlWF2HD4qJ67wBQ==
-SHA1-Digest: 4N3gi5AU3wbLXyewx0cisZ5+ZdU=
+MD5-Digest: ok8SN3a3+o+SV5m68kg7oQ==
+SHA1-Digest: FKVqeq5SnvwIO/DRm1FtoCeqqmU=
 
 Name: chrome.manifest
 Digest-Algorithms: MD5 SHA1
@@ -15,11 +15,6 @@ Digest-Algorithms: MD5 SHA1
 MD5-Digest: b26p1vuhLB2vYtkJ0EpFZg==
 SHA1-Digest: T9f7i8A7iAz/ElpA361lLRpnbWc=
 
-Name: treestyletab.update.rdf
-Digest-Algorithms: MD5 SHA1
-MD5-Digest: WFG1EQMzOakGX3FfdBa+BQ==
-SHA1-Digest: bLVNCyty0ehyiOGSYvqzwLOZFi4=
-
 Name: components/AboutGroup.js
 Digest-Algorithms: MD5 SHA1
 MD5-Digest: T4LxLbXCV246rvBpN3l4Rg==
@@ -127,13 +122,13 @@ SHA1-Digest: I/ZVyT55v0dNRAoDesMfh/5q9G4=
 
 Name: content/treestyletab/windowHelper.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: xTUmqhX/sRKuLdkd45C9iQ==
-SHA1-Digest: oVXpT/YYiCRPSLoZxqo53OyW750=
+MD5-Digest: 5V69QScN5zOJVSvNBNoPKg==
+SHA1-Digest: C47Z/BWUPKkWuGqEVpfUQjVvilw=
 
 Name: content/treestyletab/windowHelperHacks.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: aKWkLccahu81HVylPwngIA==
-SHA1-Digest: 6P4VHPYkc4xGVHP+HaQd2Ia5m6Q=
+MD5-Digest: it6TPw+aG1fNl6Ppg/58Ig==
+SHA1-Digest: hN8zBmRgPsbjIRku6jLkTdlK8zM=
 
 Name: content/treestyletab/res/bookmarkMultipleTabs.js
 Digest-Algorithms: MD5 SHA1
@@ -182,8 +177,8 @@ SHA1-Digest: WzGw9OlK27u2qgwpylJvL+GMB9k=
 
 Name: content/treestyletab/res/tabsDragUtils.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: QmTz7V73k1BbBb1rmFh9nQ==
-SHA1-Digest: hzgVxNq5SBN7/9nhWeHZo5TbcLM=
+MD5-Digest: W2igRSPnTXnMMvsxDSDjlQ==
+SHA1-Digest: l0GL2VhzNq3RKUypfcY3DQrZDdA=
 
 Name: content/treestyletab/res/twisty-modern-b.png
 Digest-Algorithms: MD5 SHA1
@@ -207,8 +202,8 @@ SHA1-Digest: q0mYa40sk7KoHzdmK6voR/OuGF8=
 
 Name: defaults/preferences/treestyletab.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: ycA6HipAJelmwZLMuR1fyQ==
-SHA1-Digest: /7+U/tqjRxu7bnJ0v3k634iXEp0=
+MD5-Digest: wWpQz22fx2VYycBX2FkjAg==
+SHA1-Digest: edDNUr2rBkF8gZkCIHO/2iTZSyw=
 
 Name: locale/cs/treestyletab/license.txt
 Digest-Algorithms: MD5 SHA1
@@ -412,8 +407,8 @@ SHA1-Digest: +/qy0uitgU5SPYj2Srgo0JhYVS4=
 
 Name: modules/base.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: YSbwZ9b7gXPxtyCxDAFAiQ==
-SHA1-Digest: I3xhcCpq33uGpm5pqRdp/akfdIc=
+MD5-Digest: NY09SYs8FgmLYUMeKNS7Sw==
+SHA1-Digest: JcRExlbc6cV3n5oO997KTDWmDW8=
 
 Name: modules/bookmark.js
 Digest-Algorithms: MD5 SHA1
@@ -422,8 +417,8 @@ SHA1-Digest: TrQsPd9SmcWiBJYkoSYNVTI7ozQ=
 
 Name: modules/browser.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: Y7/B4I60oB4bthrBqTCFmQ==
-SHA1-Digest: z8aNMI0/d6e025QNRRXZswatDxQ=
+MD5-Digest: PE9e1osB7awEdhSNvDD79w==
+SHA1-Digest: NSWCx6j3JpSNJ+QLzwXk5b1dwmA=
 
 Name: modules/browserUIShowHideObserver.js
 Digest-Algorithms: MD5 SHA1
@@ -477,8 +472,8 @@ SHA1-Digest: a4KpeD2z5f3xYaa//UQGtAA5+j0=
 
 Name: modules/tabbarDNDObserver.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: XdHzRMPfcXZqe8JqbZsVBQ==
-SHA1-Digest: 3iPvF3+GMJUqpdqYL1foU20zEFQ=
+MD5-Digest: ePbqeE1Xe4Ajr7pr4WUtLA==
+SHA1-Digest: VQWhk6o3Tigb7hcuUn0Z2gvOxn0=
 
 Name: modules/tabContentsObserver.js
 Digest-Algorithms: MD5 SHA1
@@ -525,11 +520,6 @@ Digest-Algorithms: MD5 SHA1
 MD5-Digest: QUPhhfner7CIElQ2G8x1lA==
 SHA1-Digest: DoTMaUnEwHAwfctYCu7NuQPlQlE=
 
-Name: modules/lib/extensions.js
-Digest-Algorithms: MD5 SHA1
-MD5-Digest: Dmku04rz2AvrkieEyF5Xyg==
-SHA1-Digest: xsbZrDwvySKEi/T+Z/lieqXZeow=
-
 Name: modules/lib/inherit.jsm
 Digest-Algorithms: MD5 SHA1
 MD5-Digest: +ogCTEJunSKJ+hybMmPZzQ==
@@ -542,8 +532,8 @@ SHA1-Digest: fr/zTLjmtBm4oo58uVCZUBv+PPs=
 
 Name: modules/lib/prefs.js
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: kPuMGdq2ki9wgzsdDkHyQw==
-SHA1-Digest: j4nk7SjmRPBtfA9anGuvpEhf4eo=
+MD5-Digest: jpdbanVO+ljM9xF6+KSN8A==
+SHA1-Digest: UEJ+irt3z5tOAcQVlTzeTR2gzhE=
 
 Name: modules/lib/stringBundle.js
 Digest-Algorithms: MD5 SHA1
@@ -642,8 +632,8 @@ SHA1-Digest: /CcGFdIzQT8ebf8twW9s6P1rRRI=
 
 Name: skin/classic/treestyletab/ui-base.css
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: 9e8b6KVQnx6D8wMVqWavMQ==
-SHA1-Digest: RuNYcY4BL6nR5sbq/2JVFYvJU3o=
+MD5-Digest: 1xmdG4x6c5gzfd06X8W05w==
+SHA1-Digest: 37cdHXqzb070RqjKqcqaCu56lio=
 
 Name: skin/classic/treestyletab/WINNT-base.css
 Digest-Algorithms: MD5 SHA1
@@ -667,8 +657,8 @@ SHA1-Digest: zlNvl7EAnEaBsDgcPEp55c0QoZI=
 
 Name: skin/classic/treestyletab/metal/Darwin.css
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: TZb3EA3nszWCtkHD9aWR5g==
-SHA1-Digest: YQCNXwVHDahH9S9SCdLFvm2afGs=
+MD5-Digest: jUJK8ojm/b44Sk/4OTiguQ==
+SHA1-Digest: hf9ZAH9f738kH6kUSxc6eAvZ6+4=
 
 Name: skin/classic/treestyletab/metal/icon-bg.png
 Digest-Algorithms: MD5 SHA1
@@ -737,8 +727,8 @@ SHA1-Digest: u2GHUKdU+s+jbRmxFO5motzr4+0=
 
 Name: skin/classic/treestyletab/metal/tab.css
 Digest-Algorithms: MD5 SHA1
-MD5-Digest: 8VAVFHmNFr8nICwoOQZ1Tg==
-SHA1-Digest: r4okMH4SmqAzJ8dqrEIU8XBrYqY=
+MD5-Digest: 69xmnTZqMZnraOpMHOLg6A==
+SHA1-Digest: vL0wimEoqQ73hnEe532ADXF2WFs=
 
 Name: skin/classic/treestyletab/sidebar/aero.css
 Digest-Algorithms: MD5 SHA1
diff --git a/META-INF/mozilla.rsa b/META-INF/mozilla.rsa
index 8cb47f1..652d76f 100644
Binary files a/META-INF/mozilla.rsa and b/META-INF/mozilla.rsa differ
diff --git a/META-INF/mozilla.sf b/META-INF/mozilla.sf
index 0f254fb..99222e0 100644
--- a/META-INF/mozilla.sf
+++ b/META-INF/mozilla.sf
@@ -1,4 +1,4 @@
 Signature-Version: 1.0
-MD5-Digest-Manifest: M26H3NilpbG4EJLWCNmK1g==
-SHA1-Digest-Manifest: Oic0vCG4Nhw8EKvyBfpR0BUpxxU=
+MD5-Digest-Manifest: Ix40zU3MtJOexcl79CmDWg==
+SHA1-Digest-Manifest: PyiHX5XkupIsPIdAzTfX20IYorU=
 
diff --git a/content/treestyletab/res/tabsDragUtils.js b/content/treestyletab/res/tabsDragUtils.js
index b785bcd..df17e19 100644
--- a/content/treestyletab/res/tabsDragUtils.js
+++ b/content/treestyletab/res/tabsDragUtils.js
@@ -5,7 +5,9 @@
    window['piro.sakura.ne.jp'].tabsDragUtils.initTabBrowser(gBrowser);
 
    // in dragstart event listener
-   window['piro.sakura.ne.jp'].tabsDragUtils.startTabsDrag(aEvent, aArrayOfTabs);
+   window['piro.sakura.ne.jp'].tabsDragUtils.startTabsDrag(aEvent, aArrayOfTabs, {
+     shrinkOthers : true // shrink other dragged tabs while dragging
+   });
 
  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -15,7 +17,7 @@
    http://github.com/piroor/fxaddonlib-tabs-drag-utils
 */
 (function() {
-	const currentRevision = 41;
+	const currentRevision = 42;
 
 	if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
 
@@ -432,7 +434,31 @@ TDUContext.destroy();
 		},
 		updateDraggedTabs : function TDU_updateDraggedTabs(context)
 		{
-			context.draggedTabs.forEach(function(draggedTab) {
+			context.draggedTabs.forEach(function(draggedTab, aIndex) {
+				if (draggedTab._dragData.canShrink && aIndex > 0) {
+					let style = draggedTab.style;
+					if (!draggedTab.__tabsDragUtils__backupStyle) {
+						let backup = {
+							overflow : {
+								value    : style.getPropertyValue('overflow'),
+								priority : style.getPropertyPriority('overflow')
+							}
+						};
+						backup['max-'+context.rowSize] = {
+							value    : style.getPropertyValue('max-'+context.rowSize),
+							priority : style.getPropertyPriority('max-'+context.rowSize)
+						};
+						backup['min-'+context.rowSize] = {
+							value    : style.getPropertyValue('min-'+context.rowSize),
+							priority : style.getPropertyPriority('min-'+context.rowSize)
+						};
+						draggedTab.__tabsDragUtils__backupStyle = backup;
+					}
+					let size = draggedTab.boxObject[context.rowSize] * 0.1;
+					style.setProperty('max-'+context.rowSize, size + 'px', 'important');
+					style.setProperty('min-'+context.rowSize, size + 'px', 'important');
+					style.setProperty('overflow', 'hidden', 'important');
+				}
 				draggedTab._dragData.animLastScreenX = context.currentPositionCoordinate;
 			}, this);
 		},
@@ -558,8 +584,10 @@ TDUContext.destroy();
 				this.updatedTabDNDObservers = this.updatedTabDNDObservers.splice(index, 1);
 		},
 
-		startTabsDrag : function TDU_startTabsDrag(aEvent, aTabs)
+		startTabsDrag : function TDU_startTabsDrag(aEvent, aTabs, aOptions)
 		{
+			aOptions = aOptions || {};
+
 			var draggedTab = this.getTabFromEvent(aEvent);
 			var tabs = aTabs || [];
 			var index = tabs.indexOf(draggedTab);
@@ -598,12 +626,20 @@ TDUContext.destroy();
 						scrollX: isVertical ? 0 : tabbar.mTabstrip.scrollPosition ,
 						scrollY: isVertical ? tabbar.mTabstrip.scrollPosition : 0 ,
 						screenX: aEvent.screenX,
-						screenY: aEvent.screenY
+						screenY: aEvent.screenY,
+						canShrink : aOptions.shrinkOthers || false
 					};
 				}, this);
 			}
 
 			aEvent.stopPropagation();
+
+			if (aOptions.shrinkOthers) {
+				document.addEventListener('dragend', this, true);
+				document.addEventListener('drop', this, true);
+				document.addEventListener('overflow', this, true);
+				document.addEventListener('underflow', this, true);
+			}
 		},
 		isVertical : function TDS_isVertical(aElement)
 		{
@@ -729,6 +765,22 @@ TDUContext.destroy();
 			return false;
 		},
 
+		clearDraggingStyles : function TDU_clearDraggingStyles(aEvent)
+		{
+			var tabbar = this.getTabbarFromEvent(aEvent);
+			Array.forEach(tabbar.childNodes, function(aTab) {
+				let backup = aTab.__tabsDragUtils__backupStyle;
+				if (!backup)
+					return;
+
+				let style = aTab.style;
+				Object.keys(backup).forEach(function(aKey) {
+					style.setProperty(aKey, backup[aKey].value, backup[aKey].priority);
+				});
+				delete aTab.__tabsDragUtils__backupStyle;
+			}, this);
+		},
+
 		isTabsDragging : function TDU_isTabsDragging(aEvent) 
 		{
 			if (!aEvent)
@@ -836,6 +888,22 @@ TDUContext.destroy();
 			{
 				case 'load':
 					return this._delayedInit();
+
+				case 'dragend':
+				case 'drop':
+					document.removeEventListener('dragend', this, true);
+					document.removeEventListener('drop', this, true);
+					document.removeEventListener('overflow', this, true);
+					document.removeEventListener('underflow', this, true);
+					return this.clearDraggingStyles(aEvent);
+
+				case 'overflow':
+				case 'underflow':
+					if (aEvent.target.localName == 'tab') {
+						// this must be canceled to prevent the "+" button in the tab bar turns its mode.
+						aEvent.stopPropagation();
+					}
+					return;
 			}
 		},
 
diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js
index d99a25b..cbfa14c 100644
--- a/content/treestyletab/windowHelper.js
+++ b/content/treestyletab/windowHelper.js
@@ -47,10 +47,25 @@ var TreeStyleTabWindowHelper = {
 			TabsInTitlebar._update = function(...aArgs) {
 				// See: https://dxr.mozilla.org/mozilla-central/rev/dbe4b47941c7b3d6298a0ead5e40dd828096c808/browser/base/content/browser-tabsintitlebar.js#104
 				let result = this.__treestyletab__update(...aArgs);
-				if (gBrowser.treeStyleTab && // possibly not available while the startup process
-					gBrowser.treeStyleTab.position != 'top')
+				if (
+					gBrowser.treeStyleTab && // possibly not available while the startup process
+					(
+						gBrowser.treeStyleTab.position != 'top' ||
+						!gBrowser.treeStyleTab.isFixed
+					)
+					) {
+					let heightOfItemsInTitlebar = 0;
+					if (AppConstants.platform != 'macosx') {
+						let menubar = document.getElementById('toolbar-menubar');
+						let style = window.getComputedStyle(menubar);
+						heightOfItemsInTitlebar = menubar.boxObject.height +
+													parseFloat(style.marginTop) +
+													parseFloat(style.marginBottom);
+					}
+					let marginBottom = heightOfItemsInTitlebar ? '-' + heightOfItemsInTitlebar + 'px' : '' ;
 					document.getElementById('titlebar').style.marginBottom =
-						document.getElementById('titlebar-content').style.marginBottom = '';
+						document.getElementById('titlebar-content').style.marginBottom = marginBottom;
+				}
 				return result;
 			};
 		}
@@ -462,7 +477,7 @@ var TreeStyleTabWindowHelper = {
 				firstTabAdded = tabs[0];
 			}
 			finally {
-				if (!aReplace && firstTabAdded) {
+				if (!aLoadInBackground && !aReplace && firstTabAdded) {
 					this.selectedTab = aURIs[0].indexOf('about:treestyletab-group') == 0 ?
 						TreeStyleTabService.getNextTab(firstTabAdded) :
 						firstTabAdded;
diff --git a/content/treestyletab/windowHelperHacks.js b/content/treestyletab/windowHelperHacks.js
index 2df4000..13b6413 100644
--- a/content/treestyletab/windowHelperHacks.js
+++ b/content/treestyletab/windowHelperHacks.js
@@ -100,6 +100,7 @@ TreeStyleTabWindowHelper.overrideExtensionsBeforeBrowserInit = function TSTWH_ov
 
 TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_overrideExtensionsAfterBrowserInit() {
 	var sv = this.service;
+	var { AddonManager } = Components.utils.import('resource://gre/modules/AddonManager.jsm', {});
 
 	// Selection Links
 	// https://addons.mozilla.org/firefox/addon/selection-links/
@@ -244,11 +245,12 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
 	// Focus Last Selected Tab 0.9.5.x
 	// http://www.gozer.org/mozilla/extensions/
 	if (TreeStyleTabUtils.getTreePref('compatibility.FocusLastSelectedTab')) {
-		sv.extensions.isAvailable('focuslastselectedtab at gozer.org', { ok : function() {
-			TreeStyleTabService.registerTabFocusAllowance(function(aTabBrowser) {
-				return !aTabBrowser.selectedTab.hasAttribute('lastselected');
-			});
-		}});
+		AddonManager.getAddonByID('focuslastselectedtab at gozer.org', function(aAddon) {
+			if (aAddon && aAddon.isAvailable)
+				TreeStyleTabService.registerTabFocusAllowance(function(aTabBrowser) {
+					return !aTabBrowser.selectedTab.hasAttribute('lastselected');
+				});
+		});
 	}
 
 	// LastTab
@@ -443,9 +445,10 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
 	// Remove New Tab Button
 	// https://addons.mozilla.org/firefox/addon/remove-new-tab-button/
 	if (TreeStyleTabUtils.getTreePref('compatibility.RemoveNewTabButton')) {
-		sv.extensions.isAvailable('remove-new-tab-button at forerunnerdesigns.com', { ok : function() {
-			document.documentElement.setAttribute(TreeStyleTabService.kHIDE_NEWTAB, true);
-		}});
+		AddonManager.getAddonByID('remove-new-tab-button at forerunnerdesigns.com', function(aAddon) {
+			if (aAddon && aAddon.isAvailable)
+				document.documentElement.setAttribute(TreeStyleTabService.kHIDE_NEWTAB, true);
+		});
 	}
 
 	// InstaClick
@@ -554,13 +557,6 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
 		var t = gBrowser.treeStyleTab.getFirstTab(gBrowser);
 		gBrowser.treeStyleTab.initTabAttributes(t);
 		gBrowser.treeStyleTab.initTabContentsOrder(t);
-
-		gBrowser.__treestyletab__openInverseLink = gBrowser.openInverseLink;
-		gBrowser.openInverseLink = function(...aArgs) {
-			TreeStyleTabService.readyToOpenChildTabNow(gBrowser);
-			return this.__treestyletab__openInverseLink(...aArgs);
-		};
-
 		gBrowser.treeStyleTab.internallyTabMovingCount--;
 	}
 
@@ -588,46 +584,60 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
 		TreeStyleTabUtils.getTreePref('compatibility.PersonalTitlebar')) {
 		let titlebar = document.getElementById('titlebar');
 		let personalTitlebar = document.getElementById('personal-titlebar');
+		let MutationObserver = window.MutationObserver || window.MozMutationObserver;
 		let listener = {
 				handleEvent : function(aEvent)
 				{
 					switch (aEvent.type)
 					{
 						case 'beforecustomization':
-							titlebar.removeEventListener('DOMAttrModified', this, true);
+							this.handleMutation = false;
 							gBrowser.treeStyleTab.destroyTabStrip(personalTitlebar);
 							break;
 
 						case 'aftercustomization':
-							titlebar.addEventListener('DOMAttrModified', this, true);
-							break;
-
-						case 'DOMAttrModified':
-							if (
-								aEvent.attrName == 'hidden' &&
-								gBrowser.tabContainer.parentNode.id == (aEvent.newValue == 'true' ? 'toolbar-menubar' : 'personal-titlebar' )
-								) {
-								gBrowser.treeStyleTab.destroyTabbar()
-									.then(function() {
-										gBrowser.treeStyleTab.reinitTabbar();
-									});
-							}
+							this.handleMutation = true;
 							break;
 
 						case 'unload':
-							titlebar.removeEventListener('DOMAttrModified', this, true);
+							observer.disconnect();
+							observer = null;
 							document.removeEventListener('beforecustomization', this, false);
 							document.removeEventListener('aftercustomization', this, false);
 							document.removeEventListener('unload', this, false);
 							personalTitlebar = null;
 							break;
 					}
+				},
+				handleMutation : true,
+				onMutation : function(aMutations, aObserver)
+				{
+					if (!this.handleMutation)
+						return;
+
+					aMutations.forEach(function(aMutation) {
+						var newValue = aMutation.target.getAttribute('hidden');
+						var expectedParent = newValue == 'true' ? 'toolbar-menubar' : 'personal-titlebar' ;
+						if (gBrowser.tabContainer.parentNode.id == expectedParent)
+							gBrowser.treeStyleTab.destroyTabbar()
+								.then(function() {
+									gBrowser.treeStyleTab.reinitTabbar();
+								});
+					}, this);
 				}
 			};
+		let observer = new MutationObserver((function(aMutations, aObserver) {
+			listener.onMutation(aMutations, aObserver);
+		}).bind(this));
+		observer.observe(titlebar, {
+			attributes      : true,
+			attributeFilter : [
+				'hidden'
+			]
+		});
 		document.addEventListener('beforecustomization', listener, false);
 		document.addEventListener('aftercustomization', listener, false);
 		document.addEventListener('unload', listener, false);
-		titlebar.addEventListener('DOMAttrModified', listener, true);
 	}
 
 	// Tab Control
diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js
index 3932068..27a0e3e 100644
--- a/defaults/preferences/treestyletab.js
+++ b/defaults/preferences/treestyletab.js
@@ -672,6 +672,11 @@ pref("extensions.treestyletab.groupTab.columnize", true);
 pref("extensions.treestyletab.groupTab.columnize.width", "20em");
 
 /**
+ * If true, other dragged tabs are shrunken while dragging.
+ */
+pref("extensions.treestyletab.shrinkOtherDraggedTabs", true);
+
+/**
  * If true, TST automatically disables Tabs in Titlebar appearance to avoid
  * broken appearance problems.
  */
diff --git a/install.rdf b/install.rdf
index 00a8b2e..69e959d 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,7 +5,7 @@
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    em:id="treestyletab at piro.sakura.ne.jp"
                    em:name="Tree Style Tab"
-                   em:version="0.18.2016090802"
+                   em:version="0.18.2016111701"
                    em:creator="YUKI "Piro" Hiroshi"
                    em:description="Show tabs like a tree."
                    em:homepageURL="http://piro.sakura.ne.jp/xul/_treestyletab.html.en"
@@ -34,6 +34,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
       </RDF:Description>
     </em:localized>
     <em:localized>
@@ -51,6 +52,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
       </RDF:Description>
     </em:localized>
     <em:localized>
@@ -68,6 +70,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Godai71.Extenzilla (it-IT locale)</em:translator>
       </RDF:Description>
     </em:localized>
@@ -86,6 +89,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Fatiaomao (zh-CN locale)</em:translator>
           <em:translator>hzhbest (zh-CN locale)</em:translator>
       </RDF:Description>
@@ -105,6 +109,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>tito (es-ES locale)</em:translator>
       </RDF:Description>
     </em:localized>
@@ -123,6 +128,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Andy Pillip (de-DE locale)</em:translator>
           <em:translator>Björn Kautler (de-DE locale)</em:translator>
       </RDF:Description>
@@ -142,6 +148,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>HkYtrewq (zh-TW locale)</em:translator>
           <em:translator>Tsprajna (zh-TW locale)</em:translator>
           <em:translator>bootleq (zh-TW locale)</em:translator>
@@ -162,6 +169,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>L'Autour (ru locale)</em:translator>
           <em:translator>Infocatcher (ru locale)</em:translator>
       </RDF:Description>
@@ -181,6 +189,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Leszek(teo)Życzkowski (pl locale)</em:translator>
       </RDF:Description>
     </em:localized>
@@ -199,6 +208,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Laurent Haas (fr-FR locale)</em:translator>
           <em:translator>AxlMun (fr-FR locale)</em:translator>
       </RDF:Description>
@@ -218,6 +228,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Mikael Hiort af Ornäs (sv-SE)</em:translator>
       </RDF:Description>
     </em:localized>
@@ -236,6 +247,7 @@
           <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
           <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
           <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
           <em:translator>Regmos (da-DK)</em:translator>
       </RDF:Description>
     </em:localized>
@@ -254,6 +266,7 @@
             <em:contributor>Xidorn Quan (Firefox 40+ support)</em:contributor>
             <em:contributor>J. Ryan Stinnett (bug fix around tearing off of multiple tabs)</em:contributor>
             <em:contributor>lv7777</em:contributor>
+          <em:contributor>Andrew Shu (better styling of tabs with the "Metal" skin on macOS)</em:contributor>
             <em:translator>Vlastimil Ovčáčík (cs)</em:translator>
         </RDF:Description>
     </em:localized>
@@ -262,7 +275,7 @@
     <em:targetApplication>
       <RDF:Description em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
                        em:minVersion="45.0"
-                       em:maxVersion="51.0a1" />
+                       em:maxVersion="52.0a1" />
     </em:targetApplication>
   </RDF:Description>
 </RDF:RDF>
diff --git a/modules/base.js b/modules/base.js
index 71b2fae..0f50f59 100644
--- a/modules/base.js
+++ b/modules/base.js
@@ -54,10 +54,6 @@ XPCOMUtils.defineLazyGetter(this, 'prefs', function() {
 	Cu.import('resource://treestyletab-modules/lib/prefs.js');
 	return window['piro.sakura.ne.jp'].prefs;
 });
-XPCOMUtils.defineLazyGetter(this, 'extensions', function() {
-	Cu.import('resource://treestyletab-modules/lib/extensions.js', {});
-	return window['piro.sakura.ne.jp'].extensions;
-});
 XPCOMUtils.defineLazyGetter(this, 'animationManager', function() {
 	Cu.import('resource://treestyletab-modules/lib/animationManager.js', {});
 	return window['piro.sakura.ne.jp'].animationManager;
@@ -117,7 +113,6 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, {
 		return SessionStore;
 	},
 
-	get extensions() { return extensions; },
 	get animationManager() { return animationManager; },
 	get autoScroll() { return autoScroll; },
 	get AeroPeek() { return AeroPeek; }, // for Windows
@@ -1411,8 +1406,18 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, {
 		if (!tab || tab.getAttribute('pinned') == 'true')
 			return false;
 
+		var nextTab = (function findNextSiblingTab(aTab) {
+				if (!aTab)
+					return null;
+
+				var nextTab = this.getNextSiblingTab(aTab);
+				if (nextTab)
+					return nextTab;
+
+				return findNextSiblingTab.call(this, this.getParentTab(aTab));
+			}).call(this, tab);
+
 		var parentTab = this.getParentTab(tab);
-		var nextTab = this.getNextSiblingTab(tab) || this.getNextTab(tab);
 		if (parentTab) {
 			/**
 			 * If the base tab has a parent, open the new tab as a child of
diff --git a/modules/browser.js b/modules/browser.js
index fe5f471..20438d3 100644
--- a/modules/browser.js
+++ b/modules/browser.js
@@ -50,6 +50,7 @@ Cu.import('resource://treestyletab-modules/ReferenceCounter.js');
 
 XPCOMUtils.defineLazyModuleGetter(this, 'Services', 'resource://gre/modules/Services.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Promise', 'resource://gre/modules/Promise.jsm');
+XPCOMUtils.defineLazyModuleGetter(this, 'AddonManager', 'resource://gre/modules/AddonManager.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
 XPCOMUtils.defineLazyModuleGetter(this, 'FullTooltipManager', 'resource://treestyletab-modules/fullTooltip.js');
 XPCOMUtils.defineLazyModuleGetter(this, 'TabbarDNDObserver', 'resource://treestyletab-modules/tabbarDNDObserver.js');
@@ -2970,16 +2971,15 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 			prefs.getPref('extensions.informationaltab.thumbnail.enabled') &&
 			prefs.getPref('extensions.informationaltab.thumbnail.position') < 100
 			) {
-			let self = this;
-			this.extensions.isAvailable('informationaltab at piro.sakura.ne.jp', {
-				ok : function() {
+			AddonManager.getAddonByID('informationaltab at piro.sakura.ne.jp', (function(aAddon) {
+				if (aAddon) {
 					aStyle = 'retro';
-					self.setTabbrowserAttribute(self.kTWISTY_STYLE, aStyle);
-				},
-				ng : function() {
-					self.setTabbrowserAttribute(self.kTWISTY_STYLE, aStyle);
+					this.setTabbrowserAttribute(this.kTWISTY_STYLE, aStyle);
 				}
-			});
+				else {
+					this.setTabbrowserAttribute(this.kTWISTY_STYLE, aStyle);
+				}
+			}).bind(this));
 			return;
 		}
 
@@ -6123,50 +6123,15 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 		}
 
 		var self = this;
-		var CSSTransitionEnabled = ('transition' in aTab.style);
-		if (CSSTransitionEnabled) {
-			aTab.__treestyletab__updateTabIndentTask = function(aTime, aBeginning, aChange, aDuration) {
-				delete aTab.__treestyletab__updateTabIndentTask;
-				if (!self.isDestroying)
-					aTab.style.setProperty(self.indentCSSProp, aIndent+'px', 'important');
-				return true;
-			};
-			this.animationManager.addTask(
-				aTab.__treestyletab__updateTabIndentTask,
-				0, 0, 1, this.window
-			);
-			return;
-		}
-
-		var startIndent = this.getPropertyPixelValue(aTab, this.indentCSSProp);
-		var delta       = aIndent - startIndent;
-		var radian      = 90 * Math.PI / 180;
 		aTab.__treestyletab__updateTabIndentTask = function(aTime, aBeginning, aChange, aDuration) {
-			if (self.isDestroying)
-				return true;
-			var indent, finished;
-			if (aTime >= aDuration) {
-				delete aTab.__treestyletab__updateTabIndentTask;
-				indent = aIndent;
-				finished = true;
-			}
-			else {
-				indent = startIndent + (delta * Math.sin(aTime / aDuration * radian));
-				finished = false;
-			}
-			aTab.style.setProperty(self.indentCSSProp, indent+'px', 'important');
-			if (finished) {
-				startIndent = null;
-				delta = null;
-				radian = null;
-				self = null;
-				aTab = null;
-			}
-			return finished;
+			delete aTab.__treestyletab__updateTabIndentTask;
+			if (!self.isDestroying)
+				aTab.style.setProperty(self.indentCSSProp, aIndent+'px', 'important');
+			return true;
 		};
 		this.animationManager.addTask(
 			aTab.__treestyletab__updateTabIndentTask,
-			0, 0, this.indentDuration, this.window
+			0, 0, 1, this.window
 		);
 	},
 	stopTabIndentAnimation : function TSTBrowser_stopTabIndentAnimation(aTab)
@@ -6802,8 +6767,6 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 
 		aTab.setAttribute(this.kCOLLAPSING_PHASE, aCollapsed ? this.kCOLLAPSING_PHASE_TO_BE_COLLAPSED : this.kCOLLAPSING_PHASE_TO_BE_EXPANDED );
 
-		var CSSTransitionEnabled = ('transition' in aTab.style);
-
 		var maxMargin;
 		var offsetAttr;
 		var collapseProp = 'margin-'+this.collapseTarget;
@@ -6823,11 +6786,11 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 			}
 		}
 
-		var startMargin, endMargin, startOpacity, endOpacity;
+		var startMargin, endMargin, endOpacity;
+		var startOpacity = this.window.getComputedStyle(aTab).opacity;
 		if (aCollapsed) {
 			startMargin  = 0;
 			endMargin    = maxMargin;
-			startOpacity = 1;
 			endOpacity   = 0;
 			if (this.canStackTabs && this.getParentTab(aTab)) {
 				endOpacity = 1;
@@ -6864,20 +6827,13 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 			let pinned = aTab.getAttribute('pinned') == 'true';
 			let canExpand = !pinned || this.collapseCSSProp != 'margin-top';
 
-			if (CSSTransitionEnabled) {
-				if (canExpand)
-					aTab.style.setProperty(this.collapseCSSProp, endMargin ? '-'+endMargin+'px' : '', 'important');
+			if (canExpand)
+				aTab.style.setProperty(this.collapseCSSProp, endMargin ? '-'+endMargin+'px' : '', 'important');
 
-				if (endOpacity == 0)
-					aTab.style.setProperty('opacity', endOpacity == 1 ? '' : endOpacity, 'important');
-				else
-					aTab.style.removeProperty('opacity');
-			}
-			else {
-				if (canExpand)
-					aTab.style.removeProperty(this.collapseCSSProp);
-				aTab.style.removeProperty('opacity');
-			}
+			if (endOpacity == 0)
+				aTab.style.setProperty('opacity', 0, 'important');
+			else
+				aTab.style.opacity = '';
 
 			if (aCallbackToRunOnStartAnimation)
 				aCallbackToRunOnStartAnimation();
@@ -6888,7 +6844,7 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 		var deltaOpacity = endOpacity - startOpacity;
 
 		aTab.style.setProperty(this.collapseCSSProp, startMargin ? '-'+startMargin+'px' : '', 'important');
-		aTab.style.setProperty('opacity', startOpacity == 1 ? '' : startOpacity, 'important');
+		aTab.style.setProperty('opacity', startOpacity, 'important');
 
 		if (!aCollapsed) {
 			aTab.setAttribute(offsetAttr, maxMargin);
@@ -6905,10 +6861,8 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 				// The callback must be started before offsetAttr is changed!
 				if (aCallbackToRunOnStartAnimation)
 					aCallbackToRunOnStartAnimation();
-				if (CSSTransitionEnabled) {
-					aTab.style.setProperty(self.collapseCSSProp, endMargin ? '-'+endMargin+'px' : '', 'important');
-					aTab.style.setProperty('opacity', endOpacity == 1 ? '' : endOpacity, 'important');
-				}
+				aTab.style.setProperty(self.collapseCSSProp, endMargin ? '-'+endMargin+'px' : '', 'important');
+				aTab.style.setProperty('opacity', endOpacity, 'important');
 			}
 			firstFrame = false;
 			// If this is the last tab, negative scroll happens.
@@ -6929,13 +6883,28 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 				delete aTab.__treestyletab__updateTabCollapsedTask;
 				if (aCollapsed)
 					aTab.setAttribute(self.kCOLLAPSED_DONE, true);
-				if (!CSSTransitionEnabled) {
-					aTab.style.removeProperty(self.collapseCSSProp);
-					aTab.style.removeProperty('opacity');
-				}
 				aTab.removeAttribute(offsetAttr);
 				aTab.removeAttribute(self.kCOLLAPSING_PHASE);
 
+				if (endOpacity > 0) {
+					if (self.window.getComputedStyle(aTab).opacity > 0) {
+						aTab.style.opacity = '';
+						aTab = null;
+					}
+					else {
+						// If we clear its "opacity" before it becomes "1"
+						// by CSS transition, the calculated opacity will
+						// become 0 after we set an invalid value to clear it.
+						// So we have to clear it with delay.
+						// This is workaround for the issue:
+						//   https://github.com/piroor/treestyletab/issues/1202
+						setTimeout(function() {
+							aTab.style.opacity = '';
+							aTab = null;
+						}, 0);
+					}
+				}
+
 				maxMargin = null;
 				offsetAttr = null;
 				startMargin = null;
@@ -6947,18 +6916,10 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
 				collapseProp = null;
 				radian = null;
 				self = null;
-				aTab = null;
 
 				return true;
 			}
 			else {
-				if (!CSSTransitionEnabled) {
-					let power   = Math.sin(aTime / aDuration * radian);
-					let margin  = startMargin + (deltaMargin * power);
-					let opacity = startOpacity + (deltaOpacity  * power);
-					aTab.style.setProperty(self.collapseCSSProp, margin ? '-'+margin+'px' : '', 'important');
-					aTab.style.setProperty('opacity', opacity == 1 ? '' : opacity, 'important');
-				}
 				aTab.setAttribute(offsetAttr, maxMargin);
 				return false;
 			}
diff --git a/modules/lib/extensions.js b/modules/lib/extensions.js
deleted file mode 100644
index f06effa..0000000
--- a/modules/lib/extensions.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- Extensions Compatibility Library
-
- Usage:
-     var extensions = window['piro.sakura.ne.jp'].extensions;
-     extensions.isAvailable('my.extension.id at example.com', {
-       ok : function() { extensions.goToOptions('my.extension.id at example.com'); },
-       ng : function() { alert('NOT INSTALLED'); }
-     });
-     extensions.isInstalled('my.extension.id at example.com', {
-       ok : function(aDir) {
-         var dir = aDir; // nsILocalFile
-       }
-     });
-
- license: The MIT License, Copyright (c) 2009-2016 YUKI "Piro" Hiroshi
- original:
-   http://github.com/piroor/fxaddonlib-extensions
-*/
-
-/* To work as a JS Code Module */
-if (typeof window == 'undefined' ||
-	(window && typeof window.constructor == 'function')) {
-	this.EXPORTED_SYMBOLS = ['extensions'];
-
-	// If namespace.jsm is available, export symbols to the shared namespace.
-	// See: http://github.com/piroor/fxaddonlibs/blob/master/namespace.jsm
-	try {
-		let ns = {};
-		Components.utils.import('resource://treestyletab-modules/lib/namespace.jsm', ns);
-		/* var */ window = ns.getNamespaceFor('piro.sakura.ne.jp');
-	}
-	catch(e) {
-		window = {};
-	}
-}
-
-(function() {
-	const currentRevision = 13;
-
-	if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
-
-	var loadedRevision = 'extensions' in window['piro.sakura.ne.jp'] ?
-			window['piro.sakura.ne.jp'].extensions.revision :
-			0 ;
-	if (loadedRevision && loadedRevision > currentRevision) {
-		return;
-	}
-
-	const Cc = Components.classes;
-	const Ci = Components.interfaces;
-
-	var { AddonManager } = Components.utils.import('resource://gre/modules/AddonManager.jsm', {});
-
-	window['piro.sakura.ne.jp'].extensions = {
-		revision : currentRevision,
-
-		_formatCallbacks : function(aOKCallback, aNGCallback)
-		{
-			var callbacks = {
-					ok : aOKCallback,
-					ng : aNGCallback
-				};
-			if (typeof aOKCallback != 'function')
-				callbacks = aOKCallback;
-
-			if (!('ok' in callbacks) || typeof callbacks.ok != 'function')
-				callbacks.ok = function() {};
-			if (!('ng' in callbacks) || typeof callbacks.ng != 'function')
-				callbacks.ng = function() {};
-
-			return callbacks;
-		},
-
-
-		isAvailable : function(aId, aOKCallback, aNGCallback)
-		{
-			return this.isEnabled(aId, aOKCallback, aNGCallback);
-		},
-
-
-		isInstalled : function(aId, aOKCallback, aNGCallback)
-		{
-			var callbacks = this._formatCallbacks(aOKCallback, aNGCallback);
-			AddonManager.getAddonByID(aId, function(aAddon) {
-				callbacks[aAddon ? 'ok' : 'ng']();
-			});
-		},
-
-
-		isEnabled : function(aId, aOKCallback, aNGCallback)
-		{
-			var callbacks = this._formatCallbacks(aOKCallback, aNGCallback);
-			AddonManager.getAddonByID(aId, function(aAddon) {
-				callbacks[aAddon && aAddon.isActive ? 'ok' : 'ng']();
-			});
-		},
-
-
-		getInstalledLocation : function(aId, aCallback)
-		{
-			AddonManager.getAddonByID(aId, function(aAddon) {
-				var location = null;
-				if (aAddon)
-					location = aAddon.getResourceURI('/').QueryInterface(Ci.nsIFileURL).file.clone();
-				aCallback(location);
-			});
-		},
-
-		getVersion : function(aId, aCallback)
-		{
-			AddonManager.getAddonByID(aId, function(aAddon) {
-				aCallback(aAddon ? aAddon.version : null );
-			});
-		},
-
-
-		goToOptions : function(aId, aOwnerWindow)
-		{
-			var self = this;
-			var callback = function(aURI) {
-					self.goToOptionsInternal(aURI, aOwnerWindow);
-				};
-			AddonManager.getAddonByID(aId, function(aAddon) {
-				callback(aAddon && aAddon.isActive ? aAddon.optionsURL : null );
-			});
-		},
-		goToOptionsInternal : function(aURI, aOwnerWindow)
-		{
-			if (!aURI) return;
-
-			var windows = this._WindowMediator.getEnumerator(null);
-			while (windows.hasMoreElements())
-			{
-				let win = windows.getNext();
-				if (win.location.href == aURI) {
-					win.focus();
-					return;
-				}
-			}
-			var instantApply = false;
-			try {
-				instantApply = Cc['@mozilla.org/preferences;1']
-								.getService(Ci.nsIPrefBranch)
-								.getBoolPref('browser.preferences.instantApply');
-			}
-			catch(e) {
-			}
-			(aOwnerWindow || window).openDialog(
-				aURI,
-				'',
-				'chrome,titlebar,toolbar,centerscreen,' + (instantApply ? 'dialog=no' : 'modal' )
-			);
-		}
-	};
-})();
-
-if (window != this) { // work as a JS Code Module
-	this.extensions = window['piro.sakura.ne.jp'].extensions;
-}
-
diff --git a/modules/lib/prefs.js b/modules/lib/prefs.js
index b3f1206..12f60c6 100644
--- a/modules/lib/prefs.js
+++ b/modules/lib/prefs.js
@@ -19,6 +19,15 @@
    window['piro.sakura.ne.jp'].prefs.addPrefListener(listener);
    window['piro.sakura.ne.jp'].prefs.removePrefListener(listener);
 
+   // utility
+   var store = window['piro.sakura.ne.jp'].prefs.createStore('extensions.someextension.');
+   // property name/key, default value
+   store.define('enabled', true);
+   // property name, default value, pref key (different to the name)
+   store.define('leftMargin', true, 'margin.left');
+   var enabled = store.enabled;
+   store.destroy(); // free the memory.
+
  license: The MIT License, Copyright (c) 2009-2013 YUKI "Piro" Hiroshi
  original:
    http://github.com/piroor/fxaddonlib-prefs
@@ -42,7 +51,7 @@ if (typeof window == 'undefined' ||
 }
 
 (function() {
-	const currentRevision = 13;
+	const currentRevision = 16;
 
 	if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
 
@@ -169,36 +178,26 @@ if (typeof window == 'undefined' ||
 	 
 		getChildren : function(aRoot, aBranch) 
 		{
+			aRoot = aRoot.replace(/\.$/, '');
 			var foundChildren = {};
 			var possibleChildren = [];
-			var actualChildren = [];
 			this.getDescendant(aRoot, aBranch)
 					.forEach(function(aPrefstring) {
-						var name = aPrefstring.replace(aRoot, '');
-						if (name.charAt(0) == '.')
-							name = name.substring(1);
-						if (name.indexOf('.') < 0) {
-							if (!(aPrefstring in foundChildren)) {
-								actualChildren.push(aPrefstring);
-								foundChildren[aPrefstring] = true;
-							}
-						}
-						else {
-							let possibleChildKey = aRoot + name.split('.')[0];
+						var name = aPrefstring.replace(aRoot + '.', '');
+							let possibleChildKey = aRoot + '.' + name.split('.')[0];
 							if (possibleChildKey && !(possibleChildKey in foundChildren)) {
 								possibleChildren.push(possibleChildKey);
 								foundChildren[possibleChildKey] = true;
 							}
-						}
 					});
-			return possibleChildren.concat(actualChildren).sort();
+			return possibleChildren.sort();
 		},
 	 
 		addPrefListener : function(aObserver) 
 		{
 			var domains = ('domains' in aObserver) ? aObserver.domains : [aObserver.domain] ;
 			try {
-				for each (var domain in domains)
+				for (var domain of domains)
 					this.Prefs.addObserver(domain, aObserver, false);
 			}
 			catch(e) {
@@ -209,11 +208,44 @@ if (typeof window == 'undefined' ||
 		{
 			var domains = ('domains' in aObserver) ? aObserver.domains : [aObserver.domain] ;
 			try {
-				for each (var domain in domains)
+				for (var domain of domains)
 					this.Prefs.removeObserver(domain, aObserver, false);
 			}
 			catch(e) {
 			}
+		},
+
+		createStore : function(aDomain)
+		{
+			var listener = {
+				domain : aDomain,
+				observe : function(aSubject, aTopic, aData) {
+					if (aTopic != 'nsPref:changed')
+						return;
+					var name = keyToName[aData];
+					store[name] = window['piro.sakura.ne.jp'].prefs.getPref(aData);
+				}
+			};
+			this.addPrefListener(listener);
+			var keyToName = {};
+			var base = aDomain.replace(/\.$/, '') + '.';
+			var store = {
+				define : function(aName, aValue, aKey) {
+					aKey = base + (aKey || aName);
+					window['piro.sakura.ne.jp'].prefs.setDefaultPref(aKey, aValue);
+					this[aName] = window['piro.sakura.ne.jp'].prefs.getPref(aKey);
+					keyToName[aKey] = aName;
+				},
+				destroy : function() {
+					window['piro.sakura.ne.jp'].prefs.removePrefListener(listener);
+					aDomain = undefined;
+					base = undefined;
+					listener = undefined;
+					keyToName = undefined;
+					store = undefined;
+				}
+			};
+			return store;
 		}
 	};
 })();
diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js
index 56695ef..7a6ab9e 100644
--- a/modules/tabbarDNDObserver.js
+++ b/modules/tabbarDNDObserver.js
@@ -773,7 +773,9 @@ catch(e) {
 			)
 			return;
 
-		w['piro.sakura.ne.jp'].tabsDragUtils.startTabsDrag(aEvent, tabsInfo.draggedTabs);
+		w['piro.sakura.ne.jp'].tabsDragUtils.startTabsDrag(aEvent, tabsInfo.draggedTabs, {
+			shrinkOthers : utils.getTreePref('shrinkOtherDraggedTabs')
+		});
 	},
  
 	onTabbarDragStart : function TabbarDND_onTabbarDragStart(aEvent) 
diff --git a/skin/classic/treestyletab/metal/Darwin.css b/skin/classic/treestyletab/metal/Darwin.css
index 1d0dad8..894461f 100644
--- a/skin/classic/treestyletab/metal/Darwin.css
+++ b/skin/classic/treestyletab/metal/Darwin.css
@@ -5,8 +5,14 @@
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab
   .tab-close-button {
-	padding-left: 0 !important;
-	padding-right: 0 !important;
+	padding: 0 !important;
+	margin-top: -1px !important;
+}
+
+.tabbrowser-tabs[treestyletab-mode="vertical"]
+  .tabs-newtab-button
+  .toolbarbutton-icon {
+	width: auto !important;
 }
 
 .tabbrowser-strip[treestyletab-mode="vertical"] {
diff --git a/skin/classic/treestyletab/metal/tab.css b/skin/classic/treestyletab/metal/tab.css
index 56c682f..91a1db6 100644
--- a/skin/classic/treestyletab/metal/tab.css
+++ b/skin/classic/treestyletab/metal/tab.css
@@ -196,23 +196,6 @@
 
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab:not(:hover)
-  .tab-content[pinned],
-.tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab:hover
-  .tab-content[pinned],
-.tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab[visuallyselected]:not(:hover)
-  .tab-content[pinned],
-.tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab[visuallyselected]:hover
-  .tab-content[pinned] {
-	-moz-border-image: none !important;
-	border-image: none !important;
-	margin: 0 !important;
-	padding: 0 !important;
-}
-.tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab:not(:hover)
   .tab-content[pinned]:not([titlechanged]),
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab:hover
diff --git a/skin/classic/treestyletab/ui-base.css b/skin/classic/treestyletab/ui-base.css
index 3b730f0..ace694c 100644
--- a/skin/classic/treestyletab/ui-base.css
+++ b/skin/classic/treestyletab/ui-base.css
@@ -364,6 +364,12 @@ tabbrowser[treestyletab-tabbar-position="bottom"]
 	width: 16px;
 }
 
+/* sharing overlay icon */
+.tabbrowser-tabs[treestyletab-mode="vertical"]
+  .tab-content[pinned="true"] > image.tab-sharing-icon-overlay {
+	margin-left: -16px;
+}
+
 /* overlay icon: because TST applies "min-height:2em" for tabs, overlay icons also should be rendered based on the "em" scale. */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tab-content[pinned="true"] > image.tab-icon-overlay {
diff --git a/treestyletab.update.rdf b/treestyletab.update.rdf
deleted file mode 100644
index 5a625e6..0000000
--- a/treestyletab.update.rdf
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-        xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-    <rdf:Description rdf:about="urn:mozilla:extension:treestyletab at piro.sakura.ne.jp">
-        <em:updates>
-            <rdf:Seq>
-                <rdf:li>
-                    <rdf:Description>
-                        <em:version>0.18.2016090802</em:version>
-                        <em:targetApplication>
-                            <rdf:Description>
-                                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-                                <em:minVersion>45.0</em:minVersion>
-                                <em:maxVersion>51.0a1</em:maxVersion>
-                                <em:updateLink>http://piro.sakura.ne.jp/xul/xpi/treestyletab.xpi?version=0.18.2016090802</em:updateLink>
-                                <em:updateHash>sha1:e6ee377b6df5853bb90016acd4879f7337081fde</em:updateHash>
-                            </rdf:Description>
-                        </em:targetApplication>
-                    </rdf:Description>
-                </rdf:li>
-            </rdf:Seq>
-        </em:updates>
-        <em:signature>
-            MIGRMAsGCSqGSIb3DQEBDQOBgQB9ADxK5oGK0GDGOhQYeMPpTC1/R6/182jThC4G
-            wS4WmRFaX344NMlBKtqEO/auJzc0sOzdCgrXO+alNwePOisor95TsIqHcwf3CV9i
-            3boyTvbD63gXlgfWCN8mjIlwp4LDkmzArUaDMYg85dB0aoenSTRtMv16xoTzlTY9
-            ludWkg==
-        </em:signature>
-    </rdf:Description>
-</rdf:RDF>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tree-style-tab.git



More information about the Pkg-mozext-commits mailing list