Reduce use of eval()

This commit is contained in:
YUKI Hiroshi 2016-09-06 15:38:31 +09:00
parent 1f76455f19
commit 8a3d0dc389

View File

@ -164,15 +164,14 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
if ('TabmixContext' in window && if ('TabmixContext' in window &&
typeof TabmixContext.openMultipleLinks == 'function') { typeof TabmixContext.openMultipleLinks == 'function') {
eval('TabmixContext.openMultipleLinks = '+ TabmixContext.__treestyletab__openMultipleLinks = TabmixContext.openMultipleLinks;
TabmixContext.openMultipleLinks.toSource().replace( TabmixContext.openMultipleLinks = function(aCheck, ...aArgs) {
/(TMP_loadTabs\([^\)]+\);)/g, if (!aCheck)
'TreeStyleTabService.readyToOpenChildTab(gBrowser, true); $1 TreeStyleTabService.stopToOpenChildTab(gBrowser);' TreeStyleTabService.readyToOpenChildTabNow(gBrowser, true);
) return this.__treestyletab__openMultipleLinks(aCheck, ...aArgs);
); };
} }
let listener = { let listener = {
handleEvent : function(aEvent) handleEvent : function(aEvent)
{ {