@tracelog/lib 0.0.7 → 0.0.8
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/browser/tracelog.js
CHANGED
|
@@ -859,7 +859,7 @@ class wt extends p {
|
|
|
859
859
|
return (await fetch(t, {
|
|
860
860
|
method: "POST",
|
|
861
861
|
mode: "cors",
|
|
862
|
-
credentials: "
|
|
862
|
+
credentials: "include",
|
|
863
863
|
body: s,
|
|
864
864
|
headers: {
|
|
865
865
|
"Content-Type": "application/json",
|
|
@@ -889,7 +889,7 @@ class wt extends p {
|
|
|
889
889
|
sendSyncXHR(e, t) {
|
|
890
890
|
const s = new XMLHttpRequest();
|
|
891
891
|
try {
|
|
892
|
-
return s.open("POST", e, !1), s.setRequestHeader("Content-Type", "application/json"), s.setRequestHeader("Origin", window.location.origin), s.setRequestHeader("Referer", window.location.href), s.withCredentials = !
|
|
892
|
+
return s.open("POST", e, !1), s.setRequestHeader("Content-Type", "application/json"), s.setRequestHeader("Origin", window.location.origin), s.setRequestHeader("Referer", window.location.href), s.withCredentials = !0, s.timeout = xe, s.send(t), s.status >= 200 && s.status < 300;
|
|
893
893
|
} catch (i) {
|
|
894
894
|
const a = i instanceof Error ? i.message : String(i), o = a.includes("CORS") || a.includes("NotSameOrigin") || a.includes("blocked");
|
|
895
895
|
return n.error("SenderManager", "Sync XHR failed", {
|
|
@@ -87,7 +87,7 @@ class SenderManager extends state_manager_1.StateManager {
|
|
|
87
87
|
const response = await fetch(url, {
|
|
88
88
|
method: 'POST',
|
|
89
89
|
mode: 'cors',
|
|
90
|
-
credentials: '
|
|
90
|
+
credentials: 'include',
|
|
91
91
|
body: payload,
|
|
92
92
|
headers: {
|
|
93
93
|
'Content-Type': 'application/json',
|
|
@@ -131,7 +131,7 @@ class SenderManager extends state_manager_1.StateManager {
|
|
|
131
131
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
132
132
|
xhr.setRequestHeader('Origin', window.location.origin);
|
|
133
133
|
xhr.setRequestHeader('Referer', window.location.href);
|
|
134
|
-
xhr.withCredentials =
|
|
134
|
+
xhr.withCredentials = true;
|
|
135
135
|
xhr.timeout = constants_1.SYNC_XHR_TIMEOUT_MS;
|
|
136
136
|
xhr.send(payload);
|
|
137
137
|
return xhr.status >= 200 && xhr.status < 300;
|
|
@@ -84,7 +84,7 @@ export class SenderManager extends StateManager {
|
|
|
84
84
|
const response = await fetch(url, {
|
|
85
85
|
method: 'POST',
|
|
86
86
|
mode: 'cors',
|
|
87
|
-
credentials: '
|
|
87
|
+
credentials: 'include',
|
|
88
88
|
body: payload,
|
|
89
89
|
headers: {
|
|
90
90
|
'Content-Type': 'application/json',
|
|
@@ -128,7 +128,7 @@ export class SenderManager extends StateManager {
|
|
|
128
128
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
129
129
|
xhr.setRequestHeader('Origin', window.location.origin);
|
|
130
130
|
xhr.setRequestHeader('Referer', window.location.href);
|
|
131
|
-
xhr.withCredentials =
|
|
131
|
+
xhr.withCredentials = true;
|
|
132
132
|
xhr.timeout = SYNC_XHR_TIMEOUT_MS;
|
|
133
133
|
xhr.send(payload);
|
|
134
134
|
return xhr.status >= 200 && xhr.status < 300;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tracelog/lib",
|
|
3
3
|
"description": "JavaScript library for web analytics and real-time event tracking",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.8",
|
|
6
6
|
"main": "./dist/cjs/public-api.js",
|
|
7
7
|
"module": "./dist/esm/public-api.js",
|
|
8
8
|
"types": "./dist/esm/public-api.d.ts",
|