diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-30 19:43:44 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-30 19:43:44 +0200 |
commit | 5054d5a119813a55bf02e341867dd39d0dc38c3d (patch) | |
tree | 8e789d179b2aedd4262cc474e76b7d1e2c671a6a /application/palemoon/components/downloads/DownloadsCommon.jsm | |
parent | 3858dd6de2f4d510b42ca8675235469b8b78ed02 (diff) | |
download | UXP-5054d5a119813a55bf02e341867dd39d0dc38c3d.tar UXP-5054d5a119813a55bf02e341867dd39d0dc38c3d.tar.gz UXP-5054d5a119813a55bf02e341867dd39d0dc38c3d.tar.lz UXP-5054d5a119813a55bf02e341867dd39d0dc38c3d.tar.xz UXP-5054d5a119813a55bf02e341867dd39d0dc38c3d.zip |
Confirm launch of executables other than .exe on Windows.
Diffstat (limited to 'application/palemoon/components/downloads/DownloadsCommon.jsm')
-rw-r--r-- | application/palemoon/components/downloads/DownloadsCommon.jsm | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm index c6614e780..156578572 100644 --- a/application/palemoon/components/downloads/DownloadsCommon.jsm +++ b/application/palemoon/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,23 +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; let message = |