-
Notifications
You must be signed in to change notification settings - Fork 22
Initial implementation of iOS signal capture [DRAFT] #134
base: master
Are you sure you want to change the base?
Conversation
I think this looks great, though the Canvas and WebGL fingerprints aren't included. Are they planned to be included? |
@@ -74,12 +75,17 @@ exports.signalsFromRequest = (request) => { | |||
const userAgent = request.headers['user-agent'] | |||
if (!userAgent) return null | |||
|
|||
let querySignals = {} | |||
if (request.query.s) { | |||
querySignals = JSON.parse(Buffer.from(request.query.s, 'base64').toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the ternary conditional and use const
osVersion: parsedUserAgent.os.version, | ||
model: parsedUserAgent.device.model, | ||
countryCode: request.headers['x-brave-country-code'] || 'unknown', | ||
} | ||
}, querySignals) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally not a fan of this. I'd rather be very explicit about what is and isn't being passed to promo server.
languages: navigator.languages.join('|'), | ||
deviceMemory: navigator.deviceMemory, | ||
tzo: new Date().getTimezoneOffset(), | ||
tz: new window.Intl.DateTimeFormat().resolvedOptions().timeZone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object also has interesting things like calendar and numbering system that could be used.
maxTouchPoints: navigator.maxTouchPoints, | ||
languages: navigator.languages.join('|'), | ||
deviceMemory: navigator.deviceMemory, | ||
tzo: new Date().getTimezoneOffset(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The object below also has locale that could be used here?
screenHeight: screen.height, | ||
screenWidth: screen.width, | ||
pixelDepth: screen.pixelDepth, | ||
colorDepth: screen.colorDepth, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any of these actually benefit us if we already collect os info and device model?Can these differ in the case that those two variables are the same? cc @pes10k
description: "Redirect download to App Store", | ||
tags: ['api'], | ||
handler: async function (request, reply) { | ||
reply(buildiOSSignalsHTML(request.params.referral_code)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildIOSSignalsHTML
can also be the handler function. Just modify it to take a request instead of a referral code parameter.
<html> | ||
<body> | ||
<script> | ||
var o = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
No description provided.