Skip to content

Commit

Permalink
Fetch and cache cname of collated hostnames in page store
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 14, 2024
1 parent f936dfa commit c265e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};
Expand Down
1 change: 1 addition & 0 deletions src/js/pagestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ const HostnameDetails = class {
}
init(hostname) {
this.hostname = hostname;
this.cname = vAPI.net.canonicalNameFromHostname(hostname);
this.counts.reset();
}
dispose() {
Expand Down

0 comments on commit c265e84

Please sign in to comment.