@sailfish-ai/recorder 1.8.17 → 1.8.19
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/inAppReportIssueModal/integrations.js +27 -5
- package/dist/recorder.cjs +117 -64
- package/dist/recorder.js +88 -35
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +121 -68
- package/dist/recording.js +14 -1
- package/dist/sourceLocation.js +175 -0
- package/dist/types/sourceLocation.d.ts +17 -0
- package/package.json +1 -1
package/dist/recorder.js
CHANGED
|
@@ -465,7 +465,7 @@ function initializeWebSocket(e, a, u, m2) {
|
|
|
465
465
|
const a2 = document.createElement("a");
|
|
466
466
|
return a2.href = e2, `${a2.hostname}${a2.port ? `:${a2.port}` : ""}`;
|
|
467
467
|
})(e);
|
|
468
|
-
let b2 = `${"https:" === new URL(e).protocol ? "wss" : "ws"}://${w2}/ws/notify/?apiKey=${a}&sessionId=${u}&sender=JS%2FTS&version=1.8.
|
|
468
|
+
let b2 = `${"https:" === new URL(e).protocol ? "wss" : "ws"}://${w2}/ws/notify/?apiKey=${a}&sessionId=${u}&sender=JS%2FTS&version=1.8.19`;
|
|
469
469
|
m2 && (b2 += `&envValue=${encodeURIComponent(m2)}`);
|
|
470
470
|
return se = new U(b2, [], { connectionTimeout: 3e4 }), se.addEventListener("open", () => {
|
|
471
471
|
re && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (de ? "ENABLED" : "DISABLED"))), (async () => {
|
|
@@ -1395,10 +1395,10 @@ function updateFormWithIntegrationData(e) {
|
|
|
1395
1395
|
var _a2;
|
|
1396
1396
|
if (!st) return e;
|
|
1397
1397
|
const a = st.teams && Array.isArray(st.teams) && st.teams.length > 0, u = document.getElementById("sf-eng-ticket-team");
|
|
1398
|
-
u && a && (populateSelectOptions(u, st.teams, st.defaultTeam), e.engTicketTeam = u.value);
|
|
1398
|
+
u && a && (populateSelectOptions(u, st.teams, st.defaultTeam), e.engTicketTeam ? u.value = e.engTicketTeam : e.engTicketTeam = u.value);
|
|
1399
1399
|
const m2 = document.getElementById("sf-eng-ticket-project");
|
|
1400
1400
|
if (m2) {
|
|
1401
|
-
populateSelectOptions(m2, a ? getProjectsForTeam(e.engTicketTeam) : st.projects || [], st.defaultProject), e.engTicketProject = m2.value;
|
|
1401
|
+
populateSelectOptions(m2, a ? getProjectsForTeam(e.engTicketTeam) : st.projects || [], st.defaultProject), e.engTicketProject ? m2.value = e.engTicketProject : e.engTicketProject = m2.value;
|
|
1402
1402
|
}
|
|
1403
1403
|
const w2 = document.getElementById("sf-eng-ticket-priority");
|
|
1404
1404
|
w2 && (!(function populatePriorityOptions(e2, a2, u2) {
|
|
@@ -1411,9 +1411,9 @@ function updateFormWithIntegrationData(e) {
|
|
|
1411
1411
|
u3.value = a3.id, u3.textContent = a3.name, e2.appendChild(u3);
|
|
1412
1412
|
});
|
|
1413
1413
|
null != u2 ? e2.value = String(u2) : m3 || (e2.value = "0");
|
|
1414
|
-
})(w2, st.provider || "", st.defaultPriority), e.engTicketPriority = Number(w2.value));
|
|
1414
|
+
})(w2, st.provider || "", st.defaultPriority), e.engTicketPriority ? w2.value = String(e.engTicketPriority) : e.engTicketPriority = Number(w2.value));
|
|
1415
1415
|
const b2 = document.getElementById("sf-eng-ticket-type"), C2 = "jira" === ((_a2 = st.provider) == null ? void 0 : _a2.toLowerCase());
|
|
1416
|
-
return b2 && C2 && e.engTicketProject && (updateIssueTypeOptions(b2, e.engTicketProject), b2.value && (e.engTicketIssueType = b2.value)), e;
|
|
1416
|
+
return b2 && C2 && e.engTicketProject && (updateIssueTypeOptions(b2, e.engTicketProject), e.engTicketIssueType ? (b2.value = e.engTicketIssueType, b2.style.color = "#000") : b2.value && (e.engTicketIssueType = b2.value)), e;
|
|
1417
1417
|
}
|
|
1418
1418
|
const it = "sf-create-issue-preference", at = "sf-create-eng-ticket-preference";
|
|
1419
1419
|
function getInitialState() {
|
|
@@ -7625,6 +7625,58 @@ function R(e, a, u) {
|
|
|
7625
7625
|
}
|
|
7626
7626
|
}
|
|
7627
7627
|
var fd = ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e[e.Device = 24] = "Device", e[e.SailfishCustom = 25] = "SailfishCustom", e))(fd || {});
|
|
7628
|
+
const md = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
|
|
7629
|
+
function shouldSkipFrame(e) {
|
|
7630
|
+
return md.some((a) => e.includes(a));
|
|
7631
|
+
}
|
|
7632
|
+
function normalizeFilePath(e) {
|
|
7633
|
+
let a = e;
|
|
7634
|
+
if (a.startsWith("file://") && (a = a.substring(7)), a.startsWith("webpack-internal:///") && (a = a.substring(20)), a.startsWith("webpack:///") && (a = a.substring(11)), a.startsWith("/@fs/") && (a = a.substring(5)), a.startsWith("http://") || a.startsWith("https://")) try {
|
|
7635
|
+
a = new URL(a).pathname || a, "/" === a && (a = "index.html");
|
|
7636
|
+
} catch {
|
|
7637
|
+
}
|
|
7638
|
+
return a;
|
|
7639
|
+
}
|
|
7640
|
+
function getCallerLocationFromTrace(e, a = 0) {
|
|
7641
|
+
if (!Array.isArray(e) || 0 === e.length) return [null, null];
|
|
7642
|
+
const u = (function parseRrwebTraceFrames(e2) {
|
|
7643
|
+
const a2 = [];
|
|
7644
|
+
for (const u2 of e2) {
|
|
7645
|
+
if (!u2) continue;
|
|
7646
|
+
const e3 = u2.startsWith("at ") ? u2.slice(3) : u2;
|
|
7647
|
+
let m2 = /^(.*?)\s+\((.+?):(\d+):(\d+)\)$/.exec(e3);
|
|
7648
|
+
m2 ? a2.push({ functionName: m2[1] || "<anonymous>", file: m2[2], line: parseInt(m2[3], 10), column: parseInt(m2[4], 10) }) : (m2 = /^(.+?):(\d+):(\d+)$/.exec(e3), m2 && a2.push({ functionName: "<anonymous>", file: m2[1], line: parseInt(m2[2], 10), column: parseInt(m2[3], 10) }));
|
|
7649
|
+
}
|
|
7650
|
+
return a2;
|
|
7651
|
+
})(e);
|
|
7652
|
+
for (let e2 = a; e2 < Math.min(u.length, a + 20); e2++) {
|
|
7653
|
+
const a2 = u[e2];
|
|
7654
|
+
if (!(a2 == null ? void 0 : a2.file)) continue;
|
|
7655
|
+
const m2 = normalizeFilePath(a2.file);
|
|
7656
|
+
if (!shouldSkipFrame(m2)) return [m2, a2.line];
|
|
7657
|
+
}
|
|
7658
|
+
return [null, null];
|
|
7659
|
+
}
|
|
7660
|
+
function getCallerLocation(e = 0) {
|
|
7661
|
+
const a = new Error().stack;
|
|
7662
|
+
if (!a) return [null, null];
|
|
7663
|
+
const u = (function parseV8Stack(e2) {
|
|
7664
|
+
if (!e2) return [];
|
|
7665
|
+
const a2 = e2.split("\n").slice(1), u2 = [];
|
|
7666
|
+
for (const e3 of a2) {
|
|
7667
|
+
let a3 = /at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/.exec(e3);
|
|
7668
|
+
a3 ? u2.push({ functionName: a3[1], file: a3[2], line: parseInt(a3[3], 10), column: parseInt(a3[4], 10) }) : (a3 = /at\s+(.+?):(\d+):(\d+)/.exec(e3), a3 && u2.push({ functionName: "<anonymous>", file: a3[1], line: parseInt(a3[2], 10), column: parseInt(a3[3], 10) }));
|
|
7669
|
+
}
|
|
7670
|
+
return u2;
|
|
7671
|
+
})(a), m2 = 1 + e;
|
|
7672
|
+
for (let e2 = m2; e2 < Math.min(u.length, m2 + 20); e2++) {
|
|
7673
|
+
const a2 = u[e2];
|
|
7674
|
+
if (!(a2 == null ? void 0 : a2.file)) continue;
|
|
7675
|
+
const m3 = normalizeFilePath(a2.file);
|
|
7676
|
+
if (!shouldSkipFrame(m3)) return [m3, a2.line];
|
|
7677
|
+
}
|
|
7678
|
+
return [null, null];
|
|
7679
|
+
}
|
|
7628
7680
|
function suppressConsoleLogsDuringCall(e) {
|
|
7629
7681
|
const a = console.log, u = console.warn, m2 = console.error;
|
|
7630
7682
|
console.log = () => {
|
|
@@ -7637,7 +7689,7 @@ function suppressConsoleLogsDuringCall(e) {
|
|
|
7637
7689
|
console.log = a, console.warn = u, console.error = m2;
|
|
7638
7690
|
}
|
|
7639
7691
|
}
|
|
7640
|
-
const
|
|
7692
|
+
const gd = "zendesk_chat", yd = "Zendesk";
|
|
7641
7693
|
function zE_safe(...e) {
|
|
7642
7694
|
try {
|
|
7643
7695
|
if ((function hasZendesk() {
|
|
@@ -7676,7 +7728,8 @@ function initializeDomContentEvents(e) {
|
|
|
7676
7728
|
function initializeConsolePlugin(e, a) {
|
|
7677
7729
|
const { name: u, observer: m2 } = /* @__PURE__ */ ((e2) => ({ name: "@sailfish-rrweb/rrweb/console@1", observer: R, options: e2 }))(e);
|
|
7678
7730
|
m2((e2) => {
|
|
7679
|
-
|
|
7731
|
+
const m3 = e2, [w2, b2] = getCallerLocationFromTrace(m3 == null ? void 0 : m3.trace, 0), [C2, x2] = getCallerLocation(2), I2 = w2 ?? C2, E2 = b2 ?? x2, _2 = { ...m3, sourceFile: I2, sourceLine: E2 };
|
|
7732
|
+
sendEvent({ type: fd.Plugin, timestamp: Date.now(), data: { plugin: u, payload: _2 }, sessionId: a, ...getUrlAndStoredUuids() });
|
|
7680
7733
|
}, window, e);
|
|
7681
7734
|
}
|
|
7682
7735
|
async function initializeRecording(e, a, u, m2, w2) {
|
|
@@ -7696,11 +7749,11 @@ async function initializeRecording(e, a, u, m2, w2) {
|
|
|
7696
7749
|
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${m2}`]);
|
|
7697
7750
|
});
|
|
7698
7751
|
const handleWidgetOpen = () => {
|
|
7699
|
-
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat opened", element_id:
|
|
7752
|
+
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat opened", element_id: gd, provider: yd });
|
|
7700
7753
|
}, handleWidgetClose = () => {
|
|
7701
|
-
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat closed", element_id:
|
|
7754
|
+
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat closed", element_id: gd, provider: yd });
|
|
7702
7755
|
}, handleUnreadMessages = (e2) => {
|
|
7703
|
-
ae.addSailfishEvent(fd.SailfishCustom, { action: "zendesk unreadmessages", element_id:
|
|
7756
|
+
ae.addSailfishEvent(fd.SailfishCustom, { action: "zendesk unreadmessages", element_id: gd, provider: yd });
|
|
7704
7757
|
};
|
|
7705
7758
|
suppressConsoleLogsDuringCall(() => {
|
|
7706
7759
|
zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
|
|
@@ -7711,19 +7764,19 @@ async function initializeRecording(e, a, u, m2, w2) {
|
|
|
7711
7764
|
}
|
|
7712
7765
|
return b2;
|
|
7713
7766
|
}
|
|
7714
|
-
let
|
|
7767
|
+
let wd = null, bd = null;
|
|
7715
7768
|
function identify(e, a = {}, u = false) {
|
|
7716
7769
|
const m2 = { type: "identify", userId: e, traits: a };
|
|
7717
|
-
|
|
7770
|
+
wd && wd.userId === e && JSON.stringify(wd.traits) === JSON.stringify(a) || (wd = { userId: e, traits: a, overwrite: u }, sendMessage(m2));
|
|
7718
7771
|
}
|
|
7719
7772
|
function addOrUpdateMetadata(e) {
|
|
7720
7773
|
const a = { type: "addOrUpdateMetadata", metadata: e };
|
|
7721
|
-
|
|
7774
|
+
bd && JSON.stringify(bd) === JSON.stringify(e) || (bd = e, sendMessage(a));
|
|
7722
7775
|
}
|
|
7723
7776
|
function trackingEvent(e) {
|
|
7724
7777
|
sendMessage({ type: "trackingEvent", trackingData: e, timestamp: ne() });
|
|
7725
7778
|
}
|
|
7726
|
-
const
|
|
7779
|
+
const Sd = readDebugFlag(), vd = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], kd = [400, 403], Cd = "CORS", xd = 1, Id = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {} }, Md = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
7727
7780
|
function trackDomainChangesOnce() {
|
|
7728
7781
|
const e = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
7729
7782
|
if (e.routeWatcherIntervalId) return;
|
|
@@ -7790,7 +7843,7 @@ function shouldSkipHeadersPropagation(e, a = []) {
|
|
|
7790
7843
|
return true;
|
|
7791
7844
|
}
|
|
7792
7845
|
for (const e2 of O) if (u.pathname.toLowerCase().endsWith(e2)) return true;
|
|
7793
|
-
return !!matchUrlWithWildcard(e, [...
|
|
7846
|
+
return !!matchUrlWithWildcard(e, [...vd, ...a]);
|
|
7794
7847
|
}
|
|
7795
7848
|
function setupFetchInterceptor(e = []) {
|
|
7796
7849
|
const a = window.fetch, u = getOrSetSessionId();
|
|
@@ -7825,7 +7878,7 @@ function setupFetchInterceptor(e = []) {
|
|
|
7825
7878
|
D2[e3] = a4;
|
|
7826
7879
|
}) : D2 = { ...w3.headers }), F2 = w3.body;
|
|
7827
7880
|
} catch (e3) {
|
|
7828
|
-
|
|
7881
|
+
Sd && console.warn("[Sailfish] Failed to capture request data:", e3);
|
|
7829
7882
|
}
|
|
7830
7883
|
delete D2[b];
|
|
7831
7884
|
const $2 = (_a2 = getFuncSpanHeader()) == null ? void 0 : _a2.name;
|
|
@@ -7835,16 +7888,16 @@ function setupFetchInterceptor(e = []) {
|
|
|
7835
7888
|
const I4 = getFuncSpanHeader();
|
|
7836
7889
|
if (u3 instanceof Request) {
|
|
7837
7890
|
const E3 = u3.clone(), _3 = new Headers(E3.headers);
|
|
7838
|
-
_3.set(b, `${w4}/${C4}/${x4}`), I4 && (_3.set(I4.name, I4.value),
|
|
7891
|
+
_3.set(b, `${w4}/${C4}/${x4}`), I4 && (_3.set(I4.name, I4.value), Sd && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: u3.url, header: I4.name }));
|
|
7839
7892
|
const O3 = new Request(E3, { headers: _3 });
|
|
7840
7893
|
return await e3.call(a4, O3, m4);
|
|
7841
7894
|
}
|
|
7842
7895
|
{
|
|
7843
7896
|
const E3 = { ...m4 }, _3 = new Headers(m4.headers || {});
|
|
7844
|
-
return _3.set(b, `${w4}/${C4}/${x4}`), I4 && (_3.set(I4.name, I4.value),
|
|
7897
|
+
return _3.set(b, `${w4}/${C4}/${x4}`), I4 && (_3.set(I4.name, I4.value), Sd && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof u3 ? u3 : u3.href, header: I4.name })), E3.headers = _3, await e3.call(a4, u3, E3);
|
|
7845
7898
|
}
|
|
7846
7899
|
})(e2, a3, m3, w3, C3, E2.page_visit_uuid, I3), B2 = false;
|
|
7847
|
-
|
|
7900
|
+
kd.includes($3.status) && (Sd && console.log("Perform retry as status was fail:", $3), I3 = v4(), $3 = await (async function retryWithoutPropagateHeaders(e3, a4, u3, m4) {
|
|
7848
7901
|
try {
|
|
7849
7902
|
let m5 = u3[0], w4 = u3[1] || {};
|
|
7850
7903
|
if ("string" == typeof m5 || m5 instanceof URL) {
|
|
@@ -7860,7 +7913,7 @@ function setupFetchInterceptor(e = []) {
|
|
|
7860
7913
|
}
|
|
7861
7914
|
return e3.apply(a4, u3);
|
|
7862
7915
|
} catch (e4) {
|
|
7863
|
-
throw
|
|
7916
|
+
throw Sd && console.log(`Retry without ${b} for ${m4} also failed:`, e4), e4;
|
|
7864
7917
|
}
|
|
7865
7918
|
})(e2, a3, u2, x3), B2 = true);
|
|
7866
7919
|
const U2 = Date.now(), j2 = $3.status, z2 = $3.ok, q2 = z2 ? "" : `Request Error: ${$3.statusText}`;
|
|
@@ -7869,7 +7922,7 @@ function setupFetchInterceptor(e = []) {
|
|
|
7869
7922
|
const e3 = $3.clone();
|
|
7870
7923
|
V2 = await e3.text();
|
|
7871
7924
|
} catch (e3) {
|
|
7872
|
-
|
|
7925
|
+
Sd && console.warn("[Sailfish] Failed to capture response data:", e3), V2 = null;
|
|
7873
7926
|
}
|
|
7874
7927
|
let H2 = null;
|
|
7875
7928
|
try {
|
|
@@ -7877,12 +7930,12 @@ function setupFetchInterceptor(e = []) {
|
|
|
7877
7930
|
H2[a4] = e3;
|
|
7878
7931
|
});
|
|
7879
7932
|
} catch (e3) {
|
|
7880
|
-
|
|
7933
|
+
Sd && console.warn("[Sailfish] Failed to capture response headers:", e3), H2 = null;
|
|
7881
7934
|
}
|
|
7882
7935
|
return sendEvent({ type: 27, timestamp: U2, sessionId: C3, data: { request_id: I3, session_id: C3, timestamp_start: O2, timestamp_end: U2, response_code: j2, success: z2, error: q2, method: _2, url: x3, retry_without_trace_id: B2, request_headers: D2, request_body: F2, response_headers: H2, response_body: V2 }, ...E2 }), $3;
|
|
7883
7936
|
} catch (m4) {
|
|
7884
7937
|
const w4 = Date.now(), b2 = false, $3 = ((_b = m4.response) == null ? void 0 : _b.status) || 500, B2 = m4.message || "Fetch request failed";
|
|
7885
|
-
if (m4 instanceof TypeError && ((_c2 = m4 == null ? void 0 : m4.message) == null ? void 0 : _c2.toLowerCase().includes(
|
|
7938
|
+
if (m4 instanceof TypeError && ((_c2 = m4 == null ? void 0 : m4.message) == null ? void 0 : _c2.toLowerCase().includes(Cd.toLowerCase()))) return e2.apply(a3, u2);
|
|
7886
7939
|
throw sendEvent({ type: 27, timestamp: w4, sessionId: C3, data: { request_id: I3, session_id: C3, timestamp_start: O2, timestamp_end: w4, response_code: $3, success: b2, error: B2, method: _2, url: x3, request_headers: D2, request_body: F2, response_body: null }, ...E2 }), m4;
|
|
7887
7940
|
}
|
|
7888
7941
|
})(a2, m2, w2, x2, I2, u, C2);
|
|
@@ -7916,7 +7969,7 @@ async function startRecording({ apiKey: e, backendApi: a = "https://api-service.
|
|
|
7916
7969
|
})(), D2 = getOrSetSessionId(), $2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
7917
7970
|
if ($2.sessionId = D2, $2.apiKey = e, $2.backendApi = a, $2.serviceAdditionalMetadata = I2, $2.initialized && $2.sessionId === D2 && $2.ws && 1 === $2.ws.readyState) trackDomainChangesOnce();
|
|
7918
7971
|
else {
|
|
7919
|
-
$2.domEventsInit || (initializeDomContentEvents(D2), $2.domEventsInit = true), $2.consoleInit || (initializeConsolePlugin(
|
|
7972
|
+
$2.domEventsInit || (initializeDomContentEvents(D2), $2.domEventsInit = true), $2.consoleInit || (initializeConsolePlugin(Md, D2), $2.consoleInit = true), $2.errorInit || (!(function initializeErrorInterceptor() {
|
|
7920
7973
|
window.addEventListener("error", (e2) => {
|
|
7921
7974
|
captureError(e2.error || e2.message);
|
|
7922
7975
|
}), window.addEventListener("unhandledrejection", (e2) => {
|
|
@@ -7926,10 +7979,10 @@ async function startRecording({ apiKey: e, backendApi: a = "https://api-service.
|
|
|
7926
7979
|
X && (sessionStorage.setItem("sailfishApiKey", e2), sessionStorage.setItem("sailfishBackendApi", a2));
|
|
7927
7980
|
})({ apiKey: e, backendApi: a }), trackDomainChangesOnce(), sessionStorage.setItem("sailfishApiKey", e), sessionStorage.setItem("sailfishBackendApi", a), !isFunctionSpanTrackingEnabled() || $2.ws && 1 === $2.ws.readyState || fetchFunctionSpanTrackingEnabled(e, a).then((e2) => {
|
|
7928
7981
|
var _a3;
|
|
7929
|
-
((_a3 = e2.data) == null ? void 0 : _a3.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
7982
|
+
((_a3 = e2.data) == null ? void 0 : _a3.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? Sd && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), Sd && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
7930
7983
|
}).catch((e2) => {
|
|
7931
|
-
|
|
7932
|
-
}), $2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e, [...m2, ...
|
|
7984
|
+
Sd && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e2);
|
|
7985
|
+
}), $2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e, [...m2, ...vd], a).catch((e2) => console.error("Failed to send domains to not propagate header to:", e2)), $2.sentDoNotPropagateOnce = true), $2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e2 = []) {
|
|
7933
7986
|
const a2 = XMLHttpRequest.prototype.open, u2 = XMLHttpRequest.prototype.send, m3 = XMLHttpRequest.prototype.setRequestHeader, w3 = getOrSetSessionId();
|
|
7934
7987
|
XMLHttpRequest.prototype.setRequestHeader = function(e3, a3) {
|
|
7935
7988
|
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e3] = a3, m3.call(this, e3, a3);
|
|
@@ -7947,9 +8000,9 @@ async function startRecording({ apiKey: e, backendApi: a = "https://api-service.
|
|
|
7947
8000
|
}
|
|
7948
8001
|
const E3 = getFuncSpanHeader();
|
|
7949
8002
|
if (E3) try {
|
|
7950
|
-
this.setRequestHeader(E3.name, E3.value),
|
|
8003
|
+
this.setRequestHeader(E3.name, E3.value), Sd && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: m4, header: E3.name });
|
|
7951
8004
|
} catch (e3) {
|
|
7952
|
-
|
|
8005
|
+
Sd && console.warn(`[Sailfish] Could not set funcspan header for ${m4}`, e3);
|
|
7953
8006
|
}
|
|
7954
8007
|
const _3 = Date.now();
|
|
7955
8008
|
let O3 = false;
|
|
@@ -7977,7 +8030,7 @@ async function startRecording({ apiKey: e, backendApi: a = "https://api-service.
|
|
|
7977
8030
|
2 === a5.length && (u3[a5[0]] = a5[1]);
|
|
7978
8031
|
});
|
|
7979
8032
|
} catch (e4) {
|
|
7980
|
-
|
|
8033
|
+
Sd && console.warn("[Sailfish] Failed to capture XHR response headers:", e4), u3 = null;
|
|
7981
8034
|
}
|
|
7982
8035
|
if (e3 >= 200 && e3 < 300) emitFinished(true, e3, "", a4, u3);
|
|
7983
8036
|
else {
|
|
@@ -7993,7 +8046,7 @@ async function startRecording({ apiKey: e, backendApi: a = "https://api-service.
|
|
|
7993
8046
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
7994
8047
|
})();
|
|
7995
8048
|
try {
|
|
7996
|
-
const u2 = await fetchCaptureSettings(e, a), m3 = ((_a2 = u2.data) == null ? void 0 : _a2.captureSettingsFromApiKey) ||
|
|
8049
|
+
const u2 = await fetchCaptureSettings(e, a), m3 = ((_a2 = u2.data) == null ? void 0 : _a2.captureSettingsFromApiKey) || Id;
|
|
7997
8050
|
if ($2.ws && 1 === $2.ws.readyState) return;
|
|
7998
8051
|
const b2 = withAppUrlMetadata(I2), x3 = await startRecordingSession(e, D2, a, _2, O2, F2, E2, "JS/TS", b2);
|
|
7999
8052
|
if ((_b = x3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
@@ -8029,7 +8082,7 @@ H && (!(function sendUserDeviceUuid() {
|
|
|
8029
8082
|
const e = document.visibilityState, a = Date.now();
|
|
8030
8083
|
"visible" === e && getOrSetSessionId();
|
|
8031
8084
|
try {
|
|
8032
|
-
sendMessage({ type: "visibilityChange", data: { state: e, url: window.location.href.split("?")[0], timestamp: a, ...getUrlAndStoredUuids() } }),
|
|
8085
|
+
sendMessage({ type: "visibilityChange", data: { state: e, url: window.location.href.split("?")[0], timestamp: a, ...getUrlAndStoredUuids() } }), Sd && console.log(`[Sailfish] Tab became ${e}, sent visibility change event`);
|
|
8033
8086
|
} catch (e2) {
|
|
8034
8087
|
console.warn("[Sailfish] Failed to send visibility change event:", e2);
|
|
8035
8088
|
}
|
|
@@ -8056,9 +8109,9 @@ const initRecorder = async (e) => {
|
|
|
8056
8109
|
})), a.initPromise);
|
|
8057
8110
|
};
|
|
8058
8111
|
export {
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8112
|
+
Id as DEFAULT_CAPTURE_SETTINGS,
|
|
8113
|
+
Md as DEFAULT_CONSOLE_RECORDING_SETTINGS,
|
|
8114
|
+
xd as STORAGE_VERSION,
|
|
8062
8115
|
addOrUpdateMetadata,
|
|
8063
8116
|
buildBatches,
|
|
8064
8117
|
clearStaleFuncSpanState,
|
package/dist/recorder.js.br
CHANGED
|
Binary file
|
package/dist/recorder.js.gz
CHANGED
|
Binary file
|