Update ping

main
Elbert Alias 3 years ago
parent fd905c690f
commit 3a31fdf7e8

@ -99,12 +99,10 @@ const Driver = {
) )
} }
} else if (version !== previous && upgradeMessage) { } else if (version !== previous && upgradeMessage) {
/*
open( open(
`https://www.wappalyzer.com/upgraded/?utm_source=upgraded&utm_medium=extension&utm_campaign=wappalyzer`, `https://www.wappalyzer.com/upgraded/?utm_source=upgraded&utm_medium=extension&utm_campaign=wappalyzer`,
false false
) )
*/
} }
initDone() initDone()
@ -939,8 +937,8 @@ const Driver = {
agent === 'chrome' || (await getOption('termsAccepted', false)) agent === 'chrome' || (await getOption('termsAccepted', false))
if (tracking && termsAccepted) { if (tracking && termsAccepted) {
const urls = Object.keys(Driver.cache.hostnames).reduce( const urls = Object.keys(Driver.cache.hostnames)
(urls, hostname) => { .reduce((urls, hostname) => {
// eslint-disable-next-line standard/computed-property-even-spacing // eslint-disable-next-line standard/computed-property-even-spacing
const { language, detections, hits, https } = const { language, detections, hits, https } =
Driver.cache.hostnames[hostname] Driver.cache.hostnames[hostname]
@ -970,9 +968,8 @@ const Driver = {
} }
return urls return urls
}, }, {})
{} .slice(0, 25)
)
const count = Object.keys(urls).length const count = Object.keys(urls).length
@ -980,7 +977,8 @@ const Driver = {
if ( if (
count && count &&
(count >= 25 || (count >= 5 && lastPing < Date.now() - expiry)) ((count >= 25 && lastPing < Date.now() - 1000 * 60 * 60) ||
(count >= 5 && lastPing < Date.now() - expiry))
) { ) {
await setOption('lastPing', Date.now()) await setOption('lastPing', Date.now())