@zaplier/sdk 1.1.6 → 1.1.7
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +8 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +8 -8
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/src/modules/anti-adblock.d.ts +3 -3
- package/dist/src/modules/anti-adblock.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -6316,11 +6316,11 @@ class ResourceSpoofTransport {
|
|
|
6316
6316
|
}
|
|
6317
6317
|
}
|
|
6318
6318
|
/**
|
|
6319
|
-
*
|
|
6319
|
+
* Socket.io Transport (Real-time bidirectional communication for anti-adblock)
|
|
6320
6320
|
*/
|
|
6321
|
-
class
|
|
6321
|
+
class SocketIOTransport {
|
|
6322
6322
|
constructor(baseUrl) {
|
|
6323
|
-
this.name = '
|
|
6323
|
+
this.name = 'socketio';
|
|
6324
6324
|
this.available = typeof WebSocket !== 'undefined';
|
|
6325
6325
|
this.connected = false;
|
|
6326
6326
|
this.baseUrl = baseUrl;
|
|
@@ -6376,9 +6376,9 @@ class GeckosTransport {
|
|
|
6376
6376
|
try {
|
|
6377
6377
|
// Use dynamic import to load socket.io-client only when needed
|
|
6378
6378
|
Promise.resolve().then(function () { return index; }).then(({ io }) => {
|
|
6379
|
-
// Extract domain from baseUrl
|
|
6379
|
+
// Extract domain from baseUrl - use same port as main API
|
|
6380
6380
|
const url = new URL(this.baseUrl);
|
|
6381
|
-
const socketUrl = `${url.protocol}//${url.host}
|
|
6381
|
+
const socketUrl = `${url.protocol}//${url.host}`;
|
|
6382
6382
|
this.socket = io(socketUrl, {
|
|
6383
6383
|
transports: ['websocket', 'polling'],
|
|
6384
6384
|
timeout: 5000
|
|
@@ -6499,7 +6499,7 @@ class AntiAdblockManager {
|
|
|
6499
6499
|
this.baseUrl = baseUrl;
|
|
6500
6500
|
this.config = {
|
|
6501
6501
|
enabled: true,
|
|
6502
|
-
methods: ['
|
|
6502
|
+
methods: ['socketio', 'fetch', 'websocket', 'resource'], // Socket.io as primary
|
|
6503
6503
|
fallbackDelay: 100,
|
|
6504
6504
|
maxRetries: 2,
|
|
6505
6505
|
debug: false,
|
|
@@ -6509,7 +6509,7 @@ class AntiAdblockManager {
|
|
|
6509
6509
|
}
|
|
6510
6510
|
initializeTransports() {
|
|
6511
6511
|
const transportMap = {
|
|
6512
|
-
|
|
6512
|
+
socketio: () => new SocketIOTransport(this.baseUrl),
|
|
6513
6513
|
fetch: () => new FetchTransport(),
|
|
6514
6514
|
websocket: () => new WebSocketTransport(this.baseUrl),
|
|
6515
6515
|
resource: () => new ResourceSpoofTransport(this.baseUrl),
|
|
@@ -7757,7 +7757,7 @@ class ZaplierSDK {
|
|
|
7757
7757
|
try {
|
|
7758
7758
|
this.antiAdblockManager = new AntiAdblockManager(this.config.apiEndpoint, {
|
|
7759
7759
|
enabled: true,
|
|
7760
|
-
methods: ["
|
|
7760
|
+
methods: ["socketio", "fetch", "websocket", "resource"], // Socket.io as primary
|
|
7761
7761
|
fallbackDelay: 100,
|
|
7762
7762
|
maxRetries: 2,
|
|
7763
7763
|
debug: this.config.debug,
|