Skip to content

Commit

Permalink
test(goto): add creepjs evasions test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jul 15, 2023
1 parent bf13b49 commit 70faceb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/goto/test/e2e/evasions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@ test('arh.antoinevastel.com/bots/areyouheadless', async t => {
t.true(assertion)
})

test('creepjs', async t => {
const browserless = await getBrowserContext(t)

const fingerprint = await browserless.evaluate(page =>
page.evaluate(async () => {
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
let result = 'Computing...'
do {
await delay(100)
result = document.querySelector('.fingerprint-header div').innerText.split(': ')[1]
} while (result === 'Computing...')
return result
})
)

const [fingerprintOne, fingerprintTwo] = await Promise.all([
fingerprint('https://abrahamjuliot.github.io/creepjs/', { timezone: 'Europe/Madrid' }),
fingerprint('https://abrahamjuliot.github.io/creepjs/', { timezone: 'Europe/Paris' })
])

t.true(fingerprintOne !== fingerprintTwo)
})

test('fingerprintjs', async t => {
const browserless = await getBrowserContext(t)

Expand Down

0 comments on commit 70faceb

Please sign in to comment.