|
|
|
@ -8,6 +8,7 @@ const {
|
|
|
|
|
analyze,
|
|
|
|
|
analyzeManyToMany,
|
|
|
|
|
resolve,
|
|
|
|
|
getTechnology,
|
|
|
|
|
} = Wappalyzer
|
|
|
|
|
const { agent, promisify, getOption, setOption, open } = Utils
|
|
|
|
|
|
|
|
|
@ -79,10 +80,10 @@ const Driver = {
|
|
|
|
|
'https://www.wappalyzer.com/installed/?utm_source=installed&utm_medium=extension&utm_campaign=wappalyzer'
|
|
|
|
|
)
|
|
|
|
|
} else if (version !== previous && upgradeMessage) {
|
|
|
|
|
// open(
|
|
|
|
|
// `https://www.wappalyzer.com/upgraded/?utm_source=upgraded&utm_medium=extension&utm_campaign=wappalyzer`,
|
|
|
|
|
// false
|
|
|
|
|
// )
|
|
|
|
|
open(
|
|
|
|
|
`https://www.wappalyzer.com/upgraded/?utm_source=upgraded&utm_medium=extension&utm_campaign=wappalyzer`,
|
|
|
|
|
false
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await setOption('version', version)
|
|
|
|
@ -211,6 +212,19 @@ const Driver = {
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Force a technology detection by URL and technology name
|
|
|
|
|
* @param {String} url
|
|
|
|
|
* @param {String} name
|
|
|
|
|
*/
|
|
|
|
|
detectTechnology(url, name) {
|
|
|
|
|
const technology = getTechnology(name)
|
|
|
|
|
|
|
|
|
|
return Driver.onDetect(url, [
|
|
|
|
|
{ technology, pattern: { regex: '', confidence: 100 }, version: '' },
|
|
|
|
|
])
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Enable scripts to call Driver functions through messaging
|
|
|
|
|
* @param {Object} message
|
|
|
|
@ -411,7 +425,13 @@ const Driver = {
|
|
|
|
|
await Driver.setIcon(url, resolved)
|
|
|
|
|
|
|
|
|
|
if (url) {
|
|
|
|
|
const tabs = await promisify(chrome.tabs, 'query', { url })
|
|
|
|
|
let tabs = []
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
tabs = await promisify(chrome.tabs, 'query', { url })
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// Continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tabs.forEach(({ id }) => (Driver.cache.tabs[id] = resolved))
|
|
|
|
|
}
|
|
|
|
@ -454,15 +474,20 @@ const Driver = {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
;(await promisify(chrome.tabs, 'query', { url })).forEach(
|
|
|
|
|
({ id: tabId }) => {
|
|
|
|
|
let tabs = []
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
tabs = await promisify(chrome.tabs, 'query', { url })
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// Continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tabs.forEach(({ id: tabId }) => {
|
|
|
|
|
chrome.browserAction.setBadgeText(
|
|
|
|
|
{
|
|
|
|
|
tabId,
|
|
|
|
|
text:
|
|
|
|
|
badge && technologies.length
|
|
|
|
|
? technologies.length.toString()
|
|
|
|
|
: '',
|
|
|
|
|
badge && technologies.length ? technologies.length.toString() : '',
|
|
|
|
|
},
|
|
|
|
|
() => {}
|
|
|
|
|
)
|
|
|
|
@ -480,8 +505,7 @@ const Driver = {
|
|
|
|
|
},
|
|
|
|
|
() => {}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|