@blotoutio/edgetag-sdk-browser 0.62.1 → 0.63.1
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 +17 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -279,6 +279,7 @@
|
|
|
279
279
|
const keyPrefix = `_worker`;
|
|
280
280
|
const cookieKey = 'tag_user_id';
|
|
281
281
|
const fallbackSessionKey = 'fallback_tag_user_id';
|
|
282
|
+
const storageIdKey = 'storageId';
|
|
282
283
|
|
|
283
284
|
const getMessage = (error) => {
|
|
284
285
|
if (error instanceof Error) {
|
|
@@ -562,7 +563,7 @@
|
|
|
562
563
|
referrer: getReferrer(destination),
|
|
563
564
|
search: getSearch(destination),
|
|
564
565
|
locale: getLocale(),
|
|
565
|
-
sdkVersion: "0.
|
|
566
|
+
sdkVersion: "0.63.1" ,
|
|
566
567
|
...(payload || {}),
|
|
567
568
|
};
|
|
568
569
|
let storage = {};
|
|
@@ -844,11 +845,11 @@
|
|
|
844
845
|
|
|
845
846
|
const handleConsent = (consent, options) => {
|
|
846
847
|
if (options === null || options === void 0 ? void 0 : options.destination) {
|
|
847
|
-
processConsent(options.destination, consent, options
|
|
848
|
+
processConsent(options.destination, consent, options);
|
|
848
849
|
return;
|
|
849
850
|
}
|
|
850
851
|
getInstances().forEach((destination) => {
|
|
851
|
-
processConsent(destination, consent, options
|
|
852
|
+
processConsent(destination, consent, options);
|
|
852
853
|
});
|
|
853
854
|
};
|
|
854
855
|
const saveConsent = (destination, consent) => {
|
|
@@ -857,16 +858,23 @@
|
|
|
857
858
|
});
|
|
858
859
|
savePerKey(destination, 'local', tagStorage, consent, consentKey);
|
|
859
860
|
};
|
|
860
|
-
const processConsent = (destination, consent,
|
|
861
|
+
const processConsent = (destination, consent, options) => {
|
|
861
862
|
const existingConsent = getConsent$1(destination);
|
|
862
863
|
if (areEqual(existingConsent, consent)) {
|
|
863
864
|
return;
|
|
864
865
|
}
|
|
866
|
+
if (!getSetting(destination, 'initialized')) {
|
|
867
|
+
addStub(destination, {
|
|
868
|
+
name: 'consent',
|
|
869
|
+
arguments: [consent, options],
|
|
870
|
+
});
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
865
873
|
const payload = {
|
|
866
874
|
consentString: consent,
|
|
867
875
|
};
|
|
868
876
|
saveConsent(destination, consent);
|
|
869
|
-
if (!localSave) {
|
|
877
|
+
if (!(options === null || options === void 0 ? void 0 : options.localSave)) {
|
|
870
878
|
postRequest(getConsentURL(destination), payload).catch(error);
|
|
871
879
|
}
|
|
872
880
|
const userId = getUserId$1(destination);
|
|
@@ -1175,7 +1183,11 @@
|
|
|
1175
1183
|
userId: result.userId,
|
|
1176
1184
|
manifest: result.result,
|
|
1177
1185
|
browserPackages: Object.values(providers),
|
|
1186
|
+
storageId: result.storageId,
|
|
1178
1187
|
});
|
|
1188
|
+
if (result.storageId != null) {
|
|
1189
|
+
savePerKey(preferences.edgeURL, 'local', tagStorage, result.storageId, storageIdKey);
|
|
1190
|
+
}
|
|
1179
1191
|
handleManifest(preferences.edgeURL, result);
|
|
1180
1192
|
try {
|
|
1181
1193
|
window.dispatchEvent(new CustomEvent('edgetag-initialized', {
|