summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-20 09:41:21 -0400
committerGitHub <noreply@github.com>2018-04-20 09:41:21 -0400
commitafd3284e3b17b8d93a26aeca968d9120efbbcd2b (patch)
tree1cf88c06021d4ead55d83a1b54b82e81582b4b37
parent7755d6a33754865b78df3985b20c17579e4e2008 (diff)
parentbd351034ff9ecd9a3926f7c9320dcc914f6e2091 (diff)
downloaduxp-afd3284e3b17b8d93a26aeca968d9120efbbcd2b.tar.gz
Merge pull request #215 from janekptacijarabaci/pm_zone-information_1
[PALEMOON] Reimplemented "Time Zone Information"
-rw-r--r--application/palemoon/app/profile/palemoon.js8
-rw-r--r--toolkit/components/jsdownloads/src/DownloadIntegration.jsm32
2 files changed, 40 insertions, 0 deletions
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js
index ee4a95d381..453be9c996 100644
--- a/application/palemoon/app/profile/palemoon.js
+++ b/application/palemoon/app/profile/palemoon.js
@@ -80,6 +80,14 @@ pref("browser.slowstartup.help.url", "http://www.palemoon.org/support/slowstartu
// on a network error page (e.g. cert error)
pref("browser.escape_to_blank", false);
+#ifdef XP_WIN
+// Save internet zone information on downloaded files:
+// 0 => Never
+// 1 => Always
+// 2 => Use system setting
+pref("browser.download.saveZoneInformation", 2);
+#endif
+
// The minimum delay in seconds for the timer to fire.
// default=2 minutes
pref("app.update.timerMinimumDelay", 120);
diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
index 1c30599f5a..38b89ae8e8 100644
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -530,6 +530,37 @@ this.DownloadIntegration = {
* @return true if files should be marked
*/
_shouldSaveZoneInformation() {
+#ifdef MC_PALEMOON
+ let zonePref = 2;
+ try {
+ zonePref = Services.prefs.getIntPref("browser.download.saveZoneInformation");
+ } catch (ex) {}
+
+ switch (zonePref) {
+ case 0: // Never
+ return false;
+ case 1: // Always
+ return true;
+ case 2: // System-defined
+ let key = Cc["@mozilla.org/windows-registry-key;1"]
+ .createInstance(Ci.nsIWindowsRegKey);
+ try {
+ key.open(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Attachments",
+ Ci.nsIWindowsRegKey.ACCESS_QUERY_VALUE);
+ try {
+ return key.readIntValue("SaveZoneInformation") != 1;
+ } finally {
+ key.close();
+ }
+ } catch (ex) {
+ // If the key is not present, files should be marked by default.
+ return true;
+ }
+ default: // Invalid pref value defaults marking files.
+ return true;
+ }
+#else
let key = Cc["@mozilla.org/windows-registry-key;1"]
.createInstance(Ci.nsIWindowsRegKey);
try {
@@ -545,6 +576,7 @@ this.DownloadIntegration = {
// If the key is not present, files should be marked by default.
return true;
}
+#endif
},
#endif