summaryrefslogtreecommitdiffstats
path: root/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-06-10 20:46:30 +0200
committerGitHub <noreply@github.com>2018-06-10 20:46:30 +0200
commit27783db85a4d3c38b041e51b088ed2dbd35e96c1 (patch)
treebdecff2c72ae61e598585a2821a53c523fc89a4a /application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js
parent25f9c54aded0f514e6be7eb3105fcdb214431a59 (diff)
parent7128f0d21de4d03be75133fbbd698f996fcd2a50 (diff)
downloadUXP-27783db85a4d3c38b041e51b088ed2dbd35e96c1.tar
UXP-27783db85a4d3c38b041e51b088ed2dbd35e96c1.tar.gz
UXP-27783db85a4d3c38b041e51b088ed2dbd35e96c1.tar.lz
UXP-27783db85a4d3c38b041e51b088ed2dbd35e96c1.tar.xz
UXP-27783db85a4d3c38b041e51b088ed2dbd35e96c1.zip
Merge pull request #469 from JustOff/PR_SB_DoNotTrack
[BASILISK] Remove tracking protection controls from the UI if safebrowsing isn't built
Diffstat (limited to 'application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js')
-rw-r--r--application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js
index 4434f7b6a..00184102a 100644
--- a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js
+++ b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.js
@@ -14,6 +14,7 @@ const FAVICON_PRIVACY = "chrome://browser/skin/privatebrowsing/favicon.svg";
var stringBundle = Services.strings.createBundle(
"chrome://browser/locale/aboutPrivateBrowsing.properties");
+#ifdef MOZ_SAFE_BROWSING
var prefBranch = Services.prefs.getBranch("privacy.trackingprotection.");
var prefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
@@ -37,6 +38,7 @@ var prefObserver = {
};
prefBranch.addObserver("pbmode.enabled", prefObserver, true);
prefBranch.addObserver("enabled", prefObserver, true);
+#endif
function setFavIcon(url) {
document.getElementById("favicon").setAttribute("href", url);
@@ -54,23 +56,29 @@ document.addEventListener("DOMContentLoaded", function () {
return;
}
+#ifdef MOZ_SAFE_BROWSING
let tpToggle = document.getElementById("tpToggle");
document.getElementById("tpButton").addEventListener('click', () => {
tpToggle.click();
});
+#endif
document.title = stringBundle.GetStringFromName("title.head");
document.getElementById("favicon")
.setAttribute("href", FAVICON_PRIVACY);
+#ifdef MOZ_SAFE_BROWSING
tpToggle.addEventListener("change", toggleTrackingProtection);
+#endif
let formatURLPref = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Ci.nsIURLFormatter).formatURLPref;
document.getElementById("learnMore").setAttribute("href",
formatURLPref("app.support.baseURL") + "private-browsing");
+#ifdef MOZ_SAFE_BROWSING
// Update state that depends on preferences.
prefObserver.observe();
+#endif
}, false);
function openPrivateWindow() {
@@ -79,9 +87,11 @@ function openPrivateWindow() {
new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles:true}));
}
+#ifdef MOZ_SAFE_BROWSING
function toggleTrackingProtection() {
// Ask chrome to enable tracking protection
document.dispatchEvent(
new CustomEvent("AboutPrivateBrowsingToggleTrackingProtection",
{bubbles: true}));
}
+#endif