Skip to content

Commit eef1669

Browse files
match style and show different message for first party protections on tab with no trackers
1 parent 6da0329 commit eef1669

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/_locales/en_US/messages.json

+4
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@
119119
"message": "and is enforcing <a href='https://www.eff.org/deeplinks/2018/05/privacy-badger-rolls-out-new-ways-fight-facebook-tracking'>link tracking protections</a>.",
120120
"description": "message shown on a site where first party outgoing link tracking protections are enabled"
121121
},
122+
"popup_info_firstparty_protections_no_trackers": {
123+
"message": "<a href='https://www.eff.org/deeplinks/2018/05/privacy-badger-rolls-out-new-ways-fight-facebook-tracking'>Link tracking protections</a> are enforced.",
124+
"description": "message shown on a site where first party outgoing link tracking protections are enabled, but there are no third party trackers detected."
125+
},
122126
"options_domain_list_tab": {
123127
"message": "Tracking Domains",
124128
"description": "This is an options page tab heading."

src/js/popup.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ function init() {
135135
overlay.toggleClass('active');
136136
}
137137

138-
// show firstparty link tracking protection if we scrub links on this tab host
139-
if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') {
140-
$("#instructions_firstparty_protections").show();
141-
}
142-
143138
$("#error").on("click", function() {
144139
overlay.toggleClass('active');
145140
});
@@ -568,10 +563,20 @@ function refreshPopup() {
568563
// show "no trackers" message
569564
$("#instructions_no_trackers").show();
570565

566+
// show first party protections message if link tracker cleaning is enabled on this tabHost
567+
if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') {
568+
$("#instructions_firstparty_protections_no_trackers").show();
569+
}
570+
571571
} else if (POPUP_DATA.trackerCount == 1) {
572572
// hide multiple trackers message
573573
$("#instructions-many-trackers").hide();
574574

575+
// show first party protections message if link tracker cleaning is enabled on this tabHost
576+
if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') {
577+
$("#instructions_firstparty_protections").show();
578+
}
579+
575580
// show singular "tracker" message
576581
$("#instructions_one_tracker").show();
577582

@@ -582,6 +587,11 @@ function refreshPopup() {
582587
"<a target='_blank' title='" + _.escape(chrome.i18n.getMessage("what_is_a_tracker")) + "' class='tooltip' href='https://privacybadger.org/#What-is-a-third-party-tracker'>"
583588
]
584589
)).find(".tooltip").tooltipster();
590+
591+
// show first party protections message if link tracker cleaning is enabled on this tabHost
592+
if (POPUP_DATA.tabHost == 'www.facebook.com' || POPUP_DATA.tabHost == 'www.google.com') {
593+
$("#instructions_firstparty_protections").show();
594+
}
585595
}
586596

587597
function renderDomains() {

src/skin/popup.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,12 @@ font-size: 16px;
291291
#pbInstructions :not(#options_domain_list_trackers):not(#options_domain_list_one_tracker):not(#options_domain_list_no_trackers) a:hover {
292292
color: #ec9329
293293
}
294-
#instructions_no_trackers, #special-browser-page, #disabled-site-message {
294+
#instructions_no_trackers, #special-browser-page, #disabled-site-message, #instructions_firstparty_protections_no_trackers {
295295
text-align: center;
296296
margin: 45px 0;
297297
padding: 0;
298298
}
299-
#instructions_no_trackers, #no-third-parties {
299+
#instructions_no_trackers, #no-third-parties, #instructions_firstparty_protections_no_trackers {
300300
display: block;
301301
}
302302
#no-third-parties {

src/skin/popup.html

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ <h2 id="title-name"><span class="i18n_name"></span></h2>
106106
<span id="instructions_no_trackers" style="display:none">
107107
<span class="i18n_popup_instructions_no_trackers"></span>
108108
<span id="no-third-parties" class="i18n_popup_blocked" style="display:none"></span>
109+
<span id="instructions_firstparty_protections_no_trackers" class="i18n_popup_info_firstparty_protections_no_trackers" style="display:none"></span>
109110
</span>
110111
<span id="instructions_firstparty_protections" class="i18n_popup_info_firstparty_protections" style="display:none"></span>
111112
</p>

0 commit comments

Comments
 (0)