This commit is contained in:
2017-10-01 07:50:53 +02:00
parent e646410fc2
commit c8acdc0d11
3 changed files with 34 additions and 37 deletions

26
scripts/Analytics.ts Normal file
View File

@ -0,0 +1,26 @@
export class Analytics {
push() {
let analytics = {
general: {
timezoneOffset: new Date().getTimezoneOffset()
},
screen: {
width: screen.width,
height: screen.height,
availableWidth: screen.availWidth,
availableHeight: screen.availHeight,
pixelRatio: window.devicePixelRatio
},
system: {
cpuCount: navigator.hardwareConcurrency,
platform: navigator.platform
}
}
fetch("/dark-flame-master", {
method: "POST",
credentials: "same-origin",
body: JSON.stringify(analytics)
})
}
}