Inject fingerprint with proxy.
Fingerprint (device fingerprint) is a set of techniques that allow a website to uniquely identify your computer.
Calculating a device's fingerprint begins when a user visits a website. The device fingerprint tracker collects all relevant information (version / browser type, OS, etc.). The interaction triggers the collection of a range of data (like the one listed above) that forms a special "hash" assigned to that specific device.
This page tells you how identifiable your browser is as a robot: https://bot.sannysoft.com/ and this module makes the tests on this page succeed on your chrome headless. See test
npm install
const InjectFingerprint = require('inject-fingerprint');
const ProxyServer = new InjectFingerprint();
// To start proxy
ProxyServer.start();
// To close proxy
ProxyServer.close();
Create Internal proxy to inject fingerprint
Type: object
Type: number
Default: 9333
Internal Proxy Port
Type: number
Default: 9334
Internal Proxy Web Interface Port
Type: number
Default: 9335
Additional Proxy Port when exist external proxy
Type: number
Default: 9336
Additional Proxy Web Interface Port when exist external proxy
Type: string
External proxy. Ex: http://host:port
Type: string
Default: /tmp
Path to save fingerprint file.
Note: The name of file is default
, you can change the script if you want. If file exist, it is loaded, else created.
Type: boolean
Default: true
If anyproxy
module log is verbose
Type: string
Default: null
Level log of module inject-fingerprint
. To logging action Ex: [silly, debug, warn, error, info, etc]
Note: Winston levels. To log something enter a level.
Start proxy server
Terminate the proxy server
Remove proxy server caches
/**
*
* @param {Number} [amount=1] Amount of time to delete
* @param {String} [keyTime='days'] Key of what time to delete (https://momentjs.com/docs/#/manipulating/add/)
* @example clearCache(30, 'minutes')
*/
Create and return new web driver
Type: string
Default: chrome
Browser name. Ex: chrome
Note: today only works with chrome
Type: boolean
Default: true
If the init browser in headless mode. Ex: true|false
Type: string
Default: en-US
Browser Language. https://developer.mozilla.org/pt-BR/docs/Web/API/NavigatorLanguage
Type: string
Default: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36]
Browser User Agent. https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Headers/User-Agent
npm test
call the test/fingerprint.test.js
file and this test open chrome browser mode headless and verify if is robot by test on the site https://bot.sannysoft.com/