Skip to content

Commit

Permalink
add names of replaced widgets to expandable widget section in popup
Browse files Browse the repository at this point in the history
  • Loading branch information
ablanathtanalba committed Sep 16, 2021
1 parent 7e28e76 commit 1084e1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/_locales/en_US/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,8 @@
"description": "Clickable status header text in the popup. Shown when a media widget like Spotify embed or Disqus comment section has been temporarily replaced by Privacy Badger with a click-to-activate placeholder."
},
"popup_info_widgets_description": {
"message": "Some embedded content on this page might be used to track you, so Privacy Badger has temporarily replaced them with click-to-activate placeholders. $LINK_START$Learn more here$LINK_END$",
"message": "Some embedded content on this page might be used to track you, so <a href='https://privacybadger.org/#How-does-Privacy-Badger-handle-social-media-widgets' target='_blank'>Privacy Badger has temporarily replaced them</a>. The following widgets have been replaced:",
"description": "Clickable status header text in the popup. Shown when a media widget like Spotify embed or Disqus comment section has been temporarily replaced by Privacy Badger with a click-to-activate placeholder.",
"placeholders": {
"link_start": {
"content": "<a href='https://privacybadger.org/#How-does-Privacy-Badger-handle-social-media-widgets' target='_blank'>"
},
"link_end": {
"content": "</a>"
}
}
},
"popup_instructions": {
"message": "$COUNT$ potential $LINK_START$trackers$LINK_END$ blocked",
Expand Down
9 changes: 9 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,15 @@ function refreshPopup() {

$printable.appendTo('#blockedResourcesInner');

// get widget names for popup if there are any replaced widgets on this page
if (Object.keys(POPUP_DATA.replacedWidgets).length) {
let name = POPUP_DATA.replacedWidgets.name;
// prevent duplicate names from appearing, only append if it doesn't already exist
if (!$('#instructions-widgets-description li:contains("' + name + '")').length) {
$("#instructions-widgets-description").append("<li>" + name + "</li>");
}
}

// activate tooltips
$('#blockedResourcesInner .tooltip:not(.tooltipstered)').tooltipster(
htmlUtils.DOMAIN_TOOLTIP_CONF);
Expand Down
3 changes: 3 additions & 0 deletions src/skin/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ body#main #pbInstructions a:hover, #webrtc-deprecation-div a:hover, #donate a:ho
padding: 8px;
font-size: 12px;
}
#instructions-widgets-description li {
margin-left: 20px;
}
#no-third-parties {
display: block;
font-size: 12px;
Expand Down

0 comments on commit 1084e1d

Please sign in to comment.