Smoothly Close Tabs ( https://addons.mozilla.org/firefox/addon/71410 )があっても動くように
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6316 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
8057f93e9c
commit
afeea791c9
@ -962,6 +962,38 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function TSTService_override
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Smoothly Close Tabs
|
||||
// https://addons.mozilla.org/firefox/addon/71410
|
||||
if ('SMOOTHLYCLOSETABS' in window) {
|
||||
let replaceScrollProps = function(aString) {
|
||||
return aString.replace(
|
||||
/\.scrollWidth/g,
|
||||
'[scrollProp]'
|
||||
).replace(
|
||||
/"width"/g,
|
||||
'sizeProp'
|
||||
).replace(
|
||||
/\.maxWidth/g,
|
||||
'[maxSizeProp]'
|
||||
).replace(
|
||||
'{',
|
||||
<![CDATA[$&
|
||||
var scrollProp = gBrowser.treeStyleTab.isVertical ? 'scrollHeight' : 'scrollWidth' ;
|
||||
var sizeProp = gBrowser.treeStyleTab.isVertical ? 'height' : 'width' ;
|
||||
var maxSizeProp = gBrowser.treeStyleTab.isVertical ? 'maxHeight' : 'maxWidth' ;
|
||||
]]>
|
||||
)
|
||||
}
|
||||
eval('SMOOTHLYCLOSETABS.shrinkTab = '+
|
||||
replaceScrollProps(SMOOTHLYCLOSETABS.shrinkTab.toSource())
|
||||
);
|
||||
eval('SMOOTHLYCLOSETABS.shrinkTabIcon = '+
|
||||
replaceScrollProps(SMOOTHLYCLOSETABS.shrinkTabIcon.toSource())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
window.setTimeout(function(aSelf) {
|
||||
aSelf.overrideExtensionsDelayed();
|
||||
}, 0, this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user