diff options
author | Pale Moon <git-repo@palemoon.org> | 2018-06-30 19:29:36 +0200 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2018-06-30 19:29:36 +0200 |
commit | 93403cdebbfddd404a6e0680eba52ab889ff1d65 (patch) | |
tree | 6ab9cf1c23f213f5ffe7770085a21dbf47ad8e61 /browser | |
parent | 4a7f5bc0b06c6b4c5d3fa505b895bbfc66db12c6 (diff) | |
download | palemoon-gre-93403cdebbfddd404a6e0680eba52ab889ff1d65.tar.gz |
Confirm launch of executables other than .exe on Windows.
Diffstat (limited to 'browser')
-rw-r--r-- | browser/components/downloads/DownloadsCommon.jsm | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/browser/components/downloads/DownloadsCommon.jsm b/browser/components/downloads/DownloadsCommon.jsm index b90baaf9c..4bcdb1857 100644 --- a/browser/components/downloads/DownloadsCommon.jsm +++ b/browser/components/downloads/DownloadsCommon.jsm @@ -77,7 +77,6 @@ const nsIDM = Ci.nsIDownloadManager; const kDownloadsStringBundleUrl = "chrome://browser/locale/downloads/downloads.properties"; -const kPrefBdmScanWhenDone = "browser.download.manager.scanWhenDone"; const kPrefBdmAlertOnExeOpen = "browser.download.manager.alertOnEXEOpen"; const kDownloadsStringsRequiringFormatting = { @@ -518,22 +517,22 @@ this.DownloadsCommon = { if (!(aOwnerWindow instanceof Ci.nsIDOMWindow)) throw new Error("aOwnerWindow must be a dom-window object"); +#ifdef XP_WIN + // On Windows, the system will provide a native confirmation prompt + // for .exe files. Exclude this from our prompt, but prompt on other + // executable types. + let isWindowsExe = aFile.leafName.toLowerCase().endsWith(".exe"); +#else + let isWindowsExe = false; +#endif + // Confirm opening executable files if required. - if (aFile.isExecutable()) { + if (aFile.isExecutable() && !isWindowsExe) { let showAlert = true; try { showAlert = Services.prefs.getBoolPref(kPrefBdmAlertOnExeOpen); } catch (ex) { } - // On Vista and above, we rely on native security prompting for - // downloaded content unless it's disabled. - if (DownloadsCommon.isWinVistaOrHigher) { - try { - if (Services.prefs.getBoolPref(kPrefBdmScanWhenDone)) { - showAlert = false; - } - } catch (ex) { } - } if (showAlert) { let name = aFile.leafName; |