From b62fce0dc0c77a5788c331db32b3996e4020e2a5 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 6 Oct 2017 20:12:54 +0200 Subject: Confirm launch of executables other than .exe on Windows --- browser/components/downloads/DownloadsCommon.jsm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'browser/components') 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 = -- cgit v1.2.3