1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-29 06:07:11 +02: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 cnMap = [];
const createDictEntry = (domain, hostname, details) => { const createDictEntry = (domain, hostname, details) => {
const cname = vAPI.net.canonicalNameFromHostname(hostname); if ( details.cname ) {
if ( cname !== undefined ) { cnMap.push([ details.cname, hostname ]);
cnMap.push([ cname, hostname ]);
} }
hnDict[hostname] = { domain, counts: details.counts }; hnDict[hostname] = { domain, counts: details.counts };
}; };

View File

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