|
|
@ -40,24 +40,26 @@ const Popup = {
|
|
|
|
agent === 'chrome' || (await getOption('termsAccepted', false))
|
|
|
|
agent === 'chrome' || (await getOption('termsAccepted', false))
|
|
|
|
|
|
|
|
|
|
|
|
if (termsAccepted) {
|
|
|
|
if (termsAccepted) {
|
|
|
|
|
|
|
|
document.querySelector('.terms').classList.add('terms--hidden')
|
|
|
|
|
|
|
|
document.querySelector('.empty').classList.remove('empty--hidden')
|
|
|
|
|
|
|
|
|
|
|
|
Popup.onGetDetections(await Popup.driver('getDetections'))
|
|
|
|
Popup.onGetDetections(await Popup.driver('getDetections'))
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
document.querySelector('.terms').style.display = 'flex'
|
|
|
|
document.querySelector('.terms').classList.remove('terms--hidden')
|
|
|
|
document.querySelector('.detections').style.display = 'none'
|
|
|
|
document.querySelector('.detections').classList.add('detections--hidden')
|
|
|
|
document.querySelector('.empty').style.display = 'none'
|
|
|
|
document.querySelector('.empty').classList.add('empty--hidden')
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector('.terms').addEventListener('click', async () => {
|
|
|
|
document.querySelector('.terms').addEventListener('click', async () => {
|
|
|
|
await setOption('termsAccepted', true)
|
|
|
|
await setOption('termsAccepted', true)
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector('.terms').remove()
|
|
|
|
document.querySelector('.terms').classList.remove('terms--hidden')
|
|
|
|
document.querySelector('.detections').style.display = 'block'
|
|
|
|
document
|
|
|
|
document.querySelector('.empty').style.display = 'block'
|
|
|
|
.querySelector('.detections')
|
|
|
|
|
|
|
|
.classList.add('.detections--hidden')
|
|
|
|
|
|
|
|
document.querySelector('.empty').classList.add('empty--hidden')
|
|
|
|
|
|
|
|
|
|
|
|
chrome.runtime.sendMessage('getDetections', Popup.onGetDetections)
|
|
|
|
chrome.runtime.sendMessage('getDetections', Popup.onGetDetections)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// Apply internationalization
|
|
|
|
|
|
|
|
i18n()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Alert
|
|
|
|
// Alert
|
|
|
@ -66,15 +68,24 @@ const Popup = {
|
|
|
|
currentWindow: true
|
|
|
|
currentWindow: true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector(
|
|
|
|
if (url.startsWith('http')) {
|
|
|
|
'.alerts__link'
|
|
|
|
document.querySelector('.alerts').classList.remove('alerts--hidden')
|
|
|
|
).href = `https://www.wappalyzer.com/alerts/manage?url=${encodeURIComponent(
|
|
|
|
|
|
|
|
`${url}`
|
|
|
|
document.querySelector(
|
|
|
|
)}`
|
|
|
|
'.alerts__link'
|
|
|
|
|
|
|
|
).href = `https://www.wappalyzer.com/alerts/manage?url=${encodeURIComponent(
|
|
|
|
|
|
|
|
`${url}`
|
|
|
|
|
|
|
|
)}`
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
document.querySelector('.alerts').classList.add('alerts--hidden')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
document
|
|
|
|
document
|
|
|
|
.querySelector('.footer__settings')
|
|
|
|
.querySelector('.footer__settings')
|
|
|
|
.addEventListener('click', () => chrome.runtime.openOptionsPage())
|
|
|
|
.addEventListener('click', () => chrome.runtime.openOptionsPage())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Apply internationalization
|
|
|
|
|
|
|
|
i18n()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
driver(func, args) {
|
|
|
|
driver(func, args) {
|
|
|
@ -115,12 +126,14 @@ const Popup = {
|
|
|
|
* @param {Array} detections
|
|
|
|
* @param {Array} detections
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async onGetDetections(detections = []) {
|
|
|
|
async onGetDetections(detections = []) {
|
|
|
|
const pinnedCategory = await getOption('pinnedCategory')
|
|
|
|
if (!detections || !detections.length) {
|
|
|
|
|
|
|
|
return
|
|
|
|
if (detections.length) {
|
|
|
|
|
|
|
|
document.querySelector('.empty').remove()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector('.empty').classList.add('empty--hidden')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pinnedCategory = await getOption('pinnedCategory')
|
|
|
|
|
|
|
|
|
|
|
|
const categorised = Popup.categorise(detections)
|
|
|
|
const categorised = Popup.categorise(detections)
|
|
|
|
|
|
|
|
|
|
|
|
categorised.forEach(({ id, name, slug: categorySlug, technologies }) => {
|
|
|
|
categorised.forEach(({ id, name, slug: categorySlug, technologies }) => {
|
|
|
|