GithubHelp home page GithubHelp logo

00mjk / clientjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jackspirou/clientjs

0.0 0.0 0.0 906 KB

Device information and digital fingerprinting written in pure JavaScript.

Home Page: http://clientjs.org

License: Apache License 2.0

Shell 3.73% JavaScript 96.27%

clientjs's Introduction

Sauce Test Status

Device information and digital fingerprinting written in pure JavaScript.

Sauce Test Status Build Status Aircover Coverage Kanban board for ClientJS issues at https://huboard.com/jackspirou/clientjs Join the chat at https://gitter.im/jackspirou/clientjs

Sauce Test Status

ClientJS is a JavaScript library that makes digital fingerprinting easy, while also exposing all the browser data-points used in generating fingerprints.

If you want to fingerprint browsers, you are probably also interested in other client-based information, such as screen resolution, operating system, browser type, device type, and much more.

Below are some features that make ClientJS different from other fingerprinting libraries:

  • It's pure native JavaScript
  • It's decently lightweight at ~45 KB
  • All user data points are available by design, not just the 32bit integer fingerprint

Documentation and Demos

You can find more documentation and demos on each method at clientjs.org.

Installation

To use ClientJS, simply include dist/client.min.js.

ClientJS is available for download via bower and npm.

npm

npm install clientjs

Bower

bower install clientjs

Fingerprinting

Digital fingerprints are based on device/browser settings. They allow you to make an "educated guess" about the identify of a new or returning visitor. By taking multiple data points, combining them, and representing them as a number, you can be surprisingly accurate at recognizing not only browsers and devices, but also individual users.

This is useful for identifying users or devices without cookies or sessions. It is not a full proof technique, but it has been shown to be statistically significant at accurately identifying devices.

Simply create a new ClientJS object. Then call the getFingerprint() method which will return the browser/device fingerprint as a 32bit integer hash ID.

Below is an example of how to generate and display a fingerprint:

// Create a new ClientJS object
var client = new ClientJS();

// Get the client's fingerprint id
var fingerprint = client.getFingerprint();

// Print the 32bit hash id to the console
console.log(fingerprint);

The current data-points that used to generate fingerprint 32bit integer hash ID is listed below:

  • user agent
  • screen print
  • color depth
  • current resolution
  • available resolution
  • device XDPI
  • device YDPI
  • plugin list
  • font list
  • local storage
  • session storage
  • timezone
  • language
  • system language
  • cookies
  • canvas print

Available Methods

Below is the current list of available methods to find information on a users browser/device.

You can find documentation on each method at clientjs.org.

  var client = new ClientJS();

  client.getBrowserData();
  client.getFingerprint();
  client.getCustomFingerprint(...);

  client.getUserAgent();
  client.getUserAgentLowerCase();

  client.getBrowser();
  client.getBrowserVersion();
  client.getBrowserMajorVersion();
  client.isIE();
  client.isChrome();
  client.isFirefox();
  client.isSafari();
  client.isOpera();

  client.getEngine();
  client.getEngineVersion();

  client.getOS();
  client.getOSVersion();
  client.isWindows();
  client.isMac();
  client.isLinux();
  client.isUbuntu();
  client.isSolaris();

  client.getDevice();
  client.getDeviceType();
  client.getDeviceVendor();

  client.getCPU();

  client.isMobile();
  client.isMobileMajor();
  client.isMobileAndroid();
  client.isMobileOpera();
  client.isMobileWindows();
  client.isMobileBlackBerry();

  client.isMobileIOS();
  client.isIphone();
  client.isIpad();
  client.isIpod();

  client.getScreenPrint();
  client.getColorDepth();
  client.getCurrentResolution();
  client.getAvailableResolution();
  client.getDeviceXDPI();
  client.getDeviceYDPI();

  client.getPlugins();
  client.isJava();
  client.getJavaVersion();
  client.isFlash();
  client.getFlashVersion();
  client.isSilverlight();
  client.getSilverlightVersion();

  client.getMimeTypes();
  client.isMimeTypes();

  client.isFont();
  client.getFonts();

  client.isLocalStorage();
  client.isSessionStorage();
  client.isCookie();

  client.getTimeZone();

  client.getLanguage();
  client.getSystemLanguage();

  client.isCanvas();
  client.getCanvasPrint();

Shoulders of Giants

It is important to note this project owes much to other pieces great works. We had the advantage of observing how others had approached this problem.

Built Upon:

  • https:github.com/Valve/fingerprintjs
  • http:darkwavetech.com/device_fingerprint.html
  • detectmobilebrowsers.com

Vendor Code

All dependencies are included into client.min.js when the build.sh bash file minifies the project. Vendored dependencies should not be included separately.

Dependencies Include:

  • ua-parser.js
  • fontdetect.js
  • swfobject.js
  • murmurhash3.js

Contributing

Collaborate by forking this project and sending a Pull Request this way.

Once cloned, install all dependencies. ClientJS uses Karma as its testing environment.

# Install dependencies
$ npm install

# If you want tu run karma from the command line
$ npm install -g karma-cli

Run Karma and enjoy coding!

$ karma start

Thanks for contributing to ClientJS! Please report any bug here.

LICENSE

This project is using the Apache LICENSE Version 2.0. It is included in the project source code.

clientjs's People

Contributors

alexeystadnikov-okta avatar bajb avatar bilalyasar avatar dsmontoya avatar gitter-badger avatar jackspirou avatar julionc avatar nickarnold avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.