diff --git a/Build/lib/stable-sort-domain.ts b/Build/lib/stable-sort-domain.ts index 012927e0..7f65ac38 100644 --- a/Build/lib/stable-sort-domain.ts +++ b/Build/lib/stable-sort-domain.ts @@ -1,5 +1,4 @@ import type { PublicSuffixList } from '@gorhill/publicsuffixlist'; -import { createCachedGorhillGetDomain } from './cached-tld-parse'; const compare = (a: string | null, b: string | null) => { if (a === b) return 0; @@ -20,9 +19,9 @@ const compare = (a: string | null, b: string | null) => { } for (let i = 0; i < aLen; i++) { - if (b[i] == null) { - return 1; - } + // if (b[i] == null) { + // return 1; + // } if (a[i] < b[i]) { return -1; } @@ -34,22 +33,20 @@ const compare = (a: string | null, b: string | null) => { }; export const sortDomains = (inputs: string[], gorhill: PublicSuffixList) => { - const getDomain = createCachedGorhillGetDomain(gorhill); - const domains = inputs.reduce>((acc, cur) => { - if (!acc.has(cur)) acc.set(cur, getDomain(cur)); + const domains = inputs.reduce>((acc, cur) => { + if (!acc.has(cur)) { + const topD = gorhill.getDomain(cur[0] === '.' ? cur.slice(1) : cur); + acc.set(cur, topD === cur ? null : topD); + }; return acc; }, new Map()); const sorter = (a: string, b: string) => { if (a === b) return 0; - const $a = domains.get(a)!; - const $b = domains.get(b)!; + const $a = domains.get(a) || a; + const $b = domains.get(b) || b; - // avoid compare same thing twice - if (a === $a && b === $b) { - return compare(a, b); - } return compare($a, $b) || compare(a, b); }; diff --git a/Source/domainset/cdn.conf b/Source/domainset/cdn.conf index 116c4979..214c2850 100644 --- a/Source/domainset/cdn.conf +++ b/Source/domainset/cdn.conf @@ -2015,6 +2015,7 @@ i.mt.lv secure-uploads.ui.com account-cdn.svc.ui.com net-fe-static-assets.network-controller.svc.ui.com +images.svc.ui.com static.ui.com # SoftSonic .sftcdn.net @@ -2649,3 +2650,7 @@ cdn.reimu.net img.reimu.net re.reimu.net useruploads.socratic.org +static.socratic.org +assets.vogue.com +.kuaikan-cdn4.com +.surrit.com diff --git a/Source/domainset/download.conf b/Source/domainset/download.conf index 24241bee..4c51a7f5 100644 --- a/Source/domainset/download.conf +++ b/Source/domainset/download.conf @@ -33,6 +33,8 @@ repo.carbon.sh # KDE binary-factory.kde.org invent.kde.org +# Raspberry Pi +downloads.raspberrypi.com # Linux Mirrors mirror.navercorp.com fedorapeople.org diff --git a/Source/non_ip/global.conf b/Source/non_ip/global.conf index 67be8f7f..8cb27240 100644 --- a/Source/non_ip/global.conf +++ b/Source/non_ip/global.conf @@ -327,6 +327,7 @@ DOMAIN-SUFFIX,bwh1.net DOMAIN-SUFFIX,castbox.fm DOMAIN-SUFFIX,cbc.ca DOMAIN,ccmdl.adobe.com +DOMAIN-SUFFIX,cdpn.io DOMAIN-SUFFIX,change.org DOMAIN-SUFFIX,character.ai DOMAIN-SUFFIX,cloudfront.net