Fixed memory leak and popup not updating after navigation

main
Elbert Alias 4 years ago
parent fa7b9260dc
commit 8f06b60edd

@ -842,9 +842,9 @@ class Site {
} }
if (this.options.probe && !this.probed) { if (this.options.probe && !this.probed) {
await this.probe(url)
this.probed = true this.probed = true
await this.probe(url)
} }
} catch (error) { } catch (error) {
this.analyzedUrls[url.href] = { this.analyzedUrls[url.href] = {

@ -13,7 +13,7 @@
"software" "software"
], ],
"homepage": "https://www.wappalyzer.com/", "homepage": "https://www.wappalyzer.com/",
"version": "6.7.2", "version": "6.7.3",
"author": "Wappalyzer", "author": "Wappalyzer",
"license": "MIT", "license": "MIT",
"repository": { "repository": {

@ -15,7 +15,7 @@ const { agent, promisify, getOption, setOption, open, globEscape } = Utils
const expiry = 1000 * 60 * 60 * 24 const expiry = 1000 * 60 * 60 * 24
const hostnameIgnoreList = const hostnameIgnoreList =
/\b((local|dev(elop(ment)?)?|stag(e|ing)?|preprod|preview|test(ing)?|[^a-z]demo(shop)?|cache)[.-]|localhost|((wappalyzer|google|facebook|twitter|reddit|yahoo|wikipedia|amazon|youtube)\.)|\.local|\.test|\.netlify\.app|\.shopifypreview\.com|^[0-9.]+|[\d.]+$|^([a-f0-9:]+:+)+[a-f0-9]+$)/ /\b((local|dev(elop(ment)?)?|stag(e|ing)?|preprod|preview|test(ing)?|[^a-z]demo(shop)?|cache)[.-]|localhost|((wappalyzer|google|facebook|twitter|reddit|yahoo|wikipedia|amazon|youtube)\.)|\.local|\.test|\.netlify\.app|\.shopifypreview\.com|^([0-9.]+|[\d.]+)$|^([a-f0-9:]+:+)+[a-f0-9]+$)/
const xhrDebounce = [] const xhrDebounce = []
@ -74,7 +74,19 @@ const Driver = {
types: ['xmlhttprequest'], types: ['xmlhttprequest'],
}) })
chrome.tabs.onRemoved.addListener((id) => (Driver.cache.tabs[id] = null)) chrome.tabs.onRemoved.addListener((id) => delete Driver.cache.tabs[id])
chrome.tabs.onUpdated.addListener(async (id, { url }) => {
if (url) {
const { hostname } = new URL(url)
const cache = Driver.cache.hostnames[hostname]
Driver.cache.tabs[id] = cache ? resolve(cache.detections) : []
await Driver.setIcon(url, Driver.cache.tabs[id])
}
})
// Enable messaging between scripts // Enable messaging between scripts
chrome.runtime.onMessage.addListener(Driver.onMessage) chrome.runtime.onMessage.addListener(Driver.onMessage)
@ -434,14 +446,14 @@ const Driver = {
cache.detections = cache.detections cache.detections = cache.detections
.concat(detections) .concat(detections)
.filter(({ technology }) => technology) .filter(({ technology }) => technology)
.filter(
cache.detections.filter( ({ technology: { name }, pattern: { regex } }, index) =>
({ technology: { name }, pattern: { regex } }, index) => cache.detections.findIndex(
cache.detections.findIndex( ({ technology: { name: _name }, pattern: { regex: _regex } }) =>
({ technology: { name: _name }, pattern: { regex: _regex } }) => name === _name &&
name === _name && (!regex || regex.toString() === _regex.toString()) (!regex || regex.toString() === _regex.toString())
) === index ) === index
) )
cache.hits += incrementHits ? 1 : 0 cache.hits += incrementHits ? 1 : 0
cache.language = cache.language || language cache.language = cache.language || language
@ -526,6 +538,10 @@ const Driver = {
* @param {Object} technologies * @param {Object} technologies
*/ */
async setIcon(url, technologies = []) { async setIcon(url, technologies = []) {
if (await Driver.isDisabledDomain(url)) {
technologies = []
}
const dynamicIcon = await getOption('dynamicIcon', false) const dynamicIcon = await getOption('dynamicIcon', false)
const badge = await getOption('badge', true) const badge = await getOption('badge', true)

@ -4,7 +4,7 @@
"author": "Wappalyzer", "author": "Wappalyzer",
"homepage_url": "https://www.wappalyzer.com/", "homepage_url": "https://www.wappalyzer.com/",
"description": "Identify web technologies", "description": "Identify web technologies",
"version": "6.7.2", "version": "6.7.3",
"default_locale": "en", "default_locale": "en",
"manifest_version": 2, "manifest_version": 2,
"icons": { "icons": {

@ -13,7 +13,7 @@
"software" "software"
], ],
"homepage": "https://www.wappalyzer.com/", "homepage": "https://www.wappalyzer.com/",
"version": "6.7.2", "version": "6.7.3",
"author": "Wappalyzer", "author": "Wappalyzer",
"license": "MIT", "license": "MIT",
"repository": { "repository": {

@ -16290,7 +16290,7 @@
}, },
"SAP": { "SAP": {
"cats": [ "cats": [
22 53
], ],
"headers": { "headers": {
"Server": "SAP NetWeaver Application Server" "Server": "SAP NetWeaver Application Server"
@ -23863,4 +23863,4 @@
"website": "https://www.xt-commerce.com" "website": "https://www.xt-commerce.com"
} }
} }
} }