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() {