diff --git a/chrome.manifest b/chrome.manifest index ceed7a4b..3d763b1e 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -34,11 +34,9 @@ skin treestyletab classic/1.0 skin/classic/treestyletab/ skin treestyletab-group classic/1.0 skin/classic/treestyletab-group-basic/ skin treestyletab-group classic/1.0 skin/classic/treestyletab-group-aero/ os=WINNT osversion>=6 -override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/dummy.css os=Darwin -override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/Darwin-base.css os=Darwin appversion>=29.0a1 +override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/Darwin-base.css os=Darwin override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/Linux-base.css os=Linux -override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/dummy.css os=WINNT -override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/WINNT-base.css os=WINNT appversion>=29.0a1 +override chrome://treestyletab/skin/platform-base.css chrome://treestyletab/skin/WINNT-base.css os=WINNT override chrome://treestyletab/skin/platform-styled.css chrome://treestyletab/skin/Darwin-styled.css os=Darwin override chrome://treestyletab/skin/platform-styled.css chrome://treestyletab/skin/dummy.css os=Linux override chrome://treestyletab/skin/platform-styled.css chrome://treestyletab/skin/WINNT-styled.css os=WINNT @@ -46,12 +44,10 @@ override chrome://treestyletab/skin/platform-styled.css chrome://treestyletab/sk override chrome://treestyletab/skin/ui.css chrome://treestyletab/skin/ui-base.css override chrome://treestyletab/skin/ui.css chrome://treestyletab/skin/ui-australis.css appversion>=29.0a1 -override chrome://treestyletab/skin/Linux-tabs-on-bottom.css chrome://treestyletab/skin/dummy.css os=Linux appversion>=29.0a1 - override chrome://treestyletab/skin/square/platform.css chrome://treestyletab/skin/square/Darwin.css os=Darwin override chrome://treestyletab/skin/square/platform.css chrome://treestyletab/skin/square/Linux.css os=Linux override chrome://treestyletab/skin/square/platform.css chrome://treestyletab/skin/dummy.css os=WINNT -override chrome://treestyletab/skin/square/disable-closebox-bg.css chrome://treestyletab/skin/dummy.css os=Linux appversion>=29.0b4 +override chrome://treestyletab/skin/square/disable-closebox-bg.css chrome://treestyletab/skin/dummy.css os=Linux override chrome://treestyletab/skin/metal/platform.css chrome://treestyletab/skin/metal/Darwin.css os=Darwin override chrome://treestyletab/skin/metal/platform.css chrome://treestyletab/skin/dummy.css os=WINNT @@ -61,8 +57,7 @@ override chrome://treestyletab/skin/platform-config.css chrome://treestyletab/sk override chrome://treestyletab/skin/platform-config.css chrome://treestyletab/skin/Linux-config.css os=Linux override chrome://treestyletab/skin/platform-config.css chrome://treestyletab/skin/dummy.css os=WINNT -override chrome://treestyletab/content/base-toolbar-binding.xml chrome://global/content/bindings/toolbar.xml -override chrome://treestyletab/content/base-toolbar-binding.xml chrome://browser/content/customizableui/toolbar.xml appversion>=29.0a1 +override chrome://treestyletab/content/base-toolbar-binding.xml chrome://browser/content/customizableui/toolbar.xml resource treestyletab-modules modules/ diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index bc41f2aa..ce60ca3e 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -60,10 +60,8 @@ var TreeStyleTabWindowHelper = { if ('BrowserOpenTab' in window) { eval('window.BrowserOpenTab = '+ window.BrowserOpenTab.toSource().replace( - // loadOneTab => Firefox 10 or olders - // openUILinkIn => Firefox 11 or later - /(gBrowser\.loadOneTab\(|openUILinkIn\(.+\,\s*"tab"\))/, - 'gBrowser.treeStyleTab.onBeforeNewTabCommand(); $1' + 'openUILinkIn(', + 'gBrowser.treeStyleTab.onBeforeNewTabCommand(); $&' ) ); } @@ -198,23 +196,14 @@ var TreeStyleTabWindowHelper = { ) ); - if ('BrowserSearch' in window) { - if ('_loadSearch' in BrowserSearch) { - eval('BrowserSearch._loadSearch = '+ - BrowserSearch._loadSearch.toSource().replace( - 'openLinkIn(', - 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0], useNewTab); $&' - ) - ); - } - else if ('loadSearch' in BrowserSearch) { // Firefox 24 and olders - eval('BrowserSearch.loadSearch = '+ - BrowserSearch.loadSearch.toSource().replace( - 'openLinkIn(', - 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0], useNewTab); $&' - ) - ); - } + if ('BrowserSearch' in window && + '_loadSearch' in BrowserSearch) { + eval('BrowserSearch._loadSearch = '+ + BrowserSearch._loadSearch.toSource().replace( + 'openLinkIn(', + 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0], useNewTab); $&' + ) + ); } if ('openLinkIn' in window) { diff --git a/history.en.md b/history.en.md index 628a9bcc..fac4e512 100644 --- a/history.en.md +++ b/history.en.md @@ -1,7 +1,8 @@ # History - master/HEAD - * Restore tab position for "Undo Close Tab" command correctly on Firefox 29 and newer versions. + * Drop support for Firefox 30 and older versions + * Restore tab position for "Undo Close Tab" command correctly. * Works on Nightly 33.0a1 with the preference `dom.compartment_per_addon`=`true`. * Update tabbar appearance correctly, after toolbar customization. * Update fr-FR locale, by AxlMun. Thanks! diff --git a/history.ja.md b/history.ja.md index 579134af..2dbd16a4 100644 --- a/history.ja.md +++ b/history.ja.md @@ -1,7 +1,8 @@ # 更新履歴 - master/HEAD - * Firefox 29以降において、閉じたタブを開き直したときの位置がおかしくなる問題を修正 + * Firefox 30およびそれ以前のバージョンへの対応を終了 + * 閉じたタブを開き直したときの位置がおかしくなる問題を修正 * Nightly 33.0a1において `dom.compartment_per_addon`=`true` に設定した場合でも動作するように暫定的に対処 * ツールバーカスタマイズを終えた後にタブバーの外観が壊れていたのを修正 * fr-FR ロケール更新(by AxlMun. Thanks!) diff --git a/install.rdf b/install.rdf index c661ea46..bebf1742 100644 --- a/install.rdf +++ b/install.rdf @@ -207,7 +207,7 @@ diff --git a/modules/browser.js b/modules/browser.js index ee090e86..b85a98a3 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -520,13 +520,6 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { var baseX = this.tabStrip.boxObject.screenX - this.document.documentElement.boxObject.screenX; - /** - * Hacks for Firefox 9 or olders. - * In a box with "direction: rtr", we have to position tabs - * by margin-right, because the basic position becomes - * "top-right" instead of "top-left". - */ - var remainder = maxWidth - (maxCol * width); var shrunkenOffset = (this.position == 'right' && tabbarPlaceHolderWidth) ? tabbarWidth - tabbarPlaceHolderWidth : 0 ; @@ -968,35 +961,6 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { if (!aTab.linkedBrowser.__treestyletab__toBeRestored) aTab.linkedBrowser.__treestyletab__toBeRestored = utils.isTabNotRestoredYet(aTab); - /** - * XXX Dirty hack for Firefox 28 and older, because - * there is no way to know when the tab is readied to be restored... - */ - var b = aTab.linkedBrowser; - if (!utils.shouldUseMessageManager && !b.__treestyletab__stop) { - let self = this; - b.__treestyletab__stop = b.stop; - b.stop = function TSTBrowser_stopHook(...aArgs) { - try { - var stack = Components.stack; - while (stack) - { - if (stack.name == 'sss_restoreHistoryPrecursor' || - stack.name == 'ssi_restoreHistoryPrecursor' || - stack.filename == 'resource:///modules/sessionstore/SessionStore.jsm') { - self.onRestoreTabContentStarted(aTab); - break; - } - stack = stack.caller; - } - } - catch(e) { - dump(e+'\n'+e.stack+'\n'); - } - return this.__treestyletab__stop.apply(this, aArgs); - }; - } - this.initTabAttributes(aTab); this.initTabContents(aTab); @@ -6642,16 +6606,13 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { var tabsToRestore = 0; // it is the number of pending tabs. if (utils.SessionStoreInternal && utils.SessionStoreInternal._browserEpochs) { - // for Firefox 29 and later - // (after https://bugzilla.mozilla.org/show_bug.cgi?id=942374) let browserEpochs = utils.SessionStoreInternal._browserEpochs; tabsToRestore = tabs.filter(function(aTab) { return browserEpochs.has(aTab.linkedBrowser.permanentKey); }).length; } else { - // for Firefox 24 and old versions - tabsToRestore = this.window.__SS_tabsToRestore; + Components.utils.reportError(new Error('There is no property named "_browserEpochs"!!')); } dump('TSTBrowser::restoreTree\n'); diff --git a/modules/utils.js b/modules/utils.js index b0edcd6a..8cfb1d82 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -244,22 +244,6 @@ let TreeStyleTabUtils = { }, - get shouldUseMessageManager() - { - if (this._shouldUseMessageManager !== null) - return this._shouldUseMessageManager; - - try { // detect Firefox 29 and later - Cu.import('resource:///modules/sessionstore/ContentRestore.jsm', {}); - this._shouldUseMessageManager = true; - } - catch(e) { - this._shouldUseMessageManager = false; - } - return this._shouldUseMessageManager; - }, - _shouldUseMessageManager: undefined, - isTabNotRestoredYet : function utils_isTabNotRestoredYet(aTab) { var browser = aTab.linkedBrowser; @@ -304,26 +288,11 @@ let TreeStyleTabUtils = { getShortcutOrURI : function utils_getShortcutOrURI(aBrowserWindow, aURI) { - if (aBrowserWindow.getShortcutOrURI) // Firefox 24 and older - return aBrowserWindow.getShortcutOrURI(aURI); - - var getShortcutOrURIAndPostData = aBrowserWindow.getShortcutOrURIAndPostData; var done = false; - if (getShortcutOrURIAndPostData.length == 2) { - // Firefox 31 and later, after https://bugzilla.mozilla.org/show_bug.cgi?id=989984 - getShortcutOrURIAndPostData(aURI, function(aData) { - aURI = aData.url; - done = true; - }); - } - else { - // Firefox 25-30 - Task.spawn(function() { - var data = yield getShortcutOrURIAndPostData(aURI); - aURI = data.url; - done = true; - }); - } + aBrowserWindow.getShortcutOrURIAndPostData(aURI, function(aData) { + aURI = aData.url; + done = true; + }); // this should be rewritten in asynchronous style... var thread = Cc['@mozilla.org/thread-manager;1'].getService().mainThread; diff --git a/modules/window.js b/modules/window.js index 2a5fb0ed..49caee9f 100644 --- a/modules/window.js +++ b/modules/window.js @@ -365,9 +365,7 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, { w.addEventListener('beforecustomization', this, true); w.addEventListener('aftercustomization', this, false); - // for Firefox 29 and later, after https://bugzilla.mozilla.org/show_bug.cgi?id=942374 - if (w.messageManager && utils.shouldUseMessageManager) - w.messageManager.addMessageListener('SessionStore:restoreTabContentStarted', this); + w.messageManager.addMessageListener('SessionStore:restoreTabContentStarted', this); this.fullscreenObserver = new FullscreenObserver(this.window); this.initUIShowHideObserver(); @@ -499,9 +497,7 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, { w.removeEventListener('beforecustomization', this, true); w.removeEventListener('aftercustomization', this, false); - // for Firefox 29 and later, after https://bugzilla.mozilla.org/show_bug.cgi?id=942374 - if (w.messageManager && utils.shouldUseMessageManager) - w.messageManager.removeMessageListener('SessionStore:restoreTabContentStarted', this); + w.messageManager.removeMessageListener('SessionStore:restoreTabContentStarted', this); this.fullscreenObserver.destroy(); delete this.fullscreenObserver; @@ -859,7 +855,6 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, { prefs.getPref('browser.ctrlTab.previews'); }, - // for Firefox 29 and later, after https://bugzilla.mozilla.org/show_bug.cgi?id=942374 receiveMessage : function TSTWindow_receiveMessage(aMessage) { var browser = aMessage.target; @@ -1409,8 +1404,7 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, { var checked = { value:true }; var w = this.window; w.focus(); - var message = utils.tabbrowserBundle.getFormattedString('tabs.closeWarningMultipleTabs', [aTabsCount]) || // Firefox 28 and older - w.PluralForm.get(aTabsCount, utils.tabbrowserBundle.getString('tabs.closeWarningMultiple')).replace('#1', aTabsCount) ; // Firefox 29 and later + var message = w.PluralForm.get(aTabsCount, utils.tabbrowserBundle.getString('tabs.closeWarningMultiple')).replace('#1', aTabsCount); var shouldClose = Services.prompt.confirmEx(w, utils.tabbrowserBundle.getString('tabs.closeWarningTitle'), message, diff --git a/skin/classic/treestyletab/Linux-base.css b/skin/classic/treestyletab/Linux-base.css index a5d1aae8..31b67e74 100644 --- a/skin/classic/treestyletab/Linux-base.css +++ b/skin/classic/treestyletab/Linux-base.css @@ -1,5 +1,3 @@ -@import url("./Linux-tabs-on-bottom.css"); - @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* splitter for floating & autohide tab bar */ diff --git a/skin/classic/treestyletab/Linux-tabs-on-bottom.css b/skin/classic/treestyletab/Linux-tabs-on-bottom.css deleted file mode 100644 index 567d94a4..00000000 --- a/skin/classic/treestyletab/Linux-tabs-on-bottom.css +++ /dev/null @@ -1,7 +0,0 @@ -@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); - -/* bottom border of the "Tabs on Bottom" toolbox */ -#main-window[treestyletab-mode="vertical"]:not([disablechrome]) - #navigator-toolbox:not([tabsontop="true"]) { - border-bottom: 1px solid ThreeDShadow; -}