Skip to content

Commit

Permalink
refactor: extend props
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamjuliot committed Dec 11, 2024
1 parent 2ca0c34 commit 4cda02e
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 163 deletions.
318 changes: 159 additions & 159 deletions docs/creep.js

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions src/creep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ import getBestWorkerScope, { Scope, spawnWorker, workerScopeHTML } from './worke

await queueTask()
const stackBytes = getStackBytes()
const [, measuredTime, ttfb] = await Promise.all([
const [, measuredTime, ttfb, aInfo, sQuota] = await Promise.all([
exile(),
measure(),
getTTFB(),
// @ts-expect-error if unsupported
'gpu' in navigator ? navigator.gpu.requestAdapter().then((x) => x ? true : null) : null,
getStorage(),
])
console.clear()
const measured = (outerWidth - innerWidth < 150) && (outerHeight - innerHeight < 150) ? measuredTime : 0
Expand Down Expand Up @@ -387,10 +390,8 @@ import getBestWorkerScope, { Scope, spawnWorker, workerScopeHTML } from './worke
deviceOfTimezoneHash,
timeEnd,
},
sQuota,
] = await Promise.all([
fingerprint().catch((error) => console.error(error)) || {},
getStorage(),
])

if (!fp) {
Expand Down Expand Up @@ -909,6 +910,8 @@ import getBestWorkerScope, { Scope, spawnWorker, workerScopeHTML } from './worke
benchmarkProto: PROTO_BENCHMARK,
measured,
ttfb,
aInfo,
sQuota,
}

// console.log(`'`+Object.keys(RAW_BODY).join(`',\n'`))
Expand Down Expand Up @@ -1010,6 +1013,7 @@ import getBestWorkerScope, { Scope, spawnWorker, workerScopeHTML } from './worke
sQuota,
measured,
ttfb,
aInfo,
canvasHash: fp.canvas2d?.lied === true ? null : fp.canvas2d?.$hash.slice(0, 8),
webglHash: fp.canvasWebgl?.lied === true ? null : fp.canvasWebgl?.$hash.slice(0, 8),
screenHash: fp.screen?.$hash.slice(0, 8),
Expand Down Expand Up @@ -1419,6 +1423,10 @@ import getBestWorkerScope, { Scope, spawnWorker, workerScopeHTML } from './worke
RAW_BODY = {
stackBytes,
tmSum,
measured,
ttfb,
aInfo,
sQuota,
sender: `${sender.e}_${sender.l}`,
isTorBrowser,
isRFP,
Expand Down Expand Up @@ -1591,7 +1599,7 @@ import getBestWorkerScope, { Scope, spawnWorker, workerScopeHTML } from './worke

if (crowdBlendingScore != fpCrowdBlendingScore) {
console.log(`updating crowd-blending score from ${fpCrowdBlendingScore} to ${crowdBlendingScore}`)
const scoreRequest = `https://creepjs-api.web.app/score-crowd-blending?id=${creepHash}&crowdBlendingScore=${crowdBlendingScore}&traceId=${traceId}&stackBytes=${stackBytes}&tmSum=${tmSum}`
const scoreRequest = `https://creepjs-api.web.app/score-crowd-blending?id=${creepHash}&crowdBlendingScore=${crowdBlendingScore}&traceId=${traceId}&stackBytes=${stackBytes}&tmSum=${tmSum}&measured=${measured}&ttfb=${ttfb}&aInfo=${aInfo}&sQuota=${sQuota}`

fetch(scoreRequest)
.catch((error) => console.error('Failed Score Request', error))
Expand Down

0 comments on commit 4cda02e

Please sign in to comment.