-
Notifications
You must be signed in to change notification settings - Fork 0
/
fingerprintGenerator.js
43 lines (35 loc) · 1.09 KB
/
fingerprintGenerator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import puppeteer from 'puppeteer';
import { FingerprintInjector } from 'fingerprint-injector';
import { FingerprintGenerator } from 'fingerprint-generator'
import fs from 'fs'
let fingerprintGenerator = new FingerprintGenerator()
let arr = []
for (let i = 0; i < 50000; i++) {
arr.push(fingerprintGenerator.getFingerprint())
}
// Save the array to a file as json
fs.writeFile('fingerprint.json', JSON.stringify(arr), (err) => {
if (err) {
throw err;
}
console.log("JSON data is saved.");
});
// (async () => {
// const browser = await puppeteer.launch({
// headless: false,
// });
//
//
// let fingerPrintInjector = new FingerprintInjector()
// let fingerPrintGenerator = new FingerprintGenerator()
//
// const fingerprint = fingerPrintGenerator.getFingerprint()
// console.log(fingerprint)
//
// const page = await browser.newPage()
//
// await fingerPrintInjector.attachFingerprintToPuppeteer(page, fingerprint)
//
// // ... your code using `page` here
// await page.goto('https://sarpsahinalp.github.io/fingerprint-frontend/');
// })();