summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/lib/DownloadsManager.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/newtab/lib/DownloadsManager.sys.mjs')
-rw-r--r--browser/components/newtab/lib/DownloadsManager.sys.mjs8
1 files changed, 4 insertions, 4 deletions
diff --git a/browser/components/newtab/lib/DownloadsManager.sys.mjs b/browser/components/newtab/lib/DownloadsManager.sys.mjs
index f6e99e462a..3646ebc73a 100644
--- a/browser/components/newtab/lib/DownloadsManager.sys.mjs
+++ b/browser/components/newtab/lib/DownloadsManager.sys.mjs
@@ -7,6 +7,7 @@ import { actionTypes as at } from "resource://activity-stream/common/Actions.mjs
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
+ BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs",
DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs",
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
@@ -166,10 +167,8 @@ export class DownloadsManager {
);
});
break;
- case at.OPEN_DOWNLOAD_FILE:
- const win = action._target.browser.ownerGlobal;
- const openWhere =
- action.data.event && win.whereToOpenLink(action.data.event);
+ case at.OPEN_DOWNLOAD_FILE: {
+ const openWhere = lazy.BrowserUtils.whereToOpenLink(action.data.event);
doDownloadAction(download => {
lazy.DownloadsCommon.openDownload(download, {
// Replace "current" or unknown value with "tab" as the default behavior
@@ -180,6 +179,7 @@ export class DownloadsManager {
});
});
break;
+ }
case at.UNINIT:
this.uninit();
break;