From eef1669281240ffd5b5182c16bd17eadfadd2809 Mon Sep 17 00:00:00 2001 From: ablanathtanalba Date: Wed, 16 Sep 2020 10:51:32 -0700 Subject: [PATCH] match style and show different message for first party protections on tab with no trackers --- src/_locales/en_US/messages.json | 4 ++++ src/js/popup.js | 20 +++++++++++++++----- src/skin/popup.css | 4 ++-- src/skin/popup.html | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/_locales/en_US/messages.json b/src/_locales/en_US/messages.json index 23d8a389c7..e8c9ed5536 100644 --- a/src/_locales/en_US/messages.json +++ b/src/_locales/en_US/messages.json @@ -119,6 +119,10 @@ "message": "and is enforcing link tracking protections.", "description": "message shown on a site where first party outgoing link tracking protections are enabled" }, + "popup_info_firstparty_protections_no_trackers": { + "message": "Link tracking protections are enforced.", + "description": "message shown on a site where first party outgoing link tracking protections are enabled, but there are no third party trackers detected." + }, "options_domain_list_tab": { "message": "Tracking Domains", "description": "This is an options page tab heading." diff --git a/src/js/popup.js b/src/js/popup.js index 6a2d82b749..afe5afd42a 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -135,11 +135,6 @@ function init() { overlay.toggleClass('active'); } - // show firstparty link tracking protection if we scrub links on this tab host - if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') { - $("#instructions_firstparty_protections").show(); - } - $("#error").on("click", function() { overlay.toggleClass('active'); }); @@ -568,10 +563,20 @@ function refreshPopup() { // show "no trackers" message $("#instructions_no_trackers").show(); + // show first party protections message if link tracker cleaning is enabled on this tabHost + if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') { + $("#instructions_firstparty_protections_no_trackers").show(); + } + } else if (POPUP_DATA.trackerCount == 1) { // hide multiple trackers message $("#instructions-many-trackers").hide(); + // show first party protections message if link tracker cleaning is enabled on this tabHost + if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') { + $("#instructions_firstparty_protections").show(); + } + // show singular "tracker" message $("#instructions_one_tracker").show(); @@ -582,6 +587,11 @@ function refreshPopup() { "" ] )).find(".tooltip").tooltipster(); + + // show first party protections message if link tracker cleaning is enabled on this tabHost + if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') { + $("#instructions_firstparty_protections").show(); + } } function renderDomains() { diff --git a/src/skin/popup.css b/src/skin/popup.css index 50741c280d..e6991b3b14 100644 --- a/src/skin/popup.css +++ b/src/skin/popup.css @@ -291,12 +291,12 @@ font-size: 16px; #pbInstructions :not(#options_domain_list_trackers):not(#options_domain_list_one_tracker):not(#options_domain_list_no_trackers) a:hover { color: #ec9329 } -#instructions_no_trackers, #special-browser-page, #disabled-site-message { +#instructions_no_trackers, #special-browser-page, #disabled-site-message, #instructions_firstparty_protections_no_trackers { text-align: center; margin: 45px 0; padding: 0; } -#instructions_no_trackers, #no-third-parties { +#instructions_no_trackers, #no-third-parties, #instructions_firstparty_protections_no_trackers { display: block; } #no-third-parties { diff --git a/src/skin/popup.html b/src/skin/popup.html index 2a13e280fa..24eb5f2ac7 100644 --- a/src/skin/popup.html +++ b/src/skin/popup.html @@ -106,6 +106,7 @@