From 6a9562e5a58716fda5676eb8f7c5d48d9a3b3fd1 Mon Sep 17 00:00:00 2001
From: JustOff
Date: Sun, 10 Jun 2018 15:56:51 +0300
Subject: [BASILISK] Remove tracking protection controls from the UI if
safebrowsing isn't built
---
.../components/preferences/in-content/jar.mn | 2 +-
.../components/preferences/in-content/privacy.js | 14 ++++++++++++++
.../components/preferences/in-content/privacy.xul | 21 +++++++++++++++++++++
application/basilisk/components/preferences/jar.mn | 4 ++++
.../en-US/chrome/browser/preferences/privacy.dtd | 8 +++++++-
application/basilisk/locales/jar.mn | 6 +++++-
6 files changed, 52 insertions(+), 3 deletions(-)
(limited to 'application/basilisk')
diff --git a/application/basilisk/components/preferences/in-content/jar.mn b/application/basilisk/components/preferences/in-content/jar.mn
index 130bf8549..e61a88856 100644
--- a/application/basilisk/components/preferences/in-content/jar.mn
+++ b/application/basilisk/components/preferences/in-content/jar.mn
@@ -8,7 +8,7 @@ browser.jar:
content/browser/preferences/in-content/subdialogs.js
content/browser/preferences/in-content/main.js
- content/browser/preferences/in-content/privacy.js
+* content/browser/preferences/in-content/privacy.js
content/browser/preferences/in-content/containers.js
content/browser/preferences/in-content/advanced.js
content/browser/preferences/in-content/applications.js
diff --git a/application/basilisk/components/preferences/in-content/privacy.js b/application/basilisk/components/preferences/in-content/privacy.js
index 7dfc7de5a..fced02fe6 100644
--- a/application/basilisk/components/preferences/in-content/privacy.js
+++ b/application/basilisk/components/preferences/in-content/privacy.js
@@ -22,6 +22,7 @@ var gPrivacyPane = {
*/
_shouldPromptForRestart: true,
+#ifdef MOZ_SAFEBROWSING
/**
* Show the Tracking Protection UI depending on the
* privacy.trackingprotection.ui.enabled pref, and linkify its Learn More link
@@ -50,6 +51,7 @@ var gPrivacyPane = {
let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection-pbm";
link.setAttribute("href", url);
},
+#endif
/**
* Initialize autocomplete to ensure prefs are in sync.
@@ -129,8 +131,10 @@ var gPrivacyPane = {
this.updateHistoryModePane();
this.updatePrivacyMicroControls();
this.initAutoStartPrivateBrowsingReverter();
+#ifdef MOZ_SAFEBROWSING
this._initTrackingProtection();
this._initTrackingProtectionPBM();
+#endif
this._initAutocomplete();
this._initBrowserContainers();
@@ -156,10 +160,12 @@ var gPrivacyPane = {
gPrivacyPane.clearPrivateDataNow(true);
return false;
});
+#ifdef MOZ_SAFEBROWSING
setEventListener("doNotTrackSettings", "click", function () {
gPrivacyPane.showDoNotTrackSettings();
return false;
});
+#endif
setEventListener("privateBrowsingAutoStart", "command",
gPrivacyPane.updateAutostart);
setEventListener("cookieExceptions", "command",
@@ -168,6 +174,7 @@ var gPrivacyPane = {
gPrivacyPane.showCookies);
setEventListener("clearDataSettings", "command",
gPrivacyPane.showClearPrivateDataSettings);
+#ifdef MOZ_SAFEBROWSING
setEventListener("trackingProtectionRadioGroup", "command",
gPrivacyPane.trackingProtectionWritePrefs);
setEventListener("trackingProtectionExceptions", "command",
@@ -176,12 +183,14 @@ var gPrivacyPane = {
gPrivacyPane.showBlockLists);
setEventListener("changeBlockListPBM", "command",
gPrivacyPane.showBlockLists);
+#endif
setEventListener("browserContainersCheckbox", "command",
gPrivacyPane._checkBrowserContainers);
setEventListener("browserContainersSettings", "command",
gPrivacyPane.showContainerSettings);
},
+#ifdef MOZ_SAFEBROWSING
// TRACKING PROTECTION MODE
/**
@@ -225,6 +234,7 @@ var gPrivacyPane = {
break;
}
},
+#endif
// HISTORY MODE
@@ -462,6 +472,7 @@ var gPrivacyPane = {
this._shouldPromptForRestart = true;
},
+#ifdef MOZ_SAFEBROWSING
/**
* Displays fine-grained, per-site preferences for tracking protection.
*/
@@ -476,6 +487,7 @@ var gPrivacyPane = {
gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
null, params);
},
+#endif
/**
* Displays container panel for customising and adding containers.
@@ -484,6 +496,7 @@ var gPrivacyPane = {
gotoPref("containers");
},
+#ifdef MOZ_SAFEBROWSING
/**
* Displays the available block lists for tracking protection.
*/
@@ -506,6 +519,7 @@ var gPrivacyPane = {
gSubDialog.open("chrome://browser/content/preferences/donottrack.xul",
"resizable=no");
},
+#endif
// HISTORY
diff --git a/application/basilisk/components/preferences/in-content/privacy.xul b/application/basilisk/components/preferences/in-content/privacy.xul
index 6ac6c88a4..8881a84fe 100644
--- a/application/basilisk/components/preferences/in-content/privacy.xul
+++ b/application/basilisk/components/preferences/in-content/privacy.xul
@@ -10,12 +10,18 @@
+#ifdef MOZ_SAFEBROWSING
+#else
+
+#endif
+#ifdef MOZ_SAFEBROWSING
@@ -138,6 +145,20 @@
class="text-link" id="doNotTrackSettings"
>&doNotTrack.settings.label;&doNotTrack.post.label;
+#else
+
+
+
+
+
+
+
+#endif
diff --git a/application/basilisk/components/preferences/jar.mn b/application/basilisk/components/preferences/jar.mn
index c0d34da7f..b25fc89b8 100644
--- a/application/basilisk/components/preferences/jar.mn
+++ b/application/basilisk/components/preferences/jar.mn
@@ -5,14 +5,18 @@
browser.jar:
content/browser/preferences/applicationManager.xul
content/browser/preferences/applicationManager.js
+#ifdef MOZ_SAFEBROWSING
content/browser/preferences/blocklists.xul
content/browser/preferences/blocklists.js
+#endif
* content/browser/preferences/colors.xul
* content/browser/preferences/cookies.xul
content/browser/preferences/cookies.js
* content/browser/preferences/connection.xul
content/browser/preferences/connection.js
+#ifdef MOZ_SAFEBROWSING
content/browser/preferences/donottrack.xul
+#endif
* content/browser/preferences/fonts.xul
content/browser/preferences/fonts.js
content/browser/preferences/handlers.xml
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
index 4c38c111a..e6a7955fb 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -2,6 +2,8 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+#ifdef MOZ_SAFE_BROWSING
@@ -13,7 +15,6 @@
-
@@ -25,6 +26,11 @@
+#else
+
+
+
+#endif
diff --git a/application/basilisk/locales/jar.mn b/application/basilisk/locales/jar.mn
index 31cbd9ccf..9a847c7ed 100644
--- a/application/basilisk/locales/jar.mn
+++ b/application/basilisk/locales/jar.mn
@@ -64,12 +64,16 @@
locale/browser/preferences/advanced.dtd (%chrome/browser/preferences/advanced.dtd)
locale/browser/preferences/applicationManager.dtd (%chrome/browser/preferences/applicationManager.dtd)
locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties)
+#ifdef MOZ_SAFE_BROWSING
locale/browser/preferences/blocklists.dtd (%chrome/browser/preferences/blocklists.dtd)
+#endif
locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd)
locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd)
locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd)
locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd)
+#ifdef MOZ_SAFE_BROWSING
locale/browser/preferences/donottrack.dtd (%chrome/browser/preferences/donottrack.dtd)
+#endif
locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd)
locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd)
locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd)
@@ -78,7 +82,7 @@
locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd)
locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
locale/browser/preferences/containers.properties (%chrome/browser/preferences/containers.properties)
- locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd)
+* locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd)
locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd)
locale/browser/preferences/containers.dtd (%chrome/browser/preferences/containers.dtd)
locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd)
--
cgit v1.2.3
From 15ae6f885bf53886d13983856f2f958f121ae691 Mon Sep 17 00:00:00 2001
From: JustOff
Date: Sun, 10 Jun 2018 19:01:51 +0300
Subject: [BASILISK] Remove tracking protection controls from
aboutPrivateBrowsing if safebrowsing isn't built
---
.../components/privatebrowsing/content/aboutPrivateBrowsing.js | 10 ++++++++++
.../privatebrowsing/content/aboutPrivateBrowsing.xhtml | 2 ++
application/basilisk/components/privatebrowsing/jar.mn | 4 ++--
3 files changed, 14 insertions(+), 2 deletions(-)
(limited to 'application/basilisk')
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
diff --git a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
index 36058efa5..8c75bfbb9 100644
--- a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -61,11 +61,13 @@
+#ifdef MOZ_SAFE_BROWSING
+#endif
&trackingProtection.description2;
diff --git a/application/basilisk/components/privatebrowsing/jar.mn b/application/basilisk/components/privatebrowsing/jar.mn
index a98d65163..0147bb039 100644
--- a/application/basilisk/components/privatebrowsing/jar.mn
+++ b/application/basilisk/components/privatebrowsing/jar.mn
@@ -4,5 +4,5 @@
browser.jar:
content/browser/aboutPrivateBrowsing.css (content/aboutPrivateBrowsing.css)
- content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml)
- content/browser/aboutPrivateBrowsing.js (content/aboutPrivateBrowsing.js)
+* content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml)
+* content/browser/aboutPrivateBrowsing.js (content/aboutPrivateBrowsing.js)
--
cgit v1.2.3
From 66077e6cfc47452f98338762f7ad17f0b5f1ff5e Mon Sep 17 00:00:00 2001
From: JustOff
Date: Sun, 10 Jun 2018 19:08:18 +0300
Subject: [BASILISK] Hide tracking protection description from
aboutPrivateBrowsing if safebrowsing isn't built
---
.../components/privatebrowsing/content/aboutPrivateBrowsing.xhtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'application/basilisk')
diff --git a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
index 8c75bfbb9..1db0f574c 100644
--- a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -67,11 +67,11 @@
-#endif
&trackingProtection.description2;
+#endif
&aboutPrivateBrowsing.learnMore2;
--
cgit v1.2.3
From 7128f0d21de4d03be75133fbbd698f996fcd2a50 Mon Sep 17 00:00:00 2001
From: JustOff
Date: Sun, 10 Jun 2018 19:17:16 +0300
Subject: [BASILISK] Hide tracking protection title from aboutPrivateBrowsing
if safebrowsing isn't built
---
.../components/privatebrowsing/content/aboutPrivateBrowsing.xhtml | 2 ++
1 file changed, 2 insertions(+)
(limited to 'application/basilisk')
diff --git a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
index 1db0f574c..c27de6994 100644
--- a/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/application/basilisk/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -35,7 +35,9 @@
&privateBrowsing.title;
+#ifdef MOZ_SAFE_BROWSING
&privateBrowsing.title.tracking;
+#endif
&aboutPrivateBrowsing.info.notsaved.before;&aboutPrivateBrowsing.info.notsaved.emphasize;&aboutPrivateBrowsing.info.notsaved.after;
--
cgit v1.2.3