Add "Social widgets", "Cookie notices" sections in "Filter lists" pane

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3154
This commit is contained in:
Raymond Hill 2024-03-03 15:29:38 -05:00
parent aac88ac766
commit 21a76e32a1
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
3 changed files with 27 additions and 20 deletions

View file

@ -246,10 +246,10 @@
},
"adguard-social": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances",
"group": "social",
"parent": null,
"off": true,
"title": "AdGuard Social Media",
"title": "AdGuard Social Widgets",
"tags": "annoyances social",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/4.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
@ -257,8 +257,8 @@
},
"adguard-cookies": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"group": "cookies",
"parent": "AdGuard/uBO Cookie Notices",
"off": true,
"title": "AdGuard Cookie Notices",
"tags": "annoyances cookies",
@ -268,8 +268,8 @@
},
"ublock-cookies-adguard": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"group": "cookies",
"parent": "AdGuard/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
@ -328,7 +328,7 @@
},
"fanboy-thirdparty_social": {
"content": "filters",
"group": "annoyances",
"group": "social",
"off": true,
"title": "Fanboy Anti-Facebook",
"tags": "privacy",
@ -369,8 +369,8 @@
},
"fanboy-cookiemonster": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"group": "cookies",
"parent": "EasyList/uBO Cookie Notices",
"off": true,
"title": "EasyList Cookie Notices",
"tags": "annoyances cookies",
@ -389,8 +389,8 @@
},
"ublock-cookies-easylist": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"group": "cookies",
"parent": "EasyList/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
@ -441,8 +441,8 @@
},
"fanboy-social": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances",
"group": "social",
"parent": null,
"off": true,
"title": "EasyList Social Widgets",
"tags": "annoyances social",

View file

@ -483,6 +483,14 @@
"message": "Malware protection, security",
"description": "Filter lists section name"
},
"3pGroupSocial": {
"message": "Social widgets",
"description": "Filter lists section name"
},
"3pGroupCookies": {
"message": "Cookie notices",
"description": "Filter lists section name"
},
"3pGroupAnnoyances": {
"message": "Annoyances",
"description": "Filter lists section name"

View file

@ -74,7 +74,9 @@ const renderNodeStats = (used, total) => {
};
const i18nGroupName = name => {
return i18n$('3pGroup' + name.charAt(0).toUpperCase() + name.slice(1));
const groupname = i18n$('3pGroup' + name.charAt(0).toUpperCase() + name.slice(1));
if ( groupname !== '' ) { return groupname; }
return `${name.charAt(0).toLocaleUpperCase}${name.slice(1)}`;
};
/******************************************************************************/
@ -223,6 +225,8 @@ const renderFilterLists = ( ) => {
'privacy',
'malware',
'multipurpose',
'cookies',
'social',
'annoyances',
'regions',
'custom'
@ -235,9 +239,6 @@ const renderFilterLists = ( ) => {
}
for ( const [ listkey, listDetails ] of Object.entries(response.available) ) {
let groupKey = listDetails.group;
if ( groupKey === 'social' ) {
groupKey = 'annoyances';
}
const groupDetails = listTree[groupKey];
if ( listDetails.parent !== undefined ) {
let lists = groupDetails.lists;
@ -699,8 +700,6 @@ dom.on('.searchbar input', 'input', searchFilterLists);
const expandedListSet = new Set([
'uBlock filters',
'AdGuard Annoyances',
'EasyList Annoyances',
]);
const listIsExpanded = which => {