this repo has no description
0
fork

Configure Feed

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

Revert "Refactoring Privacy & Security, prep for 1.4.0"

This reverts commit c28eb2286b68ed473979db2dfc9aa7200271dcf9.

+16 -27
+16 -27
background.js
··· 97 97 action.setIcon({ path: iconName, tabId }) 98 98 } 99 99 100 - // Map to store the last domain of each tab 101 - // This is used below to prevent triggering 102 - // peformAction unless the domain of a tab changes 103 - const tabsWithLastDomain = new Map() 104 - 105 100 // Main function to perform actions, but only if the privacy consent has been accepted 106 101 function performAction(tab) { 107 102 storage.get("privacyConsentAccepted", ({ privacyConsentAccepted }) => { ··· 109 104 if (privacyConsentAccepted) { 110 105 const domain = getDomainName(tab.url) 111 106 if (isValidDomain(domain)) { 112 - const lastDomain = tabsWithLastDomain.get(tab.id) 113 - if (domain !== lastDomain) { 114 - // Update the last domain of the tab 115 - tabsWithLastDomain.set(tab.id, domain) 116 - // Check for DIDs 117 - checkForDIDDNS(domain).then((domainDID) => { 118 - if (domainDID) { 119 - setIcon(tab.id, "logo48.png") 120 - tabsWithDID.set(tab.id, domainDID) 121 - } else { 122 - checkForDIDHTTPS(domain).then((httpsDID) => { 123 - if (httpsDID) { 124 - setIcon(tab.id, "logo48.png") 125 - tabsWithDID.set(tab.id, httpsDID) 126 - } else { 127 - setIcon(tab.id, "logo48_gray.png") 128 - tabsWithDID.delete(tab.id) 129 - } 130 - }) 131 - } 132 - }) 133 - } 107 + checkForDIDDNS(domain).then((domainDID) => { 108 + if (domainDID) { 109 + setIcon(tab.id, "logo48.png") 110 + tabsWithDID.set(tab.id, domainDID) 111 + } else { 112 + checkForDIDHTTPS(domain).then((httpsDID) => { 113 + if (httpsDID) { 114 + setIcon(tab.id, "logo48.png") 115 + tabsWithDID.set(tab.id, httpsDID) 116 + } else { 117 + setIcon(tab.id, "logo48_gray.png") 118 + tabsWithDID.delete(tab.id) 119 + } 120 + }) 121 + } 122 + }) 134 123 } 135 124 } 136 125 })