diff options
author | JustOff <Off.Just.Off@gmail.com> | 2018-06-10 19:01:51 +0300 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2018-06-10 19:01:51 +0300 |
commit | 15ae6f885bf53886d13983856f2f958f121ae691 (patch) | |
tree | d75c62ca15c05e8ec643403d298145d9a970181d /application/basilisk | |
parent | 6a9562e5a58716fda5676eb8f7c5d48d9a3b3fd1 (diff) | |
download | UXP-15ae6f885bf53886d13983856f2f958f121ae691.tar UXP-15ae6f885bf53886d13983856f2f958f121ae691.tar.gz UXP-15ae6f885bf53886d13983856f2f958f121ae691.tar.lz UXP-15ae6f885bf53886d13983856f2f958f121ae691.tar.xz UXP-15ae6f885bf53886d13983856f2f958f121ae691.zip |
[BASILISK] Remove tracking protection controls from aboutPrivateBrowsing if safebrowsing isn't built
Diffstat (limited to 'application/basilisk')
3 files changed, 14 insertions, 2 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 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 @@ </p> </section> +#ifdef MOZ_SAFE_BROWSING <h2 id="tpSubHeader" class="about-subheader"> <span class="tpTitle">&trackingProtection.title;</span> <input id="tpToggle" class="toggle toggle-input" type="checkbox"/> <span id="tpButton" class="toggle-btn"></span> </h2> +#endif <section class="section-main"> <p>&trackingProtection.description2;</p> 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) |