Update hack for Duplicate This Tab

This commit is contained in:
YUKI Hiroshi 2016-09-05 16:44:05 +09:00
parent f9b1508e9c
commit e1a89d1095

View File

@ -584,13 +584,18 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
// https://addons.mozilla.org/firefox/addon/duplicate-this-tab/
if ('duplicatethistab' in window &&
'openLinkWithHistory' in window.duplicatethistab &&
TreeStyleTabUtils.getTreePref('compatibility.DuplicateThisTab')) {
eval('duplicatethistab.openLinkWithHistory = '+
duplicatethistab.openLinkWithHistory.toSource().replace(
'var newTab = ',
'TreeStyleTabService.readyToOpenChildTab(); $&'
)
);
TreeStyleTabUtils.getTreePref('compatibility.DuplicateThisTab') &&
!duplicatethistab.__treestyletab__openLinkWithHistory) {
duplicatethistab.__treestyletab__openLinkWithHistory = duplicatethistab.openLinkWithHistory;
duplicatethistab.openLinkWithHistory = function(...aArgs) {
TreeStyleTabService.readyToOpenChildTabNow();
return this.__treestyletab__openLinkWithHistory(...aArgs);
};
duplicatethistab.__treestyletab__duplicateInTab = duplicatethistab.duplicateInTab;
duplicatethistab.duplicateInTab = function(...aArgs) {
TreeStyleTabService.readyToOpenChildTabNow();
return this.__treestyletab__duplicateInTab(...aArgs);
};
}
// Context Search