0.0.1 • Published 5 months ago

fake-fingerprint v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

fake fingerprint

generate fake fingerprint of brower.

简体中文

Example

run fingerprint genreate.

no fake before:

before

fake after:

after

Install

npm install fake-fingerprint

Usage

import FakeFingerPrint from "fake-fingerprint";

const instance = new FakeFingerPrint({
  config: {
    /* navigator object of browser. can change it's some property. */
    navigator: {
      userAgent: "Custom UA",
      // more navigator value
    },
    /* screen object of browser. can change it's some property. */
    screen: {
      width: 9999,
      height: 88,
      // more screen value
    },
    canvas: {
      fillText: "hello fake",
    },
    audio: {
      strength: 100,
    },
    timezone: {
      zone: "America/New_York",
      locale: "en-US",
      offset: -5,
    },
    webGL: {
      driver: "ANGLE (NVIDIA GeForce GTX 1050 Ti Direct3D11 vs_5_0 ps_5_0)",
    },
    webRTC: {
      address: "127.0.0.1",
    },
  },
  /* 
    Report when the modified method is called or the properties of the proxy are accessed. 
    eg:{type:'navigator',key:'UserAgent'}  
  */
  report: (arg) => {
    console.log("arg:", arg);
  },
  /* report when these keys are accessed  */
  reportKeys: ["userAgent", "appVersion", "toDataURL"],
});

instance.open();

API

Arguments of FakeFingerPrint.

nameexplaintyperequired
configgenerate the configuration fake usesobjectno
reportwhen property or function to be visit. It‘s will be invokefunctionyes
reportKeysneed keys of report. default null, will report all keyskey[]no

Config:

nameexplainexample
navigatornavigator object of browser, You can configure UA,appAgent other navigator object information{userAgent: "Custom UA",appName: "123"}
screenscreen object of browser, You can configure width,height and other screen object information{width:8888,height:123}
canvaswhen invoked toDataURL, custom genereate fillText{fillText:'test'}
audiowhen genreate fingerprint. need add noise strength{strength: 100}
timezonecustom timezone info. offset is Offset equivalent to standard time, unit is hour{zone: "America/New_York",locale: "en-US",offset: -5}
webGLreutrn driver of information{driver: "ANGLE (NVIDIA GeForce GTX 1050 Ti Direct3D11 vs_5_0 ps_5_0)"}
webRTCcustrom ip address{address:"127.0.0.1"}

Instance Property.

nameexplaintypeexample
openopen configuration of fake fingerprint, If no parameter is specified, all configurations are enabled by defaultfunctioninstance.open('navigator','canvas')
closeclose configuration of fake fingerprint, If no parameter is specified, all configurations are closed by defaultfunctioninstance.close('navigator','canvas')
setset configuration of fake fingerprintfunctioninstance.set({ navigator: { userAgent: 'Custom UA' } })
getKeysStatusget the currently configured category usagefunction{close:'navigator','canvas',open:'canvas','webGL'}

License

MIT @hemengke1997

Inspiration

by my-fingerprint

0.0.1

5 months ago