This simply removes the content blocking section when TP is not enabled to avoid overpromising. We may update this UI to alert the user that TP is off after the UX team comes back with a new design. Differential Revision: https://phabricator.services.mozilla.com/D10071
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* 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/. */
|
|
|
|
/* eslint-env mozilla/frame-script */
|
|
|
|
const TP_PB_ENABLED_PREF = "privacy.trackingprotection.pbmode.enabled";
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
if (!RPMIsWindowPrivate()) {
|
|
document.documentElement.classList.remove("private");
|
|
document.documentElement.classList.add("normal");
|
|
document.getElementById("startPrivateBrowsing").addEventListener("click", function() {
|
|
RPMSendAsyncMessage("OpenPrivateWindow");
|
|
});
|
|
return;
|
|
}
|
|
|
|
document.getElementById("startTour").addEventListener("click", function() {
|
|
RPMSendAsyncMessage("DontShowIntroPanelAgain");
|
|
});
|
|
|
|
let introURL = RPMGetFormatURLPref("privacy.trackingprotection.introURL");
|
|
// Variation 1 is specific to the Content Blocking UI.
|
|
let variation = "?variation=1";
|
|
|
|
document.getElementById("startTour").setAttribute("href", introURL + variation);
|
|
|
|
document.getElementById("learnMore").setAttribute("href",
|
|
RPMGetFormatURLPref("app.support.baseURL") + "private-browsing");
|
|
|
|
let tpEnabled = RPMGetBoolPref(TP_PB_ENABLED_PREF);
|
|
if (!tpEnabled) {
|
|
document.getElementById("tpSubHeader").remove();
|
|
document.getElementById("tpSection").remove();
|
|
}
|
|
});
|