diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-20 09:41:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 09:41:21 -0400 |
commit | 954b1888d2da049878b36034ca7d7f1f1dce6538 (patch) | |
tree | 1cf88c06021d4ead55d83a1b54b82e81582b4b37 /toolkit/components/jsdownloads/src/DownloadIntegration.jsm | |
parent | 8b0c6d3857197102fd53f3691c4c69ba80b1a2eb (diff) | |
parent | cd05a3a783409c360331f1649b6b066138159844 (diff) | |
download | UXP-954b1888d2da049878b36034ca7d7f1f1dce6538.tar UXP-954b1888d2da049878b36034ca7d7f1f1dce6538.tar.gz UXP-954b1888d2da049878b36034ca7d7f1f1dce6538.tar.lz UXP-954b1888d2da049878b36034ca7d7f1f1dce6538.tar.xz UXP-954b1888d2da049878b36034ca7d7f1f1dce6538.zip |
Merge pull request #215 from janekptacijarabaci/pm_zone-information_1
[PALEMOON] Reimplemented "Time Zone Information"
Diffstat (limited to 'toolkit/components/jsdownloads/src/DownloadIntegration.jsm')
-rw-r--r-- | toolkit/components/jsdownloads/src/DownloadIntegration.jsm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 1c30599f5..38b89ae8e 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 |