this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Refactoring Privacy & Security, prep for 1.4.0

+9 -3
+9 -3
background.js
··· 103 103 // The cache is cleared when the tab is closed 104 104 const didCache = new Map() 105 105 106 - // Main function to perform actions, but only if the privacy consent has been accepted 107 106 function performAction(tab) { 108 107 storage.get("privacyConsentAccepted", ({ privacyConsentAccepted }) => { 109 108 if (privacyConsentAccepted) { ··· 112 111 // Check if we have cached DID for this tab and domain 113 112 const cachedDID = didCache.get(`${tab.id}:${domain}`) 114 113 if (cachedDID !== undefined) { 115 - // If we have a cached DID, use it 116 - setDID(tab, cachedDID) 114 + // If we have a cached DID or a cached "not found" state, use it 115 + if (cachedDID !== null) { 116 + setDID(tab, cachedDID) 117 + } else { 118 + setIcon(tab.id, "logo48_gray.png") 119 + tabsWithDID.delete(tab.id) 120 + } 117 121 } else { 118 122 // If not, proceed with the checks 119 123 checkForDIDDNS(domain).then((domainDID) => { ··· 128 132 } else { 129 133 setIcon(tab.id, "logo48_gray.png") 130 134 tabsWithDID.delete(tab.id) 135 + // Cache the "not found" state 136 + didCache.set(`${tab.id}:${domain}`, null) 131 137 } 132 138 }) 133 139 }