From 4ddfb3f2789d8fe48b62886af74184262c05d29b Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 11 Jun 2023 09:20:10 -0400 Subject: [PATCH] [mv3] Add more specific purposed annoyances-related lists Import country flag-related code from uBO. Switch to AdGuard annoyance-related lists, as this solves https://github.com/uBlockOrigin/uBOL-issues/issues/5#issuecomment-1583192594 --- platform/mv3/extension/css/settings.css | 1 - platform/mv3/extension/js/settings.js | 4 +- platform/mv3/make-rulesets.js | 53 +++++++++++++++++++------ tools/make-mv3.sh | 2 + 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/platform/mv3/extension/css/settings.css b/platform/mv3/extension/css/settings.css index e04300ca1..e0f179fa3 100644 --- a/platform/mv3/extension/css/settings.css +++ b/platform/mv3/extension/css/settings.css @@ -109,7 +109,6 @@ p { .listEntry > * { margin-left: 0; margin-right: 0; - text-transform: capitalize; unicode-bidi: embed; } .listEntry .listname { diff --git a/platform/mv3/extension/js/settings.js b/platform/mv3/extension/js/settings.js index c253bd554..f21f892f5 100644 --- a/platform/mv3/extension/js/settings.js +++ b/platform/mv3/extension/js/settings.js @@ -22,7 +22,7 @@ 'use strict'; import { browser, sendMessage, localRead, localWrite } from './ext.js'; -import { i18n$ } from './i18n.js'; +import { i18n$, i18n } from './i18n.js'; import { dom, qs$, qsa$ } from './dom.js'; /******************************************************************************/ @@ -70,7 +70,7 @@ function renderFilterLists(soft = false) { if ( dom.attr(li, 'data-listkey') !== ruleset.id ) { dom.attr(li, 'data-listkey', ruleset.id); qs$(li, 'input[type="checkbox"]').checked = on; - dom.text(qs$(li, '.listname'), ruleset.name || ruleset.id); + qs$(li, '.listname').append(i18n.patchUnicodeFlags(ruleset.name)); dom.cl.remove(li, 'toRemove'); if ( ruleset.homeURL ) { dom.cl.add(li, 'support'); diff --git a/platform/mv3/make-rulesets.js b/platform/mv3/make-rulesets.js index 2abb1eea7..9e9047766 100644 --- a/platform/mv3/make-rulesets.js +++ b/platform/mv3/make-rulesets.js @@ -1058,29 +1058,56 @@ async function main() { // Handpicked annoyance rulesets from assets.json await rulesetFromURLs({ - id: 'easylist-cookies', - name: 'EasyList – Cookies Notices' , + id: 'annoyances-cookies', + name: 'AdGuard – Cookies Notices', group: 'annoyances', enabled: false, urls: [ - 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-cookies.txt', + 'https://filters.adtidy.org/extension/ublock/filters/18.txt', + 'https://ublockorigin.github.io/uAssets/filters/annoyances-cookies.txt', ], - homeURL: 'https://github.com/uBlockOrigin/uAssets', + homeURL: 'https://github.com/AdguardTeam/AdguardFilters#adguard-filters', }); await rulesetFromURLs({ - id: 'easylist-annoyances', - name: 'EasyList – Annoyances' , + id: 'annoyances-overlays', + name: 'AdGuard/uBO – Overlays', group: 'annoyances', enabled: false, urls: [ - 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-annoyances.txt', - 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-chat.txt', - 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-newsletters.txt', - 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-notifications.txt', - 'https://ublockorigin.github.io/uAssets/thirdparties/easylist-social.txt', - 'https://ublockorigin.github.io/uAssets/filters/annoyances.txt', + 'https://filters.adtidy.org/extension/ublock/filters/19.txt', + 'https://ublockorigin.github.io/uAssets/filters/annoyances-others.txt', ], - homeURL: 'https://github.com/uBlockOrigin/uAssets', + homeURL: 'https://github.com/AdguardTeam/AdguardFilters#adguard-filters', + }); + await rulesetFromURLs({ + id: 'annoyances-social', + name: 'AdGuard – Social Media', + group: 'annoyances', + enabled: false, + urls: [ + 'https://filters.adtidy.org/extension/ublock/filters/4.txt', + ], + homeURL: 'https://github.com/AdguardTeam/AdguardFilters#adguard-filters', + }); + await rulesetFromURLs({ + id: 'annoyances-widgets', + name: 'AdGuard – Widgets', + group: 'annoyances', + enabled: false, + urls: [ + 'https://filters.adtidy.org/extension/ublock/filters/22.txt', + ], + homeURL: 'https://github.com/AdguardTeam/AdguardFilters#adguard-filters', + }); + await rulesetFromURLs({ + id: 'annoyances-others', + name: 'AdGuard – Other Annoyances', + group: 'annoyances', + enabled: false, + urls: [ + 'https://filters.adtidy.org/extension/ublock/filters/21.txt', + ], + homeURL: 'https://github.com/AdguardTeam/AdguardFilters#adguard-filters', }); // Handpicked rulesets from abroad diff --git a/tools/make-mv3.sh b/tools/make-mv3.sh index 72431e3b5..e5a22ff0f 100755 --- a/tools/make-mv3.sh +++ b/tools/make-mv3.sh @@ -57,6 +57,8 @@ cp src/js/fa-icons.js $DES/js/ cp src/js/i18n.js $DES/js/ cp src/lib/punycode.js $DES/js/ +cp -R src/img/flags-of-the-world $DES/img + cp LICENSE.txt $DES/ echo "*** uBOLite.mv3: Copying mv3-specific files"