Skip to content

Instantly share code, notes, and snippets.

@Enity
Last active May 30, 2018 22:39
Show Gist options
  • Save Enity/823c9735296c6ddfb628bfb4e6db5b33 to your computer and use it in GitHub Desktop.
Save Enity/823c9735296c6ddfb628bfb4e6db5b33 to your computer and use it in GitHub Desktop.
User info from js
const info = {
timeOpened:new Date(),
timezone:(new Date()).getTimezoneOffset()/60,
pageon(){return window.location.pathname},
referrer(){return document.referrer},
previousSites(){return history.length},
browserName(){return navigator.appName},
browserEngine(){return navigator.product},
browserVersion1a(){return navigator.appVersion},
browserVersion1b(){return navigator.userAgent},
browserLanguage(){return navigator.language},
browserOnline(){return navigator.onLine},
browserPlatform(){return navigator.platform},
javaEnabled(){return navigator.javaEnabled()},
dataCookiesEnabled(){return navigator.cookieEnabled},
dataCookies1(){return document.cookie},
dataCookies2(){return decodeURIComponent(document.cookie.split(";"))},
dataStorage(){return localStorage},
sizeScreenW(){return screen.width},
sizeScreenH(){return screen.height},
sizeDocW(){return document.width},
sizeDocH(){return document.height},
sizeInW(){return innerWidth},
sizeInH(){return innerHeight},
sizeAvailW(){return screen.availWidth},
sizeAvailH(){return screen.availHeight},
scrColorDepth(){return screen.colorDepth},
scrPixelDepth(){return screen.pixelDepth},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment