From ac1eb964892940d0d5b24c5afb79919a50995da4 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 17 Nov 2017 14:17:40 +0100 Subject: [PATCH] Added connection info --- scripts/Analytics.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/Analytics.ts b/scripts/Analytics.ts index f4c91fab..832743ab 100644 --- a/scripts/Analytics.ts +++ b/scripts/Analytics.ts @@ -14,6 +14,19 @@ export class Analytics { system: { cpuCount: navigator.hardwareConcurrency, platform: navigator.platform + }, + connection: { + downLink: 0, + roundTripTime: 0, + effectiveType: "" + } + } + + if("connection" in navigator) { + analytics.connection = { + downLink: navigator["connection"].downlink, + roundTripTime: navigator["connection"].rtt, + effectiveType: navigator["connection"].effectiveType } }