1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-25 03:43:25 +01:00

Fetch and cache cname of collated hostnames in page store

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3376
This commit is contained in:
Raymond Hill 2024-09-14 11:50:10 -04:00
parent f936dfa648
commit c265e849e0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 3 additions and 3 deletions

View File

@ -288,9 +288,8 @@ const getHostnameDict = function(hostnameDetailsMap, out) {
const cnMap = [];
const createDictEntry = (domain, hostname, details) => {
const cname = vAPI.net.canonicalNameFromHostname(hostname);
if ( cname !== undefined ) {
cnMap.push([ cname, hostname ]);
if ( details.cname ) {
cnMap.push([ details.cname, hostname ]);
}
hnDict[hostname] = { domain, counts: details.counts };
};

View File

@ -312,6 +312,7 @@ const HostnameDetails = class {
}
init(hostname) {
this.hostname = hostname;
this.cname = vAPI.net.canonicalNameFromHostname(hostname);
this.counts.reset();
}
dispose() {