Reduce use of eval()

This commit is contained in:
YUKI Hiroshi 2016-09-05 16:52:40 +09:00
parent 96716bd5cf
commit 488116670b

View File

@ -602,13 +602,13 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
// https://addons.mozilla.org/firefox/addon/context-search/ // https://addons.mozilla.org/firefox/addon/context-search/
if ('contextsearch' in window && if ('contextsearch' in window &&
'search' in window.contextsearch && 'search' in window.contextsearch &&
TreeStyleTabUtils.getTreePref('compatibility.ContextSearch')) { TreeStyleTabUtils.getTreePref('compatibility.ContextSearch') &&
eval('contextsearch.search = '+ !contextsearch.__treestyletab__search) {
contextsearch.search.toSource().replace( contextsearch.__treestyletab__search = contextsearch.search;
'var newTab = ', contextsearch.search = function(...aArgs) {
'TreeStyleTabService.readyToOpenChildTab(); $&' TreeStyleTabService.readyToOpenChildTabNow();
) return this.__treestyletab__search(...aArgs);
); };
} }
// Tile Tabs // Tile Tabs