From 024332c8cddd5ffc6b575fca08c17c5aab7361bd Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 23 Mar 2010 14:21:13 +0000 Subject: [PATCH] =?UTF-8?q?3.7a4pre=E5=AF=BE=E5=BF=9C=E6=BA=96=E5=82=99?= =?UTF-8?q?=EF=BC=9AgetTabBrowserFromChild=E3=81=AE=E6=94=B9=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6384 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- .../treestyletab/res/bookmarkMultipleTabs.xul | 18 +++++++++--------- modules/utils.js | 6 ++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/content/treestyletab/res/bookmarkMultipleTabs.xul b/content/treestyletab/res/bookmarkMultipleTabs.xul index b262d190..613c39a0 100644 --- a/content/treestyletab/res/bookmarkMultipleTabs.xul +++ b/content/treestyletab/res/bookmarkMultipleTabs.xul @@ -12,7 +12,7 @@ in JS files: window['piro.sakura.ne.jp'].bookmarkMultipleTabs.addBookmarkFor(tabsArray, folderName); - lisence: The MIT License, Copyright (c) 2009 SHIMODA "Piro" Hiroshi + lisence: The MIT License, Copyright (c) 2009-2010 SHIMODA "Piro" Hiroshi http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/license.txt original: http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/bookmarkMultipleTabs.xul @@ -24,7 +24,7 @@ window.addEventListener('DOMContentLoaded', function() { window.removeEventListener('DOMContentLoaded', arguments.callee, true); - const currentRevision = 3; + const currentRevision = 4; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; @@ -105,18 +105,18 @@ window.addEventListener('DOMContentLoaded', function() { }, addBookmarkTabsFilter : addBookmarkTabsFilter, - Prefs : Components.classes['@mozilla.org/preferences;1'] + Prefs : Components.classes['@mozilla.org/preferences-service;'] .getService(Components.interfaces.nsIPrefBranch), getTabBrowserFromChild : function(aTab) { - return aTab.ownerDocument.evaluate( - 'ancestor-or-self::*[local-name()="tabbrowser"]', - aTab, - null, - XPathResult.FIRST_ORDERED_NODE_TYPE, - null + var b = this.evaluateXPath( + 'ancestor-or-self::*[local-name()="tabbrowser"] | '+ + 'ancestor-or-self::*[local-name()="tabs"][@tabbrowser]', + aNode, + XPathResult.FIRST_ORDERED_NODE_TYPE ).singleNodeValue; + return (b && b.tabbrowser) || b; } }; }, true); diff --git a/modules/utils.js b/modules/utils.js index 126cf6ca..5c800307 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -782,11 +782,13 @@ var TreeStyleTabUtils = { if (aTabBrowserChild.localName == 'tabbrowser') return aTabBrowserChild; - return this.evaluateXPath( - 'ancestor::xul:tabbrowser[1]', + var b = this.evaluateXPath( + 'ancestor::xul:tabbrowser | '+ + 'ancestor::xul:tabs[@tabbrowser]', aTabBrowserChild, Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE ).singleNodeValue; + return (b && b.tabbrowser) || b; }, getTabBrowserFromFrame : function TSTUtils_getTabBrowserFromFrame(aFrame)