Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Initial implementation of iOS signal capture [DRAFT] #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aekeus
Copy link
Member

@aekeus aekeus commented May 6, 2020

No description provided.

@aekeus aekeus changed the title Initial implementation of iOS signal capture Initial implementation of iOS signal capture [DRAFT] May 6, 2020
@aekeus aekeus requested review from kkuehlz and pes10k May 6, 2020 13:07
@pes10k
Copy link

pes10k commented May 6, 2020

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())
Copy link
Contributor

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)
Copy link
Contributor

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,
Copy link
Contributor

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(),
Copy link
Contributor

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,
Copy link
Contributor

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))
Copy link
Contributor

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 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants