Reduce use of eval()

This commit is contained in:
YUKI Hiroshi 2016-09-05 15:35:26 +09:00
parent 62cda54a6f
commit c101e5376d

View File

@ -291,16 +291,17 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
// DragIt // DragIt
// https://addons.mozilla.org/firefox/addon/dragit-formerly-drag-de-go/ // https://addons.mozilla.org/firefox/addon/dragit-formerly-drag-de-go/
// open new tabs as children of the current tab, for links or search terms
if ('DragIt' in window && if ('DragIt' in window &&
DragIt.tab && DragIt.tab &&
DragIt.tab.open && DragIt.tab.open &&
TreeStyleTabUtils.getTreePref('compatibility.DragIt')) { TreeStyleTabUtils.getTreePref('compatibility.DragIt') &&
eval('DragIt.tab.open = '+ !DragIt.tab.__treestyletab__open) {
DragIt.tab.open.toSource().replace( DragIt.tab.__treestyletab__open = DragIt.tab.open;
'try {', DragIt.tab.open = function(...aArgs) {
'try { TreeStyleTabService.readyToOpenChildTabNow(gBrowser);' TreeStyleTabService.readyToOpenChildTabNow(gBrowser);
) return this.__treestyletab__open(...aArgs);
); };
} }
// Colorful Tabs // Colorful Tabs