fingerprint-generator 2.0.0-beta.2 → 2.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,7 +178,7 @@
178
178
  APPENDIX: How to apply the Apache License to your work.
179
179
 
180
180
  To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
182
  replaced with your own identifying information. (Don't include
183
183
  the brackets!) The text should be enclosed in the appropriate
184
184
  comment syntax for the file format. We also recommend that a
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright 2018 Apify Technologies s.r.o.
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,170 +1,3 @@
1
- # Fingerprint generator
2
- NodeJs package for generating realistic browser fingerprints and matching headers.
3
-
4
- Works best with the [Fingerprint injector](https://github.com/apify/fingerprint-injector).
5
-
6
- <!-- toc -->
7
-
8
- - [Installation](#installation)
9
- - [Usage](#usage)
10
- - [Result example](#result-example)
11
- - [API Reference](#api-reference)
12
-
13
- <!-- tocstop -->
14
-
15
- ## Installation
16
- Run the `npm install fingerprint-generator` command. No further setup is needed afterwards.
17
- ## Usage
18
- To use the generator, you need to create an instance of the `FingerprintGenerator` class which is exported from this package. Constructor of this class accepts a `HeaderGeneratorOptions` object, which can be used to globally specify what kind of fingerprint and headers you are looking for:
19
- ```js
20
- const FingerprintGenerator = require('fingerprint-generator');
21
- let fingerprintGenerator = new FingerprintGenerator({
22
- browsers: [
23
- {name: "firefox", minVersion: 80},
24
- {name: "chrome", minVersion: 87},
25
- "safari"
26
- ],
27
- devices: [
28
- "desktop"
29
- ],
30
- operatingSystems: [
31
- "windows"
32
- ]
33
- });
34
- ```
35
- You can then get the fingerprint and headers using the `getFingerprint` method, either with no argument, or with another `HeaderGeneratorOptions` object, this time specifying the options only for this call (overwriting the global options when in conflict) and using the global options specified beforehands for the unspecified options:
36
- ```js
37
- let { fingerprint, headers } = fingerprintGenerator.getFingerprint({
38
- operatingSystems: [
39
- "linux"
40
- ],
41
- locales: ["en-US", "en"]
42
- });
43
- ```
44
- This method always generates a random realistic fingerprint and a matching set of headers, excluding the request dependant headers, which need to be filled in afterwards. Since the generation is randomized, multiple calls to this method with the same parameters can generate multiple different outputs.
45
- ## Result example
46
- Fingerprint that might be generated for the usage example above:
47
- ```json
48
- {
49
- "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0",
50
- "cookiesEnabled": true,
51
- "timezone": "Europe/Prague",
52
- "timezoneOffset": -60,
53
- "audioCodecs": {
54
- "ogg": "probably",
55
- "mp3": "maybe",
56
- "wav": "probably",
57
- "m4a": "maybe",
58
- "aac": "maybe"
59
- },
60
- "videoCodecs": {
61
- "ogg": "probably",
62
- "h264": "probably",
63
- "webm": "probably"
64
- },
65
- "videoCard": [
66
- "Intel Open Source Technology Center",
67
- "Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2)"
68
- ],
69
- "productSub": "20100101",
70
- "hardwareConcurrency": 8,
71
- "multimediaDevices": {
72
- "speakers": 0,
73
- "micros": 0,
74
- "webcams": 0
75
- },
76
- "platform": "Linux x86_64",
77
- "pluginsSupport": true,
78
- "screenResolution": [ 1920, 1080 ],
79
- "availableScreenResolution": [ 1920, 1080 ],
80
- "colorDepth": 24,
81
- "touchSupport": {
82
- "maxTouchPoints": 0,
83
- "touchEvent": false,
84
- "touchStart": false
85
- },
86
- "languages": [ "en-US", "en" ]
87
- }
88
- ```
89
- And the matching headers:
90
- ```json
91
- {
92
- "user-agent": "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0",
93
- "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
94
- "accept-language": "en-US,en;q=0.9",
95
- "accept-encoding": "gzip, deflate, br",
96
- "upgrade-insecure-requests": "1",
97
- "te": "trailers"
98
- }
99
- ```
100
- ## API Reference
101
- All public classes, methods and their parameters can be inspected in this API reference.
102
-
103
- <a name="FingerprintGenerator"></a>
104
-
105
- ### FingerprintGenerator
106
- Fingerprint generator - randomly generates realistic browser fingerprints
107
-
108
-
109
- * [FingerprintGenerator](#FingerprintGenerator)
110
- * [`new FingerprintGenerator(options)`](#new_FingerprintGenerator_new)
111
- * [`.getFingerprint(options, requestDependentHeaders)`](#FingerprintGenerator+getFingerprint)
112
-
113
-
114
- * * *
115
-
116
- <a name="new_FingerprintGenerator_new"></a>
117
-
118
- #### `new FingerprintGenerator(options)`
119
-
120
- | Param | Type | Description |
121
- | --- | --- | --- |
122
- | options | [<code>HeaderGeneratorOptions</code>](#HeaderGeneratorOptions) | default header generation options used unless overridden |
123
-
124
-
125
- * * *
126
-
127
- <a name="FingerprintGenerator+getFingerprint"></a>
128
-
129
- #### `fingerprintGenerator.getFingerprint(options, requestDependentHeaders)`
130
- Generates a fingerprint and a matching set of ordered headers using a combination of the default options specified in the constructor
131
- and their possible overrides provided here.
132
-
133
-
134
- | Param | Type | Description |
135
- | --- | --- | --- |
136
- | options | [<code>HeaderGeneratorOptions</code>](#HeaderGeneratorOptions) | specifies options that should be overridden for this one call |
137
- | requestDependentHeaders | <code>Object</code> | specifies known values of headers dependent on the particular request |
138
-
139
-
140
- * * *
141
-
142
- <a name="BrowserSpecification"></a>
143
-
144
- ### `BrowserSpecification`
145
-
146
- | Param | Type | Description |
147
- | --- | --- | --- |
148
- | name | <code>string</code> | One of `chrome`, `firefox` and `safari`. |
149
- | minVersion | <code>number</code> | Minimal version of browser used. |
150
- | maxVersion | <code>number</code> | Maximal version of browser used. |
151
- | httpVersion | <code>string</code> | Http version to be used to generate headers (the headers differ depending on the version). Either 1 or 2. If none specified the httpVersion specified in `HeaderGeneratorOptions` is used. |
152
-
153
-
154
- * * *
155
-
156
- <a name="HeaderGeneratorOptions"></a>
157
-
158
- ### `HeaderGeneratorOptions`
159
-
160
- | Param | Type | Description |
161
- | --- | --- | --- |
162
- | browsers | <code>Array.&lt;(BrowserSpecification\|string)&gt;</code> | List of BrowserSpecifications to generate the headers for, or one of `chrome`, `firefox` and `safari`. |
163
- | operatingSystems | <code>Array.&lt;string&gt;</code> | List of operating systems to generate the headers for. The options are `windows`, `macos`, `linux`, `android` and `ios`. |
164
- | devices | <code>Array.&lt;string&gt;</code> | List of devices to generate the headers for. Options are `desktop` and `mobile`. |
165
- | locales | <code>Array.&lt;string&gt;</code> | List of at most 10 languages to include in the [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) request header in the language format accepted by that header, for example `en`, `en-US` or `de`. |
166
- | httpVersion | <code>string</code> | Http version to be used to generate headers (the headers differ depending on the version). Can be either 1 or 2. Default value is 2. |
167
-
168
-
169
- * * *
1
+ # Fingerprint suite
170
2
 
3
+ This repository contains a set of fingerprinting tools developed by Apify.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PRESETS = void 0;
4
4
  const tslib_1 = require("tslib");
5
- (0, tslib_1.__exportStar)(require("./fingerprint-generator"), exports);
5
+ tslib_1.__exportStar(require("./fingerprint-generator"), exports);
6
6
  var header_generator_1 = require("header-generator");
7
7
  Object.defineProperty(exports, "PRESETS", { enumerable: true, get: function () { return header_generator_1.PRESETS; } });
8
8
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,63 +1,42 @@
1
1
  {
2
- "name": "fingerprint-generator",
3
- "version": "2.0.0-beta.2",
4
- "description": "NodeJs package for generating realistic browser fingerprints.",
5
- "homepage": "https://github.com/apify/fingerprint-generator#readme",
6
- "engines": {
7
- "node": ">=15.10.0"
8
- },
9
- "files": [
10
- "dist"
11
- ],
12
- "main": "dist/index.js",
13
- "module": "dist/index.mjs",
14
- "types": "dist/index.d.ts",
15
- "exports": {
16
- ".": {
17
- "import": "./dist/index.mjs",
18
- "require": "./dist/index.js"
19
- }
20
- },
21
- "scripts": {
22
- "build": "rimraf dist && tsc",
23
- "postbuild": "gen-esm-wrapper dist/index.js dist/index.mjs",
24
- "prepublishOnly": "npm run build",
25
- "lint": "eslint src test",
26
- "lint:fix": "eslint src test --fix",
27
- "test": "npm run build && jest",
28
- "build-docs": "npm run build && npm run build-toc && node docs/build-docs.js",
29
- "build-toc": "markdown-toc docs/README.md -i"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/apify/fingerprint-generator.git"
34
- },
35
- "author": "Apify",
36
- "license": "Apache-2.0",
37
- "bugs": {
38
- "url": "https://github.com/apify/fingerprint-generator/issues"
39
- },
40
- "dependencies": {
41
- "csv-parse": "^4.15.3",
42
- "generative-bayesian-network": "0.1.0-beta.1",
43
- "header-generator": "^2.0.0-beta.8",
44
- "ow": "^0.24.1",
45
- "tslib": "^2.3.1"
46
- },
47
- "devDependencies": {
48
- "@apify/eslint-config-ts": "^0.1.4",
49
- "@apify/tsconfig": "^0.1.0",
50
- "@types/jest": "^27.0.2",
51
- "@typescript-eslint/eslint-plugin": "^4.32.0",
52
- "@typescript-eslint/parser": "^4.32.0",
53
- "eslint": "^7.0.0",
54
- "gen-esm-wrapper": "^1.1.3",
55
- "jest": "^27.2.5",
56
- "jest-circus": "^27.2.4",
57
- "jsdoc-to-markdown": "^7.0.0",
58
- "markdown-toc": "^1.2.0",
59
- "ts-jest": "^27.0.5",
60
- "ts-node": "^10.2.1",
61
- "typescript": "^4.4.3"
62
- }
2
+ "name": "fingerprint-generator",
3
+ "version": "2.0.0-dev.1",
4
+ "description": "NodeJs package for generating realistic browser fingerprints.",
5
+ "homepage": "https://github.com/apify/fingerprint-generator#readme",
6
+ "engines": {
7
+ "node": ">=16.0.0"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "main": "index.js",
13
+ "module": "index.mjs",
14
+ "types": "index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "import": "./index.mjs",
18
+ "require": "./index.js"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "build": "npm run clean && npm run compile",
23
+ "postbuild": "cp -r src/data_files ",
24
+ "clean": "rimraf ./dist",
25
+ "compile": "tsc -p tsconfig.build.json && gen-esm-wrapper ./index.js ./index.mjs",
26
+ "copy": "ts-node -T ../../scripts/copy.ts"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/apify/fingerprint-generator.git"
31
+ },
32
+ "author": "Apify",
33
+ "license": "Apache-2.0",
34
+ "bugs": {
35
+ "url": "https://github.com/apify/fingerprint-generator/issues"
36
+ },
37
+ "dependencies": {
38
+ "generative-bayesian-network": "^2.0.0-dev.1",
39
+ "header-generator": "^2.0.0-dev.1"
40
+ },
41
+ "gitHead": "d6169bf8279ee467aa99d4fbd49cc7ecbf38a534"
63
42
  }
package/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- 3.0.0 / 2021/10/17
2
- ====================
3
- First stable version.
@@ -1,3 +0,0 @@
1
- export declare const STRINGIFIED_PREFIX: "*STRINGIFIED*";
2
- export declare const MISSING_VALUE_DATASET_TOKEN: "*MISSING_VALUE*";
3
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,iBAA2B,CAAC;AAC3D,eAAO,MAAM,2BAA2B,mBAA6B,CAAC"}
package/dist/constants.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MISSING_VALUE_DATASET_TOKEN = exports.STRINGIFIED_PREFIX = void 0;
4
- exports.STRINGIFIED_PREFIX = '*STRINGIFIED*';
5
- exports.MISSING_VALUE_DATASET_TOKEN = '*MISSING_VALUE*';
6
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAC9C,QAAA,2BAA2B,GAAG,iBAA0B,CAAC"}