@ginger-ai/ginger-js 0.0.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.
- package/README.md +88 -0
- package/dist/ginger.cjs.js +2 -0
- package/dist/ginger.cjs.js.map +1 -0
- package/dist/ginger.esm.d.ts +294 -0
- package/dist/ginger.esm.js +2 -0
- package/dist/ginger.esm.js.map +1 -0
- package/dist/ginger.umd.js +2 -0
- package/dist/ginger.umd.js.map +1 -0
- package/dist/types/behaviour/index.d.ts +49 -0
- package/dist/types/behaviour/index.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +35 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/core/constants.d.ts +5 -0
- package/dist/types/core/constants.d.ts.map +1 -0
- package/dist/types/core/dto/bot-detector.dto.d.ts +30 -0
- package/dist/types/core/dto/bot-detector.dto.d.ts.map +1 -0
- package/dist/types/core/dto/device-detector.dto.d.ts +54 -0
- package/dist/types/core/dto/device-detector.dto.d.ts.map +1 -0
- package/dist/types/core/dto/fingerprint.dto.d.ts +29 -0
- package/dist/types/core/dto/fingerprint.dto.d.ts.map +1 -0
- package/dist/types/core/dto/ginger.dto.d.ts +73 -0
- package/dist/types/core/dto/ginger.dto.d.ts.map +1 -0
- package/dist/types/core/dto/incognito-detector.dto.d.ts +4 -0
- package/dist/types/core/dto/incognito-detector.dto.d.ts.map +1 -0
- package/dist/types/core/dto/index.d.ts +10 -0
- package/dist/types/core/dto/index.d.ts.map +1 -0
- package/dist/types/core/dto/metrics.dto.d.ts +19 -0
- package/dist/types/core/dto/metrics.dto.d.ts.map +1 -0
- package/dist/types/core/dto/os-detector.dto.d.ts +6 -0
- package/dist/types/core/dto/os-detector.dto.d.ts.map +1 -0
- package/dist/types/core/dto/tor-detector.dto.d.ts +5 -0
- package/dist/types/core/dto/tor-detector.dto.d.ts.map +1 -0
- package/dist/types/core/helpers.d.ts +8 -0
- package/dist/types/core/helpers.d.ts.map +1 -0
- package/dist/types/core/http/httpClient.d.ts +28 -0
- package/dist/types/core/http/httpClient.d.ts.map +1 -0
- package/dist/types/core/http/request.d.ts +4 -0
- package/dist/types/core/http/request.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +6 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/util/error.d.ts +25 -0
- package/dist/types/core/util/error.d.ts.map +1 -0
- package/dist/types/core/util/generate-requestid.d.ts +2 -0
- package/dist/types/core/util/generate-requestid.d.ts.map +1 -0
- package/dist/types/device/components/audio/audio.d.ts +2 -0
- package/dist/types/device/components/audio/audio.d.ts.map +1 -0
- package/dist/types/device/components/canvas/canvas.d.ts +3 -0
- package/dist/types/device/components/canvas/canvas.d.ts.map +1 -0
- package/dist/types/device/components/extra/extra.d.ts +19 -0
- package/dist/types/device/components/extra/extra.d.ts.map +1 -0
- package/dist/types/device/components/fonts/fonts.d.ts +3 -0
- package/dist/types/device/components/fonts/fonts.d.ts.map +1 -0
- package/dist/types/device/components/hardware/hardware.d.ts +2 -0
- package/dist/types/device/components/hardware/hardware.d.ts.map +1 -0
- package/dist/types/device/components/index.d.ts +15 -0
- package/dist/types/device/components/index.d.ts.map +1 -0
- package/dist/types/device/components/locales/locales.d.ts +2 -0
- package/dist/types/device/components/locales/locales.d.ts.map +1 -0
- package/dist/types/device/components/math/math.d.ts +2 -0
- package/dist/types/device/components/math/math.d.ts.map +1 -0
- package/dist/types/device/components/permissions/permissions.d.ts +3 -0
- package/dist/types/device/components/permissions/permissions.d.ts.map +1 -0
- package/dist/types/device/components/plugins/plugins.d.ts +3 -0
- package/dist/types/device/components/plugins/plugins.d.ts.map +1 -0
- package/dist/types/device/components/screen/screen.d.ts +2 -0
- package/dist/types/device/components/screen/screen.d.ts.map +1 -0
- package/dist/types/device/components/screen/screenResolution.d.ts +16 -0
- package/dist/types/device/components/screen/screenResolution.d.ts.map +1 -0
- package/dist/types/device/components/system/browser.d.ts +22 -0
- package/dist/types/device/components/system/browser.d.ts.map +1 -0
- package/dist/types/device/components/system/emoji.d.ts +2 -0
- package/dist/types/device/components/system/emoji.d.ts.map +1 -0
- package/dist/types/device/components/system/system.d.ts +2 -0
- package/dist/types/device/components/system/system.d.ts.map +1 -0
- package/dist/types/device/components/webgl/imageHash.d.ts +3 -0
- package/dist/types/device/components/webgl/imageHash.d.ts.map +1 -0
- package/dist/types/device/components/webgl/webgl.d.ts +54 -0
- package/dist/types/device/components/webgl/webgl.d.ts.map +1 -0
- package/dist/types/device/factory.d.ts +26 -0
- package/dist/types/device/factory.d.ts.map +1 -0
- package/dist/types/device/index.d.ts +61 -0
- package/dist/types/device/index.d.ts.map +1 -0
- package/dist/types/device/modules/bot.d.ts +9 -0
- package/dist/types/device/modules/bot.d.ts.map +1 -0
- package/dist/types/device/modules/browserDetails.d.ts +6 -0
- package/dist/types/device/modules/browserDetails.d.ts.map +1 -0
- package/dist/types/device/modules/device/analyze-data.d.ts +7 -0
- package/dist/types/device/modules/device/analyze-data.d.ts.map +1 -0
- package/dist/types/device/modules/device/gather-data.d.ts +6 -0
- package/dist/types/device/modules/device/gather-data.d.ts.map +1 -0
- package/dist/types/device/modules/device/helpers.d.ts +9 -0
- package/dist/types/device/modules/device/helpers.d.ts.map +1 -0
- package/dist/types/device/modules/device/index.d.ts +3 -0
- package/dist/types/device/modules/device/index.d.ts.map +1 -0
- package/dist/types/device/modules/fp.d.ts +14 -0
- package/dist/types/device/modules/fp.d.ts.map +1 -0
- package/dist/types/device/modules/incognito.d.ts +7 -0
- package/dist/types/device/modules/incognito.d.ts.map +1 -0
- package/dist/types/device/modules/options.d.ts +12 -0
- package/dist/types/device/modules/options.d.ts.map +1 -0
- package/dist/types/device/modules/os.d.ts +3 -0
- package/dist/types/device/modules/os.d.ts.map +1 -0
- package/dist/types/device/modules/tor.d.ts +4 -0
- package/dist/types/device/modules/tor.d.ts.map +1 -0
- package/dist/types/device/utils/async.d.ts +33 -0
- package/dist/types/device/utils/async.d.ts.map +1 -0
- package/dist/types/device/utils/browser_.d.ts +103 -0
- package/dist/types/device/utils/browser_.d.ts.map +1 -0
- package/dist/types/device/utils/commonPixels.d.ts +2 -0
- package/dist/types/device/utils/commonPixels.d.ts.map +1 -0
- package/dist/types/device/utils/data.d.ts +33 -0
- package/dist/types/device/utils/data.d.ts.map +1 -0
- package/dist/types/device/utils/dom.d.ts +26 -0
- package/dist/types/device/utils/dom.d.ts.map +1 -0
- package/dist/types/device/utils/ephemeralIFrame.d.ts +5 -0
- package/dist/types/device/utils/ephemeralIFrame.d.ts.map +1 -0
- package/dist/types/device/utils/getMostFrequent.d.ts +6 -0
- package/dist/types/device/utils/getMostFrequent.d.ts.map +1 -0
- package/dist/types/device/utils/hash.d.ts +6 -0
- package/dist/types/device/utils/hash.d.ts.map +1 -0
- package/dist/types/device/utils/misc.d.ts +7 -0
- package/dist/types/device/utils/misc.d.ts.map +1 -0
- package/dist/types/device/utils/raceAll.d.ts +9 -0
- package/dist/types/device/utils/raceAll.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +52 -0
- package/src/behaviour/index.ts +279 -0
- package/src/client/index.ts +132 -0
- package/src/core/constants.ts +4 -0
- package/src/core/dto/bot-detector.dto.ts +32 -0
- package/src/core/dto/device-detector.dto.ts +67 -0
- package/src/core/dto/fingerprint.dto.ts +38 -0
- package/src/core/dto/ginger.dto.ts +89 -0
- package/src/core/dto/incognito-detector.dto.ts +2 -0
- package/src/core/dto/index.ts +18 -0
- package/src/core/dto/metrics.dto.ts +20 -0
- package/src/core/dto/os-detector.dto.ts +5 -0
- package/src/core/dto/tor-detector.dto.ts +4 -0
- package/src/core/helpers.ts +33 -0
- package/src/core/http/httpClient.ts +52 -0
- package/src/core/http/request.ts +32 -0
- package/src/core/index.ts +5 -0
- package/src/core/util/error.ts +40 -0
- package/src/core/util/generate-requestid.ts +63 -0
- package/src/device/components/audio/audio.ts +58 -0
- package/src/device/components/canvas/canvas.ts +88 -0
- package/src/device/components/extra/extra.ts +581 -0
- package/src/device/components/fonts/fonts.ts +143 -0
- package/src/device/components/hardware/hardware.ts +66 -0
- package/src/device/components/index.ts +14 -0
- package/src/device/components/locales/locales.ts +21 -0
- package/src/device/components/math/math.ts +39 -0
- package/src/device/components/permissions/permissions.ts +60 -0
- package/src/device/components/plugins/plugins.ts +22 -0
- package/src/device/components/screen/screen.ts +13 -0
- package/src/device/components/screen/screenResolution.ts +45 -0
- package/src/device/components/system/browser.ts +838 -0
- package/src/device/components/system/emoji.ts +134 -0
- package/src/device/components/system/system.ts +76 -0
- package/src/device/components/webgl/imageHash.ts +144 -0
- package/src/device/components/webgl/webgl.ts +302 -0
- package/src/device/factory.ts +54 -0
- package/src/device/index.ts +60 -0
- package/src/device/modules/bot.ts +25 -0
- package/src/device/modules/browserDetails.ts +11 -0
- package/src/device/modules/device/analyze-data.ts +150 -0
- package/src/device/modules/device/gather-data.ts +92 -0
- package/src/device/modules/device/helpers.ts +123 -0
- package/src/device/modules/device/index.ts +64 -0
- package/src/device/modules/fp.ts +138 -0
- package/src/device/modules/incognito.ts +253 -0
- package/src/device/modules/options.ts +17 -0
- package/src/device/modules/os.ts +15 -0
- package/src/device/modules/tor.ts +41 -0
- package/src/device/utils/async.ts +106 -0
- package/src/device/utils/browser_.ts +347 -0
- package/src/device/utils/commonPixels.ts +38 -0
- package/src/device/utils/data.ts +161 -0
- package/src/device/utils/dom.ts +148 -0
- package/src/device/utils/ephemeralIFrame.ts +35 -0
- package/src/device/utils/getMostFrequent.ts +39 -0
- package/src/device/utils/hash.ts +202 -0
- package/src/device/utils/misc.ts +18 -0
- package/src/device/utils/raceAll.ts +19 -0
- package/src/index.ts +3 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type ScreenResolution = [number | null, number | null];
|
|
2
|
+
/**
|
|
3
|
+
* A version of the entropy source with stabilization to make it suitable for static fingerprinting.
|
|
4
|
+
* The window resolution is always the document size in private mode of Safari 17,
|
|
5
|
+
* so the window resolution is not used in Safari 17.
|
|
6
|
+
*/
|
|
7
|
+
export default function getScreenResolution(): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* A version of the entropy source without stabilization.
|
|
10
|
+
*
|
|
11
|
+
* Warning for package users:
|
|
12
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getUnstableScreenResolution(): ScreenResolution;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=screenResolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenResolution.d.ts","sourceRoot":"","sources":["../../../../src/device/components/screen/screenResolution.ts"],"names":[],"mappings":"AAQA,KAAK,gBAAgB,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAEvD;;;;GAIG;AACH,wBAA8B,mBAAmB,IAAI,OAAO,CAAC,GAAG,CAAC,CAMhE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,IAAI,gBAAgB,CAa9D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type BrowserDetails = {
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
confidence: number;
|
|
5
|
+
engine: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Detect browser using multiple techniques to be resilient against spoofing and user agent changes
|
|
9
|
+
*/
|
|
10
|
+
export declare function getBrowserName(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Enhanced browser detection that uses multiple techniques to identify the browser
|
|
13
|
+
* with high confidence even when user agent is spoofed or in mobile simulation mode
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectBrowser(): BrowserDetails;
|
|
16
|
+
interface BrowserResult {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function getBrowser(): BrowserResult;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../src/device/components/system/browser.ts"],"names":[],"mappings":"AACA,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,cAAc,CAuF9C;AA8pBD,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,IAAI,aAAa,CAuD1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emoji.d.ts","sourceRoot":"","sources":["../../../../src/device/components/system/emoji.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/device/components/system/system.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageHash.d.ts","sourceRoot":"","sources":["../../../../src/device/components/webgl/imageHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAG,MAAM,eAAe,CAAA;AAkBnD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAqBtF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { componentInterface } from "../../factory";
|
|
2
|
+
/**
|
|
3
|
+
* WebGL extended features
|
|
4
|
+
*/
|
|
5
|
+
type WebGlExtensionsPayload = {
|
|
6
|
+
contextAttributes: string[];
|
|
7
|
+
parameters: string[];
|
|
8
|
+
shaderPrecisions: string[];
|
|
9
|
+
extensions: string[] | null;
|
|
10
|
+
extensionParameters: string[];
|
|
11
|
+
unsupportedExtensions: string[];
|
|
12
|
+
};
|
|
13
|
+
type CanvasContext = WebGLRenderingContext & {
|
|
14
|
+
readonly canvas: HTMLCanvasElement;
|
|
15
|
+
};
|
|
16
|
+
type Options = {
|
|
17
|
+
cache: {
|
|
18
|
+
webgl?: {
|
|
19
|
+
context: CanvasContext | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** WebGl context is not available */
|
|
24
|
+
export declare const STATUS_NO_GL_CONTEXT = -1;
|
|
25
|
+
/** WebGL context `getParameter` method is not a function */
|
|
26
|
+
export declare const STATUS_GET_PARAMETER_NOT_A_FUNCTION = -2;
|
|
27
|
+
export type SpecialStatus = typeof STATUS_NO_GL_CONTEXT | typeof STATUS_GET_PARAMETER_NOT_A_FUNCTION;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the basic and simple WebGL parameters
|
|
30
|
+
*/
|
|
31
|
+
export declare function getWebGlBasics({ cache }?: Options): Promise<componentInterface>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the advanced and massive WebGL parameters and extensions
|
|
34
|
+
*/
|
|
35
|
+
export declare function getWebGlExtensions({ cache }?: Options): Promise<WebGlExtensionsPayload | SpecialStatus>;
|
|
36
|
+
/**
|
|
37
|
+
* This function usually takes the most time to execute in all the sources, therefore we cache its result.
|
|
38
|
+
*
|
|
39
|
+
* Warning for package users:
|
|
40
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getWebGLContext(cache: Options["cache"]): CanvasContext | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Some browsers print a console warning when the WEBGL_debug_renderer_info extension is requested.
|
|
45
|
+
* JS Agent aims to avoid printing messages to console, so we avoid this extension in that browsers.
|
|
46
|
+
*/
|
|
47
|
+
export declare function shouldAvoidDebugRendererInfo(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Some browsers print a console warning when the WEBGL_polygon_mode extension is requested.
|
|
50
|
+
* JS Agent aims to avoid printing messages to console, so we avoid this extension in that browsers.
|
|
51
|
+
*/
|
|
52
|
+
export declare function shouldAvoidPolygonModeExtensions(): boolean;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=webgl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../../../../src/device/components/webgl/webgl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,eAAe,CAAC;AAQrE;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEF,KAAK,aAAa,GAAG,qBAAqB,GAAG;IAC3C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE;QACL,KAAK,CAAC,EAAE;YACN,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;SACpC,CAAC;KACH,CAAC;CACH,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,4DAA4D;AAC5D,eAAO,MAAM,mCAAmC,KAAK,CAAC;AAEtD,MAAM,MAAM,aAAa,GACrB,OAAO,oBAAoB,GAC3B,OAAO,mCAAmC,CAAC;AAqC/C;;GAEG;AACH,wBAAsB,cAAc,CAClC,EAAE,KAAU,EAAE,GAAE,OAAuB,GACtC,OAAO,CAAC,kBAAkB,CAAC,CA8B7B;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,KAAU,EAAE,GAAE,OAAuB,GACtC,OAAO,CAAC,sBAAsB,GAAG,aAAa,CAAC,CA2FjD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,6BA0BtD;AAmCD;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAE1D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface componentInterface {
|
|
2
|
+
[key: string]: string | string[] | number | boolean | componentInterface;
|
|
3
|
+
}
|
|
4
|
+
export interface componentFunctionInterface {
|
|
5
|
+
(): Promise<componentInterface>;
|
|
6
|
+
}
|
|
7
|
+
export declare const components: {
|
|
8
|
+
[name: string]: componentFunctionInterface;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* includeComponent is the function each component function needs to call in order for the component to be included
|
|
12
|
+
* in the fingerprint.
|
|
13
|
+
* @param {string} name - the name identifier of the component
|
|
14
|
+
* @param {componentFunctionInterface} creationFunction - the function that implements the component
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare const includeComponent: (name: string, creationFunction: componentFunctionInterface) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The function turns the map of component functions to a map of Promises when called
|
|
20
|
+
* @returns {[name: string]: <Promise>componentInterface}
|
|
21
|
+
*/
|
|
22
|
+
export declare const getComponentPromises: () => {
|
|
23
|
+
[k: string]: Promise<componentInterface>;
|
|
24
|
+
};
|
|
25
|
+
export declare const timeoutInstance: componentInterface;
|
|
26
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/device/factory.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,kBAAkB,CAAC;CAC5E;AAID,MAAM,WAAW,0BAA0B;IACvC,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnC;AAGD,eAAO,MAAM,UAAU,EAAE;IAAC,CAAC,IAAI,EAAE,MAAM,GAAG,0BAA0B,CAAA;CAAM,CAAC;AAG3E;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAK,MAAM,EAAE,kBAAkB,0BAA0B,SAGzF,CAAA;AAGD;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;CAchC,CAAA;AAGD,eAAO,MAAM,eAAe,EAAE,kBAE7B,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getFingerprint } from './modules/fp';
|
|
2
|
+
import { detectTorBrowser } from './modules/tor';
|
|
3
|
+
import { detectIncognito } from './modules/incognito';
|
|
4
|
+
import { botDetection } from './modules/bot';
|
|
5
|
+
import { detectBrowser } from './components/system/browser';
|
|
6
|
+
import { getOs } from './modules/os';
|
|
7
|
+
import { getDeviceDetails } from './modules/device';
|
|
8
|
+
import { getBrowserDetails } from './modules/browserDetails';
|
|
9
|
+
import './components';
|
|
10
|
+
export { getFingerprint, detectTorBrowser, detectIncognito, botDetection, detectBrowser, getOs, getDeviceDetails, getBrowserDetails };
|
|
11
|
+
interface SdkInfo {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const buildInitialPayload: (request_id: string, sdkInfo: SdkInfo) => Promise<{
|
|
16
|
+
request_id: string;
|
|
17
|
+
device: {
|
|
18
|
+
fingerprint_id: string;
|
|
19
|
+
type: string;
|
|
20
|
+
os: "ios" | "android" | "windows" | "macos" | "linux" | null;
|
|
21
|
+
os_version: string | undefined;
|
|
22
|
+
raw_device_data: import("../core/dto/fingerprint.dto").RawDeviceData;
|
|
23
|
+
browserDetails: {
|
|
24
|
+
name: string;
|
|
25
|
+
version: string;
|
|
26
|
+
user_agent: string;
|
|
27
|
+
};
|
|
28
|
+
bot: {
|
|
29
|
+
status: boolean;
|
|
30
|
+
botKind: import("@fingerprintjs/botd").BotKind;
|
|
31
|
+
} | {
|
|
32
|
+
status: boolean;
|
|
33
|
+
botKind?: undefined;
|
|
34
|
+
} | null;
|
|
35
|
+
tampering: import("../core").deviceTampering;
|
|
36
|
+
incognito: {
|
|
37
|
+
status: boolean;
|
|
38
|
+
browser_name: string;
|
|
39
|
+
};
|
|
40
|
+
tor: import("../core").TorDetectionResult;
|
|
41
|
+
};
|
|
42
|
+
sdk: {
|
|
43
|
+
name: string;
|
|
44
|
+
version: string;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
export declare function fetchModules(): Promise<[import("../core").GingerJsFp, import("../core").TorDetectionResult, {
|
|
48
|
+
status: boolean;
|
|
49
|
+
botKind: import("@fingerprintjs/botd").BotKind;
|
|
50
|
+
} | {
|
|
51
|
+
status: boolean;
|
|
52
|
+
botKind?: undefined;
|
|
53
|
+
} | null, {
|
|
54
|
+
status: boolean;
|
|
55
|
+
browser_name: string;
|
|
56
|
+
}, import("../core").DeviceOs, import("../core").RefinedDeviceResults, {
|
|
57
|
+
name: string;
|
|
58
|
+
version: string;
|
|
59
|
+
user_agent: string;
|
|
60
|
+
}]>;
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA;AAErI,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,GAAU,YAAY,MAAM,EAAE,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B7E,CAAC;AAEF,wBAAsB,YAAY;;;;;;;;;;;;;IAUjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../../src/device/modules/bot.ts"],"names":[],"mappings":"AAEA,iBAAe,YAAY;;;;;;UAoB1B;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserDetails.d.ts","sourceRoot":"","sources":["../../../src/device/modules/browserDetails.ts"],"names":[],"mappings":"AAEA,wBAAsB,iBAAiB;;;;GAQtC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeviceResults } from '../../../core';
|
|
2
|
+
type ClaimedData = DeviceResults['claimed'];
|
|
3
|
+
type SignalData = DeviceResults['signals'];
|
|
4
|
+
type AnalysisData = DeviceResults['analysis'];
|
|
5
|
+
export declare const analyzeSpoofing: (claimed: ClaimedData, signals: SignalData) => AnalysisData;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=analyze-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-data.d.ts","sourceRoot":"","sources":["../../../../src/device/modules/device/analyze-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyB,MAAM,eAAe,CAAC;AAGrE,KAAK,WAAW,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAC5C,KAAK,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAC3C,KAAK,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,EAAE,SAAS,UAAU,KAAG,YA8I3E,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeviceResults, ClaimedDevice } from '../../../core';
|
|
2
|
+
type SignalData = DeviceResults['signals'];
|
|
3
|
+
export declare const getClaimedData: (userAgentString: string) => Promise<ClaimedDevice>;
|
|
4
|
+
export declare const getSignalData: () => SignalData;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=gather-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gather-data.d.ts","sourceRoot":"","sources":["../../../../src/device/modules/device/gather-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI7D,KAAK,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAG3C,eAAO,MAAM,cAAc,GAAU,iBAAiB,MAAM,KAAG,OAAO,CAAC,aAAa,CA2CnF,CAAC;AAGF,eAAO,MAAM,aAAa,QAAO,UAsChC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AllowedOs, DeviceType } from '../../../core';
|
|
2
|
+
export declare const normalizeOs: (platform: string | undefined | null) => AllowedOs | null;
|
|
3
|
+
export declare const detectActualOs: (renderer: string) => AllowedOs | null;
|
|
4
|
+
export declare const determineDeviceType: (claimedMobile: boolean | null, hasTouch: boolean, screenWidth: number, realOs: AllowedOs | null) => DeviceType | null;
|
|
5
|
+
export declare const guessDeviceTypeFromUA: (ua: string) => DeviceType | null;
|
|
6
|
+
export declare const convertToTwoDP: (num: number) => number;
|
|
7
|
+
export declare const isAllowedOs: (os: string) => os is AllowedOs;
|
|
8
|
+
export declare const isAllowedDeviceType: (type: DeviceType | null) => type is DeviceType;
|
|
9
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/device/modules/device/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,UAAU,EACX,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,GAAG,SAAS,GAAG,IAAI,KAClC,SAAS,GAAG,IAkBd,CAAC;AAWF,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,SAAS,GAAG,IAiB7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,eAAe,OAAO,GAAG,IAAI,EAC7B,UAAU,OAAO,EACjB,aAAa,MAAM,EACnB,QAAQ,SAAS,GAAG,IAAI,KACvB,UAAU,GAAG,IAuBf,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG,UAAU,GAAG,IAoB/D,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAE5C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,KAAG,EAAE,IAAI,SAE9C,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,MAAM,UAAU,GAAG,IAAI,KACtB,IAAI,IAAI,UAEV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/device/modules/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAGrB,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,oBAAoB,CAuDrE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GingerJsFp } from "../../core";
|
|
2
|
+
import { componentInterface } from "../factory";
|
|
3
|
+
export declare function getFingerprintData(): Promise<componentInterface>;
|
|
4
|
+
/**
|
|
5
|
+
* This function filters the fingerprint data based on the exclude and include list
|
|
6
|
+
* @param {componentInterface} obj - components objects from main componentInterface
|
|
7
|
+
* @param {string[]} excludeList - elements to exclude from components objects (e.g : 'canvas', 'system.browser')
|
|
8
|
+
* @param {string[]} includeList - elements to only include from components objects (e.g : 'canvas', 'system.browser')
|
|
9
|
+
* @param {string} path - auto-increment path iterating on key objects from components objects
|
|
10
|
+
* @returns {componentInterface} result - returns the final object before hashing in order to get fingerprint
|
|
11
|
+
*/
|
|
12
|
+
export declare function filterFingerprintData(obj: componentInterface, excludeList: string[], includeList: string[], path?: string): componentInterface;
|
|
13
|
+
export declare function getFingerprint(): Promise<GingerJsFp>;
|
|
14
|
+
//# sourceMappingURL=fp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fp.d.ts","sourceRoot":"","sources":["../../../src/device/modules/fp.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kBAAkB,EAGnB,MAAM,YAAY,CAAC;AAKpB,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAgCtE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,kBAAkB,EACvB,WAAW,EAAE,MAAM,EAAE,EACrB,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,GAAE,MAAW,GAChB,kBAAkB,CA8BpB;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CAe1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incognito.d.ts","sourceRoot":"","sources":["../../../src/device/modules/incognito.ts"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,iBAAe,eAAe,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAqP5D;AAEP,OAAO,EAAC,eAAe,EAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface optionsInterface {
|
|
2
|
+
exclude: string[];
|
|
3
|
+
include: string[];
|
|
4
|
+
webgl_runs?: number;
|
|
5
|
+
canvas_runs?: number;
|
|
6
|
+
permissions_to_check?: PermissionName[];
|
|
7
|
+
retries?: number;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
logging: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare let options: optionsInterface;
|
|
12
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/device/modules/options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,cAAc,EAAE,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,IAAI,OAAO,EAAE,gBAInB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../../src/device/modules/os.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,KAAK,QAAa,OAAO,CAAC,QAAQ,CAI9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tor.d.ts","sourceRoot":"","sources":["../../../src/device/modules/tor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,iBAAe,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAkB7D;AAoBD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type MaybePromise<T> = Promise<T> | T;
|
|
2
|
+
export declare function wait<T = void>(durationMs: number, resolveWith?: T): Promise<T>;
|
|
3
|
+
export declare function requestIdleCallbackIfAvailable(fallbackTimeout: number, deadlineTimeout?: number): Promise<void>;
|
|
4
|
+
export declare function isPromise<T>(value: PromiseLike<T> | unknown): value is PromiseLike<T>;
|
|
5
|
+
/**
|
|
6
|
+
* Calls a maybe asynchronous function without creating microtasks when the function is synchronous.
|
|
7
|
+
* Catches errors in both cases.
|
|
8
|
+
*
|
|
9
|
+
* If just you run a code like this:
|
|
10
|
+
* ```
|
|
11
|
+
* console.time('Action duration')
|
|
12
|
+
* await action()
|
|
13
|
+
* console.timeEnd('Action duration')
|
|
14
|
+
* ```
|
|
15
|
+
* The synchronous function time can be measured incorrectly because another microtask may run before the `await`
|
|
16
|
+
* returns the control back to the code.
|
|
17
|
+
*/
|
|
18
|
+
export declare function awaitIfAsync<TResult, TError = unknown>(action: () => MaybePromise<TResult>, callback: (...args: [success: true, result: TResult] | [success: false, error: TError]) => unknown): void;
|
|
19
|
+
/**
|
|
20
|
+
* If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks
|
|
21
|
+
* (e.g. completing a network request, rendering the page) won't be able to happen.
|
|
22
|
+
* This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.
|
|
23
|
+
*/
|
|
24
|
+
export declare function mapWithBreaks<T, U>(items: readonly T[], callback: (item: T, index: number) => U, loopReleaseInterval?: number): Promise<U[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Makes the given promise never emit an unhandled promise rejection console warning.
|
|
27
|
+
* The promise will still pass errors to the next promises.
|
|
28
|
+
* Returns the input promise for convenience.
|
|
29
|
+
*
|
|
30
|
+
* Otherwise, promise emits a console warning unless it has a `catch` listener.
|
|
31
|
+
*/
|
|
32
|
+
export declare function suppressUnhandledRejectionWarning<T extends PromiseLike<unknown>>(promise: T): T;
|
|
33
|
+
//# sourceMappingURL=async.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../src/device/utils/async.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5C,wBAAgB,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE9E;AAiBD,wBAAgB,8BAA8B,CAAC,eAAe,EAAE,MAAM,EAAE,eAAe,SAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjH;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAErF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,EACpD,MAAM,EAAE,MAAM,YAAY,CAAC,OAAO,CAAC,EACnC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,OAAO,GACjG,IAAI,CAcN;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,CAAC,EAAE,CAAC,EACtC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EACvC,mBAAmB,SAAK,GACvB,OAAO,CAAC,CAAC,EAAE,CAAC,CAed;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAG/F"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.
|
|
3
|
+
*
|
|
4
|
+
* Warning for package users:
|
|
5
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isTrident(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.
|
|
10
|
+
*
|
|
11
|
+
* Warning for package users:
|
|
12
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isEdgeHTML(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Checks whether the browser is based on Chromium without using user-agent.
|
|
17
|
+
*
|
|
18
|
+
* Warning for package users:
|
|
19
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isChromium(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Checks whether the browser is based on mobile or desktop Safari without using user-agent.
|
|
24
|
+
* All iOS browsers use WebKit (the Safari engine).
|
|
25
|
+
*
|
|
26
|
+
* Warning for package users:
|
|
27
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isWebKit(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Checks whether this WebKit browser is a desktop browser.
|
|
32
|
+
* It doesn't check that the browser is based on WebKit, there is a separate function for this.
|
|
33
|
+
*
|
|
34
|
+
* Warning for package users:
|
|
35
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isDesktopWebKit(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Checks whether this WebKit browser is Safari.
|
|
40
|
+
* It doesn't check that the browser is based on WebKit, there is a separate function for this.
|
|
41
|
+
*
|
|
42
|
+
* Warning! The function works properly only for Safari version 15.4 and newer.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isSafariWebKit(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.
|
|
47
|
+
*
|
|
48
|
+
* Warning for package users:
|
|
49
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isGecko(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Checks whether the browser is based on Chromium version ≥86 without using user-agent.
|
|
54
|
+
* It doesn't check that the browser is based on Chromium, there is a separate function for this.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isChromium86OrNewer(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Checks whether the browser is based on Chromium version ≥122 without using user-agent.
|
|
59
|
+
* It doesn't check that the browser is based on Chromium, there is a separate function for this.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isChromium122OrNewer(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.
|
|
64
|
+
* It doesn't check that the browser is based on WebKit, there is a separate function for this.
|
|
65
|
+
*
|
|
66
|
+
* @see https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map
|
|
67
|
+
*/
|
|
68
|
+
export declare function isWebKit606OrNewer(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Checks whether the browser is based on WebKit version ≥616 (Safari ≥17) without using user-agent.
|
|
71
|
+
* It doesn't check that the browser is based on WebKit, there is a separate function for this.
|
|
72
|
+
*
|
|
73
|
+
* @see https://developer.apple.com/documentation/safari-release-notes/safari-17-release-notes Safari 17 release notes
|
|
74
|
+
* @see https://tauri.app/v1/references/webview-versions/#webkit-versions-in-safari Safari-WebKit versions map
|
|
75
|
+
*/
|
|
76
|
+
export declare function isWebKit616OrNewer(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Checks whether the device is an iPad.
|
|
79
|
+
* It doesn't check that the engine is WebKit and that the WebKit isn't desktop.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isIPad(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Warning for package users:
|
|
84
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getFullscreenElement(): Element | null;
|
|
87
|
+
export declare function exitFullscreen(): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Checks whether the device runs on Android without using user-agent.
|
|
90
|
+
*
|
|
91
|
+
* Warning for package users:
|
|
92
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
93
|
+
*/
|
|
94
|
+
export declare function isAndroid(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Checks whether the browser is Samsung Internet without using user-agent.
|
|
97
|
+
* It doesn't check that the browser is based on Chromium, please use `isChromium` before using this function.
|
|
98
|
+
*
|
|
99
|
+
* Warning for package users:
|
|
100
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isSamsungInternet(): boolean;
|
|
103
|
+
//# sourceMappingURL=browser_.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser_.d.ts","sourceRoot":"","sources":["../../../src/device/utils/browser_.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAcnC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,OAAO,CASpC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAgBpC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAelC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAgBzC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAcxC;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAcjC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAY7C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAa9C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAY5C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAc5C;AAED;;;GAGG;AACH,wBAAgB,MAAM,IAAI,OAAO,CA0BhC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,GAAG,IAAI,CAGrD;AAED,wBAAgB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAI9C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAyBnC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAgB3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonPixels.d.ts","sourceRoot":"","sources":["../../../src/device/utils/commonPixels.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,SAAS,CAa9F"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does the same as Array.prototype.includes but has better typing
|
|
3
|
+
*/
|
|
4
|
+
export declare function includes<THaystack>(haystack: ArrayLike<THaystack>, needle: unknown): needle is THaystack;
|
|
5
|
+
/**
|
|
6
|
+
* Like `!includes()` but with proper typing
|
|
7
|
+
*/
|
|
8
|
+
export declare function excludes<THaystack, TNeedle>(haystack: ArrayLike<THaystack>, needle: TNeedle): needle is Exclude<TNeedle, THaystack>;
|
|
9
|
+
/**
|
|
10
|
+
* Be careful, NaN can return
|
|
11
|
+
*/
|
|
12
|
+
export declare function toInt(value: unknown): number;
|
|
13
|
+
/**
|
|
14
|
+
* Be careful, NaN can return
|
|
15
|
+
*/
|
|
16
|
+
export declare function toFloat(value: unknown): number;
|
|
17
|
+
export declare function replaceNaN<T, U>(value: T, replacement: U): T | U;
|
|
18
|
+
export declare function countTruthy(values: unknown[]): number;
|
|
19
|
+
export declare function round(value: number, base?: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Parses a CSS selector into tag name with HTML attributes.
|
|
22
|
+
* Only single element selector are supported (without operators like space, +, >, etc).
|
|
23
|
+
*
|
|
24
|
+
* Multiple values can be returned for each attribute. You decide how to handle them.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseSimpleCssSelector(selector: string): [tag: string | undefined, attributes: Record<string, string[]>];
|
|
27
|
+
export declare function areSetsEqual(set1: Set<unknown>, set2: Set<unknown>): boolean;
|
|
28
|
+
export declare function maxInIterator<T>(iterator: Iterator<T>, getItemScore: (item: T) => number): T | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Converts a string to UTF8 bytes
|
|
31
|
+
*/
|
|
32
|
+
export declare function getUTF8Bytes(input: string): Uint8Array;
|
|
33
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/device/utils/data.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,SAAS,CAOtG;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EACzC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,EAC9B,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAEvC;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE9C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAEhE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAErD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,MAAM,CASrD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GACf,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAwCjE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,OAAO,CAc5E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,GAAG,SAAS,CAcxG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAetD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MaybePromise } from './async';
|
|
2
|
+
/**
|
|
3
|
+
* Creates and keeps an invisible iframe while the given function runs.
|
|
4
|
+
* The given function is called when the iframe is loaded and has a body.
|
|
5
|
+
* The iframe allows to measure DOM sizes inside itself.
|
|
6
|
+
*
|
|
7
|
+
* Notice: passing an initial HTML code doesn't work in IE.
|
|
8
|
+
*
|
|
9
|
+
* Warning for package users:
|
|
10
|
+
* This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
|
|
11
|
+
*/
|
|
12
|
+
export declare function withIframe<T>(action: (iframe: HTMLIFrameElement, iWindow: typeof window) => MaybePromise<T>, initialHtml?: string, domPollInterval?: number): Promise<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a DOM element that matches the given selector.
|
|
15
|
+
* Only single element selector are supported (without operators like space, +, >, etc).
|
|
16
|
+
*/
|
|
17
|
+
export declare function selectorToElement(selector: string): HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)
|
|
20
|
+
*/
|
|
21
|
+
export declare function addStyleString(style: CSSStyleDeclaration, source: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if the code runs in an iframe, and any parent page's origin doesn't match the current origin
|
|
24
|
+
*/
|
|
25
|
+
export declare function isAnyParentCrossOrigin(): boolean;
|
|
26
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/device/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAQ,MAAM,SAAS,CAAA;AAG5C;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,EAC9E,WAAW,CAAC,EAAE,MAAM,EACpB,eAAe,SAAK,GACnB,OAAO,CAAC,CAAC,CAAC,CAmEZ;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAc/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAU/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAuBhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ephemeralIFrame.d.ts","sourceRoot":"","sources":["../../../src/device/utils/ephemeralIFrame.ts"],"names":[],"mappings":"AAAA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,KAAK,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CA8BtG;AAED,wBAAgB,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMostFrequent.d.ts","sourceRoot":"","sources":["../../../src/device/utils/getMostFrequent.ts"],"names":[],"mappings":"AA2BA,wBAAgB,uCAAuC,CAAC,GAAG,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAW3H"}
|