@zaplier/sdk 1.1.0 → 1.1.2
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/dist/index.cjs +35 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +35 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +35 -21
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/src/modules/fingerprint.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5137,46 +5137,47 @@ async function collectFingerprint(options = {}) {
|
|
|
5137
5137
|
const parallelTasks = [];
|
|
5138
5138
|
// Group 1: Independent rendering components (can run in parallel)
|
|
5139
5139
|
if (shouldIncludeComponent("canvas", opts) && isCanvasAvailable$1()) {
|
|
5140
|
-
parallelTasks.push(collectComponent("canvas", getCanvasFingerprint, opts).then(result => ({
|
|
5140
|
+
parallelTasks.push(collectComponent("canvas", getCanvasFingerprint, opts).then((result) => ({
|
|
5141
5141
|
component: "canvas",
|
|
5142
|
-
result
|
|
5142
|
+
result,
|
|
5143
5143
|
})));
|
|
5144
5144
|
}
|
|
5145
5145
|
if (shouldIncludeComponent("webgl", opts) && isWebGLAvailable()) {
|
|
5146
|
-
parallelTasks.push(collectComponent("webgl", getWebGLFingerprint, opts).then(result => ({
|
|
5146
|
+
parallelTasks.push(collectComponent("webgl", getWebGLFingerprint, opts).then((result) => ({
|
|
5147
5147
|
component: "webgl",
|
|
5148
|
-
result
|
|
5148
|
+
result,
|
|
5149
5149
|
})));
|
|
5150
5150
|
}
|
|
5151
5151
|
if (shouldIncludeComponent("audio", opts) && isAudioAvailable()) {
|
|
5152
|
-
parallelTasks.push(collectComponent("audio", getAudioFingerprint, opts).then(result => ({
|
|
5152
|
+
parallelTasks.push(collectComponent("audio", getAudioFingerprint, opts).then((result) => ({
|
|
5153
5153
|
component: "audio",
|
|
5154
|
-
result
|
|
5154
|
+
result,
|
|
5155
5155
|
})));
|
|
5156
5156
|
}
|
|
5157
5157
|
// Group 2: Fast synchronous components (can run in parallel)
|
|
5158
5158
|
if (shouldIncludeComponent("fonts", opts) && isFontDetectionAvailable()) {
|
|
5159
|
-
parallelTasks.push(collectComponent("fonts", () => getFontFingerprint(!opts.gdprMode), opts).then(result => ({
|
|
5159
|
+
parallelTasks.push(collectComponent("fonts", () => getFontFingerprint(!opts.gdprMode), opts).then((result) => ({
|
|
5160
5160
|
component: "fonts",
|
|
5161
|
-
result
|
|
5161
|
+
result,
|
|
5162
5162
|
})));
|
|
5163
5163
|
}
|
|
5164
5164
|
if (shouldIncludeComponent("screen", opts) && isScreenAvailable()) {
|
|
5165
|
-
parallelTasks.push(collectComponent("screen", getScreenFingerprint, opts).then(result => ({
|
|
5165
|
+
parallelTasks.push(collectComponent("screen", getScreenFingerprint, opts).then((result) => ({
|
|
5166
5166
|
component: "screen",
|
|
5167
|
-
result
|
|
5167
|
+
result,
|
|
5168
5168
|
})));
|
|
5169
5169
|
}
|
|
5170
|
-
if (shouldIncludeComponent("browser", opts) &&
|
|
5171
|
-
|
|
5170
|
+
if (shouldIncludeComponent("browser", opts) &&
|
|
5171
|
+
isBrowserFingerprintingAvailable()) {
|
|
5172
|
+
parallelTasks.push(collectComponent("browser", getBrowserFingerprint, opts).then((result) => ({
|
|
5172
5173
|
component: "browser",
|
|
5173
|
-
result
|
|
5174
|
+
result,
|
|
5174
5175
|
})));
|
|
5175
5176
|
}
|
|
5176
5177
|
// Execute all parallel tasks and handle results
|
|
5177
5178
|
const parallelResults = await Promise.allSettled(parallelTasks);
|
|
5178
5179
|
parallelResults.forEach((promiseResult, index) => {
|
|
5179
|
-
if (promiseResult.status ===
|
|
5180
|
+
if (promiseResult.status === "fulfilled" && promiseResult.value.result) {
|
|
5180
5181
|
const { component, result } = promiseResult.value;
|
|
5181
5182
|
fingerprintData[component] = result;
|
|
5182
5183
|
collectedComponents.push(component);
|
|
@@ -5184,10 +5185,10 @@ async function collectFingerprint(options = {}) {
|
|
|
5184
5185
|
else {
|
|
5185
5186
|
// Extract component name from the corresponding task
|
|
5186
5187
|
const taskComponent = parallelTasks[index];
|
|
5187
|
-
const componentName = taskComponent?.toString().match(/component: "(\w+)"/)?.[1] ||
|
|
5188
|
+
const componentName = taskComponent?.toString().match(/component: "(\w+)"/)?.[1] || "unknown";
|
|
5188
5189
|
failedComponents.push({
|
|
5189
5190
|
component: componentName,
|
|
5190
|
-
error: promiseResult.status ===
|
|
5191
|
+
error: promiseResult.status === "rejected"
|
|
5191
5192
|
? promiseResult.reason?.message || "Promise rejected"
|
|
5192
5193
|
: "Collection failed or timeout",
|
|
5193
5194
|
});
|
|
@@ -5235,7 +5236,7 @@ async function collectFingerprint(options = {}) {
|
|
|
5235
5236
|
const fallbackHardware = {
|
|
5236
5237
|
hardwareConcurrency: navigator.hardwareConcurrency || 0,
|
|
5237
5238
|
deviceMemory: navigator.deviceMemory || 0,
|
|
5238
|
-
platform: navigator.platform ||
|
|
5239
|
+
platform: navigator.platform || "unknown",
|
|
5239
5240
|
};
|
|
5240
5241
|
fingerprintData.hardware = {
|
|
5241
5242
|
value: fallbackHardware,
|
|
@@ -5702,10 +5703,11 @@ async function collectFingerprint(options = {}) {
|
|
|
5702
5703
|
platform: (browser?.platform || "unknown").toLowerCase(),
|
|
5703
5704
|
// PRIORITY 5: Device type (critical for differentiation, ultra-stable)
|
|
5704
5705
|
deviceType,
|
|
5705
|
-
// PRIORITY 6: Enhanced screen resolution
|
|
5706
|
-
//
|
|
5707
|
-
// For desktop,
|
|
5708
|
-
screen
|
|
5706
|
+
// PRIORITY 6: Enhanced screen resolution - ONLY for mobile/tablet
|
|
5707
|
+
// CRITICAL: Desktop screen detection is UNSTABLE with DevTools (viewport changes)
|
|
5708
|
+
// For desktop, we rely on hardware + display + platform for differentiation
|
|
5709
|
+
// For mobile/tablet, screen is STABLE (no DevTools viewport issues)
|
|
5710
|
+
screen: screen && (deviceType === "mobile" || deviceType === "tablet")
|
|
5709
5711
|
? (() => {
|
|
5710
5712
|
// Use enhanced screen buckets for modern display landscape
|
|
5711
5713
|
const dims = [screen.width, screen.height].sort((a, b) => b - a);
|
|
@@ -6062,6 +6064,18 @@ async function collectFingerprint(options = {}) {
|
|
|
6062
6064
|
// - Screen frame (can vary slightly)
|
|
6063
6065
|
// - Vendor flavors (can change)
|
|
6064
6066
|
// - Exact hardware values (use buckets)
|
|
6067
|
+
// DEBUG: Log coreVector components to identify DevTools instability
|
|
6068
|
+
if (opts.debug ||
|
|
6069
|
+
(typeof window !== "undefined" && window._rabbitTrackerDebug)) {
|
|
6070
|
+
console.log("[RabbitTracker DEBUG] coreVector components:", {
|
|
6071
|
+
ua: coreVector.ua,
|
|
6072
|
+
platform: coreVector.platform,
|
|
6073
|
+
deviceType: coreVector.deviceType,
|
|
6074
|
+
screenBucket: coreVector.screen?.bucket,
|
|
6075
|
+
timezone: coreVector.timezone,
|
|
6076
|
+
_entropy: coreVector._entropy,
|
|
6077
|
+
});
|
|
6078
|
+
}
|
|
6065
6079
|
// Generate ultra-stable hash with additional collision resistance
|
|
6066
6080
|
const stableCoreHash = hashStableCore(coreVector, opts.debug);
|
|
6067
6081
|
// CRITICAL: Generate enhanced fingerprint hash combining STABLE components only
|