@zaplier/sdk 1.0.7 → 1.0.9
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 +55 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +55 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +55 -5
- 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.esm.js
CHANGED
|
@@ -5646,7 +5646,9 @@ async function collectFingerprint(options = {}) {
|
|
|
5646
5646
|
platform: (browser?.platform || "unknown").toLowerCase(),
|
|
5647
5647
|
// PRIORITY 5: Device type (critical for differentiation, ultra-stable)
|
|
5648
5648
|
deviceType,
|
|
5649
|
-
// PRIORITY 6: Enhanced screen resolution
|
|
5649
|
+
// PRIORITY 6: Enhanced screen resolution with exact dimensions for mobile differentiation
|
|
5650
|
+
// For mobile devices, we NEED exact dimensions to differentiate between similar models (S22 vs A54)
|
|
5651
|
+
// For desktop, bucketing is sufficient as hardware varies more
|
|
5650
5652
|
screen: screen
|
|
5651
5653
|
? (() => {
|
|
5652
5654
|
// Use enhanced screen buckets for modern display landscape
|
|
@@ -5741,6 +5743,19 @@ async function collectFingerprint(options = {}) {
|
|
|
5741
5743
|
return "enhanced"; // Slightly enhanced DPI
|
|
5742
5744
|
return "standard"; // Standard 1x displays
|
|
5743
5745
|
};
|
|
5746
|
+
// CRITICAL: Do NOT include exact dimensions in stableCoreVector for mobile!
|
|
5747
|
+
// Reason: Screen dimensions change when:
|
|
5748
|
+
// - Chrome address bar appears/disappears (scroll behavior)
|
|
5749
|
+
// - Virtual keyboard opens/closes
|
|
5750
|
+
// - Screen rotates (portrait ↔ landscape)
|
|
5751
|
+
// - Browser zoom changes
|
|
5752
|
+
// These changes would cause stableCoreHash to change, breaking visitor identification
|
|
5753
|
+
//
|
|
5754
|
+
// INSTEAD: Use ONLY stable screen characteristics (bucket, aspect, density)
|
|
5755
|
+
// For device differentiation (S22 vs A54), use:
|
|
5756
|
+
// - screenFrame (bezel measurements)
|
|
5757
|
+
// - Combination of bucket + hardware + display
|
|
5758
|
+
// - Vector similarity in IdentityResolver
|
|
5744
5759
|
return {
|
|
5745
5760
|
bucket: getScreenBucket(width),
|
|
5746
5761
|
aspectClass: getAspectRatioClass(width, height),
|
|
@@ -5757,6 +5772,11 @@ async function collectFingerprint(options = {}) {
|
|
|
5757
5772
|
: width >= 768
|
|
5758
5773
|
? "tablet"
|
|
5759
5774
|
: "mobile",
|
|
5775
|
+
// ❌ REMOVED: exact dimensions (causes instability on mobile)
|
|
5776
|
+
// Device differentiation is now handled by:
|
|
5777
|
+
// 1. screenFrame (bezel measurements - stable)
|
|
5778
|
+
// 2. hardware + display combination
|
|
5779
|
+
// 3. Vector similarity in IdentityResolver
|
|
5760
5780
|
};
|
|
5761
5781
|
})()
|
|
5762
5782
|
: {
|
|
@@ -5885,7 +5905,18 @@ async function collectFingerprint(options = {}) {
|
|
|
5885
5905
|
: "none",
|
|
5886
5906
|
};
|
|
5887
5907
|
})(),
|
|
5888
|
-
// PRIORITY 8:
|
|
5908
|
+
// PRIORITY 8: Screen frame (bezel measurements) for mobile device differentiation
|
|
5909
|
+
// CRITICAL: This is STABLE across page loads and provides device-specific fingerprint
|
|
5910
|
+
// Samsung S22 vs A54 have different screen frames despite similar resolutions
|
|
5911
|
+
screenFrame: deviceSignals$1?.screenFrame
|
|
5912
|
+
? {
|
|
5913
|
+
top: deviceSignals$1.screenFrame.top || 0,
|
|
5914
|
+
right: deviceSignals$1.screenFrame.right || 0,
|
|
5915
|
+
bottom: deviceSignals$1.screenFrame.bottom || 0,
|
|
5916
|
+
left: deviceSignals$1.screenFrame.left || 0,
|
|
5917
|
+
}
|
|
5918
|
+
: undefined,
|
|
5919
|
+
// PRIORITY 9: Enhanced color and display capabilities bucketing
|
|
5889
5920
|
display: (() => {
|
|
5890
5921
|
const depth = deviceSignals$1.colorDepth;
|
|
5891
5922
|
const gamut = deviceSignals$1.colorGamut;
|
|
@@ -5977,10 +6008,29 @@ async function collectFingerprint(options = {}) {
|
|
|
5977
6008
|
// - Exact hardware values (use buckets)
|
|
5978
6009
|
// Generate ultra-stable hash with additional collision resistance
|
|
5979
6010
|
const stableCoreHash = hashStableCore(coreVector, opts.debug);
|
|
5980
|
-
// CRITICAL: Generate enhanced fingerprint hash combining
|
|
5981
|
-
//
|
|
6011
|
+
// CRITICAL: Generate enhanced fingerprint hash combining STABLE components only
|
|
6012
|
+
// Filter out unstable components that change between requests (canvas, webgl, audio)
|
|
6013
|
+
// These components can vary due to GPU state, rendering context, permissions, etc.
|
|
6014
|
+
const unstableComponentKeys = [
|
|
6015
|
+
"canvas",
|
|
6016
|
+
"webgl",
|
|
6017
|
+
"audio", // Visual/audio fingerprints (vary with context)
|
|
6018
|
+
"mathFingerprint",
|
|
6019
|
+
"fontPreferences",
|
|
6020
|
+
"enhancedFonts", // Measurement-based (can timeout/vary)
|
|
6021
|
+
"dateTimeLocale",
|
|
6022
|
+
"accessibilityEnhanced", // Locale/accessibility (can change)
|
|
6023
|
+
"domBlockers",
|
|
6024
|
+
"pluginsEnhanced", // Privacy tools detection (can change)
|
|
6025
|
+
];
|
|
6026
|
+
const stableComponentValues = {};
|
|
6027
|
+
for (const [key, value] of Object.entries(componentValues)) {
|
|
6028
|
+
if (!unstableComponentKeys.includes(key)) {
|
|
6029
|
+
stableComponentValues[key] = value;
|
|
6030
|
+
}
|
|
6031
|
+
}
|
|
5982
6032
|
const enhancedComponentValues = {
|
|
5983
|
-
...
|
|
6033
|
+
...stableComponentValues, // STABLE components only (screen, browser, system, etc.)
|
|
5984
6034
|
_stableCore: coreVector, // + Ultra-stable components (ua, platform, deviceType, etc.)
|
|
5985
6035
|
// REMOVED: _hourlyEntropy - was causing visitor ID instability (same user = different IDs)
|
|
5986
6036
|
};
|