@zaplier/sdk 1.1.4 → 1.1.5
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 +14 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +14 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +14 -17
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/src/sdk.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7598,15 +7598,15 @@ class ZaplierSDK {
|
|
|
7598
7598
|
*/
|
|
7599
7599
|
getBrowserFingerprint() {
|
|
7600
7600
|
const components = [
|
|
7601
|
-
navigator.userAgent ||
|
|
7602
|
-
navigator.platform ||
|
|
7601
|
+
navigator.userAgent || "",
|
|
7602
|
+
navigator.platform || "",
|
|
7603
7603
|
screen.width || 0,
|
|
7604
7604
|
screen.height || 0,
|
|
7605
7605
|
new Date(2024, 0, 1).getTimezoneOffset(),
|
|
7606
|
-
navigator.language ||
|
|
7607
|
-
navigator.hardwareConcurrency || 0
|
|
7606
|
+
navigator.language || "",
|
|
7607
|
+
navigator.hardwareConcurrency || 0,
|
|
7608
7608
|
];
|
|
7609
|
-
const combined = components.join(
|
|
7609
|
+
const combined = components.join("|");
|
|
7610
7610
|
let hash = 0;
|
|
7611
7611
|
for (let i = 0; i < combined.length; i++) {
|
|
7612
7612
|
const char = combined.charCodeAt(i);
|
|
@@ -7696,8 +7696,8 @@ class ZaplierSDK {
|
|
|
7696
7696
|
// Use page load time (stable during session) instead of current time
|
|
7697
7697
|
performance.timeOrigin || 0,
|
|
7698
7698
|
// Deterministic entropy from browser characteristics
|
|
7699
|
-
|
|
7700
|
-
|
|
7699
|
+
navigator.plugins ? navigator.plugins.length : 0,
|
|
7700
|
+
navigator.mimeTypes ? navigator.mimeTypes.length : 0,
|
|
7701
7701
|
// Memory usage pattern (if available, use rounded values for stability)
|
|
7702
7702
|
Math.floor((performance.memory?.usedJSHeapSize || 0) / 1000000),
|
|
7703
7703
|
Math.floor((performance.memory?.totalJSHeapSize || 0) / 1000000),
|
|
@@ -7709,14 +7709,18 @@ class ZaplierSDK {
|
|
|
7709
7709
|
window.outerWidth || 0,
|
|
7710
7710
|
Math.floor((window.devicePixelRatio || 1) * 100) / 100, // Round to 2 decimals
|
|
7711
7711
|
// Canvas support (deterministic)
|
|
7712
|
-
typeof document.createElement(
|
|
7712
|
+
typeof document.createElement("canvas").getContext === "function"
|
|
7713
|
+
? 1
|
|
7714
|
+
: 0,
|
|
7713
7715
|
];
|
|
7714
7716
|
// Create deterministic entropy string
|
|
7715
7717
|
const entropyString = entropyComponents.join("|");
|
|
7716
7718
|
// Add deterministic checksum instead of random values
|
|
7717
7719
|
let checksum = 0;
|
|
7718
7720
|
for (let i = 0; i < entropyString.length; i++) {
|
|
7719
|
-
checksum =
|
|
7721
|
+
checksum =
|
|
7722
|
+
((checksum << 5) - checksum + entropyString.charCodeAt(i)) &
|
|
7723
|
+
0xffffffff;
|
|
7720
7724
|
}
|
|
7721
7725
|
const deterministic = Math.abs(checksum).toString(36);
|
|
7722
7726
|
// Advanced hash function with better distribution
|
|
@@ -7858,14 +7862,7 @@ class ZaplierSDK {
|
|
|
7858
7862
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
7859
7863
|
}
|
|
7860
7864
|
const jsonResponse = await response.json();
|
|
7861
|
-
//
|
|
7862
|
-
// (but don't wait for it or use its response)
|
|
7863
|
-
if (this.antiAdblockManager && method === "POST") {
|
|
7864
|
-
// Send in parallel without blocking
|
|
7865
|
-
this.antiAdblockManager.send(data, endpoint).catch(() => {
|
|
7866
|
-
// Silently fail - we already got the response from standard fetch
|
|
7867
|
-
});
|
|
7868
|
-
}
|
|
7865
|
+
// Return immediately - anti-adblock is only used as fallback when fetch fails
|
|
7869
7866
|
return jsonResponse;
|
|
7870
7867
|
}
|
|
7871
7868
|
catch (error) {
|