···103103// The cache is cleared when the tab is closed
104104const didCache = new Map()
105105106106-// Main function to perform actions, but only if the privacy consent has been accepted
107106function performAction(tab) {
108107 storage.get("privacyConsentAccepted", ({ privacyConsentAccepted }) => {
109108 if (privacyConsentAccepted) {
···112111 // Check if we have cached DID for this tab and domain
113112 const cachedDID = didCache.get(`${tab.id}:${domain}`)
114113 if (cachedDID !== undefined) {
115115- // If we have a cached DID, use it
116116- setDID(tab, cachedDID)
114114+ // If we have a cached DID or a cached "not found" state, use it
115115+ if (cachedDID !== null) {
116116+ setDID(tab, cachedDID)
117117+ } else {
118118+ setIcon(tab.id, "logo48_gray.png")
119119+ tabsWithDID.delete(tab.id)
120120+ }
117121 } else {
118122 // If not, proceed with the checks
119123 checkForDIDDNS(domain).then((domainDID) => {
···128132 } else {
129133 setIcon(tab.id, "logo48_gray.png")
130134 tabsWithDID.delete(tab.id)
135135+ // Cache the "not found" state
136136+ didCache.set(`${tab.id}:${domain}`, null)
131137 }
132138 })
133139 }