Bug 1462470 - Part 3 - Show a "reload this page" warning in the control center when trackers are loaded while TP is on. r=Paolo

Part 2 exposed an edge case that would allow the user to have TP enabled but
still have tracking content on a page, bringing our UI into a confused state.

This adds a new element that shows when TP is enabled and no exception is set,
but tracking content is still loaded, and recommends reloading the page.

MozReview-Commit-ID: EYy6xVCjNts

--HG--
extra : rebase_source : 616fe197e8c994448c4eb5f9dfeafd260c2ce084
This commit is contained in:
Johann Hofmann 2018-05-24 13:14:16 +02:00
Родитель 7895ec735b
Коммит 3637b98ab3
4 изменённых файлов: 20 добавлений и 8 удалений

Просмотреть файл

@ -74,6 +74,11 @@ var TrackingProtection = {
}
},
hideIdentityPopupAndReload() {
document.getElementById("identity-popup").hidePopup();
BrowserReload();
},
openPreferences(origin) {
openPreferences("privacy-trackingprotection", { origin });
},
@ -215,10 +220,7 @@ var TrackingProtection = {
// Telemetry for disable protection.
this.eventsHistogramAdd(1);
// Hide the control center.
document.getElementById("identity-popup").hidePopup();
BrowserReload();
this.hideIdentityPopupAndReload();
},
enableForCurrentPage() {
@ -244,10 +246,7 @@ var TrackingProtection = {
// Telemetry for enable protection.
this.eventsHistogramAdd(2);
// Hide the control center.
document.getElementById("identity-popup").hidePopup();
BrowserReload();
this.hideIdentityPopupAndReload();
},
dontShowIntroPanelAgain() {

Просмотреть файл

@ -72,7 +72,14 @@
crop="end">&trackingProtection.detectedNotBlocked4;</description>
<description id="tracking-not-detected"
crop="end">&trackingProtection.notDetected4;</description>
<description id="tracking-reload-required"
crop="end">&trackingProtection.reloadRequired;</description>
<button id="tracking-action-reload"
class="tracking-protection-button"
label="&trackingProtection.reload.label;"
accesskey="&trackingProtection.reload.accesskey;"
oncommand="TrackingProtection.hideIdentityPopupAndReload();" />
<button id="tracking-action-unblock"
class="tracking-protection-button"
label="&trackingProtection.unblock2.label;"

Просмотреть файл

@ -906,6 +906,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY trackingProtection.detectedBlocked3 "&brandShortName; is blocking parts of the page that may track your browsing.">
<!ENTITY trackingProtection.detectedNotBlocked4 "Trackers have been detected on this webpage.">
<!ENTITY trackingProtection.notDetected4 "No trackers detected on this page.">
<!ENTITY trackingProtection.reloadRequired "You have enabled Tracking Protection. To block all trackers please reload the current webpage.">
<!-- LOCALIZATION NOTE (trackingProtection.unblock.label, trackingProtection.unblock.accesskey):
The associated button with this label and accesskey is only shown when opening the control
center while looking at a site with trackers in NON-private browsing mode. -->
@ -918,6 +919,8 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY trackingProtection.unblockPrivate2.accesskey "T">
<!ENTITY trackingProtection.block3.label "Turn Tracking Protection ON">
<!ENTITY trackingProtection.block3.accesskey "T">
<!ENTITY trackingProtection.reload.label "Reload This Page">
<!ENTITY trackingProtection.reload.accesskey "R">
<!ENTITY pluginNotification.showAll.label "Show All">
<!ENTITY pluginNotification.showAll.accesskey "S">

Просмотреть файл

@ -329,6 +329,9 @@ description#identity-popup-content-verifier,
#tracking-protection-content[state="blocked-tracking-content"] > #tracking-blocked,
#main-window:not([privatebrowsingmode]) #tracking-protection-content[state="blocked-tracking-content"] > #tracking-action-unblock,
#main-window[privatebrowsingmode] #tracking-protection-content[state="blocked-tracking-content"] > #tracking-action-unblock-private,
/* Enabled and no exception but trackers loaded, probably needs a reload */
#tracking-protection-content[enabled="true"]:not([hasException])[state="loaded-tracking-content"] > #tracking-reload-required,
#tracking-protection-content[enabled="true"]:not([hasException])[state="loaded-tracking-content"] > #tracking-action-reload,
/* Disabled or has an exception, offer to block the site. */
#tracking-protection-content[state="loaded-tracking-content"]:-moz-any([enabled="false"],[hasException]) > #tracking-loaded,
#tracking-protection-content[state="loaded-tracking-content"]:-moz-any([enabled="false"],[hasException]) > #tracking-action-block {