3daf386334
(see https://bugzilla.mozilla.org/show_bug.cgi?id=457651 ) git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@3526 599a83e7-65a4-db11-8015-0010dcdd6dc2
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
window.addEventListener('load', function() {
|
|
window.removeEventListener('load', arguments.callee, false);
|
|
|
|
if ('BookmarksCommand' in window) { // Firefox 2
|
|
eval('BookmarksCommand.openGroupBookmark = '+
|
|
BookmarksCommand.openGroupBookmark.toSource().replace(
|
|
/(tabPanels\[index\])(\.loadURI\(uri\);)/,
|
|
<><![CDATA[
|
|
$1$2
|
|
if (!doReplace &&
|
|
TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree') &&
|
|
!browser.treeStyleTab.parentTab) {
|
|
browser.treeStyleTab.partTab(browser.treeStyleTab.getTabs(browser).snapshotItem(index));
|
|
TreeStyleTabService.readyToOpenChildTab($1, true);
|
|
}
|
|
]]></>
|
|
).replace(
|
|
'browser.addTab(uri);',
|
|
<><![CDATA[
|
|
var openedTab = $&
|
|
if (!doReplace &&
|
|
TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree') &&
|
|
!browser.treeStyleTab.parentTab) {
|
|
TreeStyleTabService.readyToOpenChildTab(openedTab, true);
|
|
}
|
|
]]></>
|
|
).replace(
|
|
'if (index == index0)',
|
|
<><![CDATA[
|
|
TreeStyleTabService.stopToOpenChildTab(browser);
|
|
$&]]></>
|
|
)
|
|
);
|
|
}
|
|
|
|
// Firefox 3
|
|
if ('PlacesUIUtils' in window || 'PlacesUtils' in window) {
|
|
var urils = 'PlacesUIUtils' in window ? PlacesUIUtils : PlacesUtils ;
|
|
eval('urils._openTabset = '+
|
|
urils._openTabset.toSource().replace(
|
|
'browserWindow.getBrowser().loadTabs(',
|
|
<><![CDATA[
|
|
if (
|
|
TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree') &&
|
|
(
|
|
where.indexOf('tab') == 0 ||
|
|
aEvent.target.getAttribute('openInTabs') == 'true'
|
|
)
|
|
)
|
|
{
|
|
TreeStyleTabService.readyToOpenNewTabGroup();
|
|
replaceCurrentTab = false;
|
|
}
|
|
else if (!TreeStyleTabService.getPref('browser.tabs.loadFolderAndReplace')) {
|
|
replaceCurrentTab = false;
|
|
}
|
|
$&]]></>
|
|
)
|
|
);
|
|
}
|
|
}, false);
|