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