From 68e156bd12154cc89e32c3f2f95965f30ffb3391 Mon Sep 17 00:00:00 2001 From: SHIMODA Hiroshi Date: Wed, 24 Aug 2011 10:20:31 +0900 Subject: [PATCH] don't show "replace current tab" item for bookmark groups on Firefox 8 or later (fix for https://bugzilla.mozilla.org/show_bug.cgi?id=440093 ) --- content/treestyletab/bookmarksOverlay.js | 8 ++++++-- content/treestyletab/config.js | 10 ++++++++++ content/treestyletab/config.xul | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index d9a1ce0e..901f5a89 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -277,10 +277,14 @@ var TreeStyleTabBookmarksService = { else { sv.readyToOpenNewTabGroup(null, treeStructure, TSTOpenGroupBookmarkBehavior & sv.kGROUP_BOOKMARK_EXPAND_ALL_TREE); } - replaceCurrentTab = false; + // replaceCurrentTab works only on Firefox 7 or earlier + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=440093 + if (typeof replaceCurrentTab !== 'undefined') + replaceCurrentTab = false; } else { - replaceCurrentTab = !!(TSTOpenGroupBookmarkBehavior & sv.kGROUP_BOOKMARK_REPLACE); + if (typeof replaceCurrentTab !== 'undefined') + replaceCurrentTab = !!(TSTOpenGroupBookmarkBehavior & sv.kGROUP_BOOKMARK_REPLACE); } } $1 diff --git a/content/treestyletab/config.js b/content/treestyletab/config.js index a97a9396..f4a055a1 100644 --- a/content/treestyletab/config.js +++ b/content/treestyletab/config.js @@ -168,6 +168,16 @@ function initTabPane() newTabPref.removeAttribute('hidden'); else newTabPref.setAttribute('hidden', true); + + var bookmarkGroupReplacePref = document.getElementById('openGroupBookmark.replace'); + if (comparator.compare(XULAppInfo.version, '7.0') > 0) { + if (bookmarkGroupReplacePref.selected) + document.getElementById('openGroupBookmark.subtree').selected = true; + bookmarkGroupReplacePref.setAttribute('hidden', true); + } + else { + bookmarkGroupReplacePref.removeAttribute('hidden'); + } } function onSyncGroupBookmarkUIToPref() diff --git a/content/treestyletab/config.xul b/content/treestyletab/config.xul index 1b8358f5..f764145e 100644 --- a/content/treestyletab/config.xul +++ b/content/treestyletab/config.xul @@ -446,7 +446,7 @@ onsyncfrompreference="return onSyncGroupBookmarkPrefToUI();" preference="extensions.treestyletab.openGroupBookmark.behavior"> - + @@ -471,7 +471,8 @@ - +