summaryrefslogtreecommitdiffstats
path: root/browser
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-10-06 20:12:54 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-08 11:58:23 +0100
commitb62fce0dc0c77a5788c331db32b3996e4020e2a5 (patch)
tree8cb1a4758b16d9caae55f525b73f5fca3824b4f7 /browser
parentbfa65f5d5f4fc1a1330acc91945d0587ddf65104 (diff)
downloadUXP-b62fce0dc0c77a5788c331db32b3996e4020e2a5.tar
UXP-b62fce0dc0c77a5788c331db32b3996e4020e2a5.tar.gz
UXP-b62fce0dc0c77a5788c331db32b3996e4020e2a5.tar.lz
UXP-b62fce0dc0c77a5788c331db32b3996e4020e2a5.tar.xz
UXP-b62fce0dc0c77a5788c331db32b3996e4020e2a5.zip
Confirm launch of executables other than .exe on Windows
Diffstat (limited to 'browser')
-rw-r--r--browser/components/downloads/DownloadsCommon.jsm8
1 files changed, 7 insertions, 1 deletions
diff --git a/browser/components/downloads/DownloadsCommon.jsm b/browser/components/downloads/DownloadsCommon.jsm
index b6684817d..90f14f2d8 100644
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -42,6 +42,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
+ "resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
"resource://gre/modules/Downloads.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DownloadUIHelper",
@@ -460,8 +462,12 @@ this.DownloadsCommon = {
throw new Error("aOwnerWindow must be a dom-window object");
}
+ let isWindowsExe = AppConstants.platform == "win" &&
+ aFile.leafName.toLowerCase().endsWith(".exe");
+
let promiseShouldLaunch;
- if (aFile.isExecutable()) {
+ // Don't prompt on Windows for .exe since there will be a native prompt.
+ if (aFile.isExecutable() && !isWindowsExe) {
// We get a prompter for the provided window here, even though anchoring
// to the most recently active window should work as well.
promiseShouldLaunch =