@blotoutio/edgetag-sdk-browser 0.26.2 → 0.26.3
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/index.js +16 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -90,7 +90,18 @@
|
|
|
90
90
|
return error;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
+
const allowLog = () => {
|
|
94
|
+
try {
|
|
95
|
+
return localStorage.getItem('edgeTagDebug') === '1';
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
93
101
|
const log = (data) => {
|
|
102
|
+
if (!allowLog()) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
94
105
|
console.log('[EdgeTag]', getMessage(data));
|
|
95
106
|
};
|
|
96
107
|
const error = (data) => {
|
|
@@ -324,7 +335,7 @@
|
|
|
324
335
|
referrer: getReferrer(),
|
|
325
336
|
search: getSearch(),
|
|
326
337
|
locale: getLocale(),
|
|
327
|
-
sdkVersion: "0.26.
|
|
338
|
+
sdkVersion: "0.26.3" ,
|
|
328
339
|
...(payload || {}),
|
|
329
340
|
};
|
|
330
341
|
let storage = {};
|
|
@@ -601,6 +612,7 @@
|
|
|
601
612
|
continue;
|
|
602
613
|
}
|
|
603
614
|
if (!configuredTags.has(pkg.name)) {
|
|
615
|
+
log(`Provider ${pkg.name} is not in allow list`);
|
|
604
616
|
continue;
|
|
605
617
|
}
|
|
606
618
|
const variables = getProviderVariables(pkg.name);
|
|
@@ -667,6 +679,7 @@
|
|
|
667
679
|
continue;
|
|
668
680
|
}
|
|
669
681
|
if (!configuredTags.has(pkg.name)) {
|
|
682
|
+
log(`Provider ${pkg.name} is not in allow list`);
|
|
670
683
|
continue;
|
|
671
684
|
}
|
|
672
685
|
const variables = getProviderVariables(pkg.name);
|
|
@@ -835,7 +848,7 @@
|
|
|
835
848
|
getRequest(url.href)
|
|
836
849
|
.then((result) => {
|
|
837
850
|
if (!result) {
|
|
838
|
-
|
|
851
|
+
error('Initialization failed');
|
|
839
852
|
return;
|
|
840
853
|
}
|
|
841
854
|
if (result.userId) {
|
|
@@ -867,6 +880,7 @@
|
|
|
867
880
|
continue;
|
|
868
881
|
}
|
|
869
882
|
if (!configuredTags.has(pkg.name)) {
|
|
883
|
+
log(`Provider ${pkg.name} is not in allow list`);
|
|
870
884
|
continue;
|
|
871
885
|
}
|
|
872
886
|
const variables = getProviderVariables(pkg.name);
|