Reduce use of eval()

This commit is contained in:
YUKI Hiroshi 2016-09-05 16:32:28 +09:00
parent 7b820848f8
commit f9b1508e9c

View File

@ -571,13 +571,13 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
// https://addons.mozilla.org/firefox/addon/instaclick/
if ('instaclick' in window &&
'contentAreaClick2' in window.instaclick &&
TreeStyleTabUtils.getTreePref('compatibility.InstaClick')) {
eval('instaclick.contentAreaClick2 = '+
instaclick.contentAreaClick2.toSource().replace(
'gBrowser.loadOneTab(',
'TreeStyleTabService.readyToOpenChildTab(); $&'
)
);
TreeStyleTabUtils.getTreePref('compatibility.InstaClick') &&
!instaclick.__treestyletab__contentAreaClick2) {
instaclick.__treestyletab__contentAreaClick2 = instaclick.contentAreaClick2;
instaclick.contentAreaClick2 = function(...aArgs) {
TreeStyleTabService.readyToOpenChildTabNow();
return this.__treestyletab__contentAreaClick2(...aArgs);
};
}
// Duplicate This Tab