From 9b5570006cf0e2f55502a4dcd71375d9d39632c2 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 30 Aug 2016 17:16:57 +0900 Subject: [PATCH] Don't touch to CPOW objects --- content/treestyletab/windowHelper.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index b75cbe67..cba95d0b 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -190,25 +190,25 @@ var TreeStyleTabWindowHelper = { nsContextMenu.prototype.__treestyletab__openLinkInTab = nsContextMenu.prototype.openLinkInTab; nsContextMenu.prototype.openLinkInTab = function(...aArgs) { - TreeStyleTabService.handleNewTabFromCurrent(this.target.ownerDocument.defaultView); + TreeStyleTabService.handleNewTabFromCurrent(gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__openLinkInTab.call(this, ...aArgs); }; nsContextMenu.prototype.__treestyletab__openFrameInTab = nsContextMenu.prototype.openFrameInTab; nsContextMenu.prototype.openFrameInTab = function(...aArgs) { - TreeStyleTabService.handleNewTabFromCurrent(this.target.ownerDocument.defaultView); + TreeStyleTabService.handleNewTabFromCurrent(gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__openFrameInTab.call(this, ...aArgs); }; nsContextMenu.prototype.__treestyletab__viewMedia = nsContextMenu.prototype.viewMedia; nsContextMenu.prototype.viewMedia = function(aEvent) { - TreeStyleTabService.onBeforeViewMedia(aEvent, this.target.ownerDocument.defaultView); + TreeStyleTabService.onBeforeViewMedia(aEvent, gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__viewMedia.call(this, aEvent); }; nsContextMenu.prototype.__treestyletab__viewBGImage = nsContextMenu.prototype.viewBGImage; nsContextMenu.prototype.viewBGImage = function(aEvent) { - TreeStyleTabService.onBeforeViewMedia(aEvent, this.target.ownerDocument.defaultView); + TreeStyleTabService.onBeforeViewMedia(aEvent, gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__viewBGImage.call(this, aEvent); }; @@ -216,19 +216,19 @@ var TreeStyleTabWindowHelper = { nsContextMenu.prototype.addDictionaries = function(...aArgs) { var newWindowPref = TreeStyleTabUtils.prefs.getPref('browser.link.open_newwindow'); var where = newWindowPref === 3 ? 'tab' : 'window' ; - TreeStyleTabService.onBeforeOpenLink(where, this.target.ownerDocument.defaultView); + TreeStyleTabService.onBeforeOpenLink(where, gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__addDictionaries.call(this, ...aArgs); }; nsContextMenu.prototype.__treestyletab__viewPartialSource = nsContextMenu.prototype.viewPartialSource; nsContextMenu.prototype.viewPartialSource = function(...aArgs) { - TreeStyleTabService.handleNewTabFromCurrent(this.target.ownerDocument.defaultView); + TreeStyleTabService.handleNewTabFromCurrent(gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__viewPartialSource.call(this, ...aArgs); }; nsContextMenu.prototype.__treestyletab__viewFrameSource = nsContextMenu.prototype.viewFrameSource; nsContextMenu.prototype.viewFrameSource = function(...aArgs) { - TreeStyleTabService.handleNewTabFromCurrent(this.target.ownerDocument.defaultView); + TreeStyleTabService.handleNewTabFromCurrent(gBrowser.selectedTab); return nsContextMenu.prototype.__treestyletab__viewFrameSource.call(this, ...aArgs); };