summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/downloads/DownloadsCommon.jsm
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /application/palemoon/components/downloads/DownloadsCommon.jsm
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-2018.07.18.tar
UXP-2018.07.18.tar.gz
UXP-2018.07.18.tar.lz
UXP-2018.07.18.tar.xz
UXP-2018.07.18.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'application/palemoon/components/downloads/DownloadsCommon.jsm')
-rw-r--r--application/palemoon/components/downloads/DownloadsCommon.jsm37
1 files changed, 15 insertions, 22 deletions
diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm
index c6614e780..bd5d55a73 100644
--- a/application/palemoon/components/downloads/DownloadsCommon.jsm
+++ b/application/palemoon/components/downloads/DownloadsCommon.jsm
@@ -77,8 +77,7 @@ 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 kPrefConfirmOpenExe = "browser.download.confirmOpenExecutable";
const kDownloadsStringsRequiringFormatting = {
sizeWithUnits: true,
@@ -518,21 +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) { }
+ showAlert = Services.prefs.getBoolPref(kPrefConfirmOpenExe);
+ } catch (ex) {
+ // If the preference does not exist, continue with the prompt.
}
if (showAlert) {
@@ -541,18 +541,11 @@ this.DownloadsCommon = {
DownloadsCommon.strings.fileExecutableSecurityWarning(name, name);
let title =
DownloadsCommon.strings.fileExecutableSecurityWarningTitle;
- let dontAsk =
- DownloadsCommon.strings.fileExecutableSecurityWarningDontAsk;
- let checkbox = { value: false };
- let open = Services.prompt.confirmCheck(aOwnerWindow, title, message,
- dontAsk, checkbox);
+ let open = Services.prompt.confirm(aOwnerWindow, title, message);
if (!open) {
return;
}
-
- Services.prefs.setBoolPref(kPrefBdmAlertOnExeOpen,
- !checkbox.value);
}
}