Last active
December 16, 2015 02:59
-
-
Save luckyshot/5366726 to your computer and use it in GitHub Desktop.
Browser and client details in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************** | |
* Website | |
****************************************************/ | |
// Page title | |
document.title.substring(0, 200); | |
// Domain (i.e. gist.github.com) | |
document.domain; | |
// Returns object with host, path, protocol, port, hash... | |
document.location | |
// Referrer | |
document.referrer; | |
/**************************************************** | |
* System | |
****************************************************/ | |
// Returns object with UA, lang, platform, vendor... if undefined then call as 'window.navigator' | |
navigator; | |
// OS (i.e. MacIntel) | |
navigator.platform | |
// User Agent | |
navigator.userAgent; | |
// User language (i.e. en-US) | |
navigator.userLanguage || navigator.language; | |
/**************************************************** | |
* Dimensions | |
****************************************************/ | |
// Browser window dimensions | |
document.body.offsetHeight | |
document.body.offsetWidth | |
// Browser viewport dimensions | |
window.innerHeight | |
window.innerWidth | |
// Computer screen dimensions and color depth | |
screen.height | |
screen.width | |
screen.colorDepth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment