summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-02 19:05:56 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-02 19:05:56 +0200
commite92808f0ebbeab3ffb79a0b1a4d190f61fb8b43a (patch)
treee5ba54415e62d447a4238aa0000f1ef2e58cfd53 /application
parent4c9914227ed9e675d65ad16e0bb899e8107a0ee5 (diff)
downloadUXP-e92808f0ebbeab3ffb79a0b1a4d190f61fb8b43a.tar
UXP-e92808f0ebbeab3ffb79a0b1a4d190f61fb8b43a.tar.gz
UXP-e92808f0ebbeab3ffb79a0b1a4d190f61fb8b43a.tar.lz
UXP-e92808f0ebbeab3ffb79a0b1a4d190f61fb8b43a.tar.xz
UXP-e92808f0ebbeab3ffb79a0b1a4d190f61fb8b43a.zip
Prevent suppressing executable warnings using the "don't ask me this again" checkbox.
A hidden preference matching the behavior of "browser.download.manager.alertOnEXEOpen" is kept, but is renamed in order to recover cases where the checkbox was used accidentally. While there, simplify the `confirmLaunchExecutable` function by converting from promises to async function. Since Basilisk moved this prompting to toolkit, we also clean up some unused duplicate strings from application/basilisk while we're there. This resolves #581
Diffstat (limited to 'application')
-rw-r--r--application/basilisk/components/downloads/DownloadsCommon.jsm3
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/downloads/downloads.properties4
-rw-r--r--application/palemoon/components/downloads/DownloadsCommon.jsm17
3 files changed, 7 insertions, 17 deletions
diff --git a/application/basilisk/components/downloads/DownloadsCommon.jsm b/application/basilisk/components/downloads/DownloadsCommon.jsm
index 90f14f2d8..69d79dbb5 100644
--- a/application/basilisk/components/downloads/DownloadsCommon.jsm
+++ b/application/basilisk/components/downloads/DownloadsCommon.jsm
@@ -86,8 +86,7 @@ const kDownloadsStringsRequiringFormatting = {
shortTimeLeftHours: true,
shortTimeLeftDays: true,
statusSeparator: true,
- statusSeparatorBeforeNumber: true,
- fileExecutableSecurityWarning: true
+ statusSeparatorBeforeNumber: true
};
const kDownloadsStringsRequiringPluralForm = {
diff --git a/application/basilisk/locales/en-US/chrome/browser/downloads/downloads.properties b/application/basilisk/locales/en-US/chrome/browser/downloads/downloads.properties
index 30885e006..e95b723b5 100644
--- a/application/basilisk/locales/en-US/chrome/browser/downloads/downloads.properties
+++ b/application/basilisk/locales/en-US/chrome/browser/downloads/downloads.properties
@@ -96,10 +96,6 @@ shortTimeLeftDays=%1$Sd
statusSeparator=%1$S \u2014 %2$S
statusSeparatorBeforeNumber=%1$S \u2014 %2$S
-fileExecutableSecurityWarning=“%S” is an executable file. Executable files may contain viruses or other malicious code that could harm your computer. Use caution when opening this file. Are you sure you want to launch “%S”?
-fileExecutableSecurityWarningTitle=Open Executable File?
-fileExecutableSecurityWarningDontAsk=Don’t ask me this again
-
# LOCALIZATION NOTE (otherDownloads2):
# This is displayed in an item at the bottom of the Downloads Panel when
# there are more downloads than can fit in the list in the panel. Use a
diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm
index 156578572..bd5d55a73 100644
--- a/application/palemoon/components/downloads/DownloadsCommon.jsm
+++ b/application/palemoon/components/downloads/DownloadsCommon.jsm
@@ -77,7 +77,7 @@ const nsIDM = Ci.nsIDownloadManager;
const kDownloadsStringBundleUrl =
"chrome://browser/locale/downloads/downloads.properties";
-const kPrefBdmAlertOnExeOpen = "browser.download.manager.alertOnEXEOpen";
+const kPrefConfirmOpenExe = "browser.download.confirmOpenExecutable";
const kDownloadsStringsRequiringFormatting = {
sizeWithUnits: true,
@@ -530,8 +530,10 @@ this.DownloadsCommon = {
if (aFile.isExecutable() && !isWindowsExe) {
let showAlert = true;
try {
- showAlert = Services.prefs.getBoolPref(kPrefBdmAlertOnExeOpen);
- } catch (ex) { }
+ showAlert = Services.prefs.getBoolPref(kPrefConfirmOpenExe);
+ } catch (ex) {
+ // If the preference does not exist, continue with the prompt.
+ }
if (showAlert) {
let name = aFile.leafName;
@@ -539,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);
}
}