fingerprint-generator
Advanced tools
Comparing version 2.1.4-dev.0 to 2.1.4
{ | ||
"name": "fingerprint-generator", | ||
"version": "2.1.4-dev.0", | ||
"version": "2.1.4", | ||
"description": "NodeJS package for generating realistic browser fingerprints.", | ||
@@ -36,7 +36,7 @@ "homepage": "https://github.com/apify/fingerprint-suite", | ||
"dependencies": { | ||
"generative-bayesian-network": "^2.1.4-dev.0", | ||
"header-generator": "^2.1.4-dev.1", | ||
"generative-bayesian-network": "^2.1.4", | ||
"header-generator": "^2.1.4", | ||
"tslib": "^2.4.0" | ||
}, | ||
"gitHead": "2ec381bab955fd48b60f63df478af89e97fa31e7" | ||
"gitHead": "cad86389acb7cfd756ee116cc20629ef08048eef" | ||
} |
@@ -39,27 +39,36 @@ <h1 align="center"> | ||
```javascript | ||
const { chromium } = require('playwright'); | ||
```typescript | ||
const { firefox } = require('playwright'); | ||
const { FingerprintGenerator } = require('fingerprint-generator'); | ||
const { FingerprintInjector } = require('fingerprint-injector'); | ||
const { FingerprintInjector } = require('fingerprint-injector'); | ||
(async () => { | ||
const b = await chromium.launch({headless: false}); | ||
const ctx = await b.newContext(); | ||
const fingerprintGenerator = new FingerprintGenerator(); | ||
const fingerprintGenerator = new FingerprintGenerator(); | ||
const browserFingerprintWithHeaders = fingerprintGenerator.getFingerprint({ | ||
devices: ['desktop'], | ||
browsers: ['chrome'], | ||
}); | ||
const fingerprintInjector = new FingerprintInjector(); | ||
const { fingerprint } = browserFingerprintWithHeaders; | ||
const fingerprint = fingerprintGenerator.getFingerprint({ | ||
'locales': ['cs-CZ'], // setup your desired fingerprint features | ||
'operatingSystems': ['linux'], | ||
const browser = await firefox.launch({ headless: false }); | ||
// With certain properties, we need to inject the props into the context initialization | ||
const context = await browser.newContext({ | ||
userAgent: fingerprint.userAgent, | ||
locale: fingerprint.navigator.language, | ||
viewport: fingerprint.screen, | ||
}); | ||
await fingerprintInjector.attachFingerprintToPlaywright(ctx, fingerprint); | ||
// Attach the rest of the fingerprint | ||
await fingerprintInjector.attachFingerprintToPlaywright(context, browserFingerprintWithHeaders); | ||
// ...and enjoy your undercover browser while using the browser context as usual! | ||
const page = await ctx.newPage(); | ||
await page.goto("https://apify.com"); | ||
const page = await context.newPage(); | ||
// ... your code using `page` here | ||
})(); | ||
``` | ||
## Performance | ||
<!-- ## Performance | ||
With ever-improving performance of antibot fingerprinting services, we use some of the industry-leading services to benchmark our performance. | ||
@@ -72,3 +81,3 @@ The following table shows how is the latest build of `fingerprint-suite` doing in tests provided by various open-source fingerprinting services. | ||
|BotD |![](https://byob.yarr.is/apify/fingerprint-suite/BotD) | | ||
|CreepJS |![](https://byob.yarr.is/apify/fingerprint-suite/CreepJS)| | ||
|CreepJS |![](https://byob.yarr.is/apify/fingerprint-suite/CreepJS)| --> | ||
@@ -82,3 +91,3 @@ ## Support | ||
Your code contributions are welcome and you'll be praised to eternity! | ||
Your code contributions are welcome and you'll be praised for eternity! | ||
If you have any ideas for improvements, either submit an issue or create a pull request. | ||
@@ -85,0 +94,0 @@ For contribution guidelines and the code of conduct, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1841958
0
98