@openreplay/tracker 17.2.2 → 17.2.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/dist/cjs/entry.js +124 -38
- package/dist/cjs/entry.js.map +1 -1
- package/dist/cjs/index.js +124 -38
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/main/index.d.ts +1 -0
- package/dist/cjs/main/modules/input.d.ts +2 -1
- package/dist/cjs/main/modules/mouse.d.ts +1 -0
- package/dist/cjs/main/utils.d.ts +2 -0
- package/dist/lib/entry.js +124 -38
- package/dist/lib/entry.js.map +1 -1
- package/dist/lib/index.js +124 -38
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/main/index.d.ts +1 -0
- package/dist/lib/main/modules/input.d.ts +2 -1
- package/dist/lib/main/modules/mouse.d.ts +1 -0
- package/dist/lib/main/utils.d.ts +2 -0
- package/dist/types/main/index.d.ts +1 -0
- package/dist/types/main/modules/input.d.ts +2 -1
- package/dist/types/main/modules/mouse.d.ts +1 -0
- package/dist/types/main/utils.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/entry.js
CHANGED
|
@@ -438,6 +438,23 @@ function deprecationWarn(nameOfFeature, useInstead, docsPath = '/') {
|
|
|
438
438
|
console.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ''} Visit ${DOCS_HOST}${docsPath} for more information.`);
|
|
439
439
|
warnedFeatures[nameOfFeature] = true;
|
|
440
440
|
}
|
|
441
|
+
function getCustomAttributeLabel(e, customAttributes) {
|
|
442
|
+
if (!customAttributes || customAttributes.length === 0)
|
|
443
|
+
return '';
|
|
444
|
+
const parts = [];
|
|
445
|
+
for (const attr of customAttributes) {
|
|
446
|
+
const value = e.getAttribute(attr);
|
|
447
|
+
if (value !== null) {
|
|
448
|
+
parts.push(`[${attr}=${value}]`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return parts.join('');
|
|
452
|
+
}
|
|
453
|
+
function getClassSelector(e) {
|
|
454
|
+
if (!e.classList || e.classList.length === 0)
|
|
455
|
+
return '';
|
|
456
|
+
return '.' + Array.from(e.classList).join('.');
|
|
457
|
+
}
|
|
441
458
|
function getLabelAttribute(e) {
|
|
442
459
|
let value = e.getAttribute('data-openreplay-label');
|
|
443
460
|
if (value !== null) {
|
|
@@ -3409,7 +3426,10 @@ class TopObserver extends Observer {
|
|
|
3409
3426
|
this.app.debug.info('doc already observed for', id);
|
|
3410
3427
|
return;
|
|
3411
3428
|
}
|
|
3412
|
-
const observer = new IFrameObserver(this.app, false, {
|
|
3429
|
+
const observer = new IFrameObserver(this.app, false, {
|
|
3430
|
+
disableSprites: this.options.disableSprites,
|
|
3431
|
+
...getInlineOptions(this.options.inlineCss, console.warn),
|
|
3432
|
+
});
|
|
3413
3433
|
this.iframeObservers.set(iframe, observer);
|
|
3414
3434
|
this.docObservers.set(currentDoc, observer);
|
|
3415
3435
|
this.iframeObserversArr.push(observer);
|
|
@@ -3431,7 +3451,10 @@ class TopObserver extends Observer {
|
|
|
3431
3451
|
handle();
|
|
3432
3452
|
}
|
|
3433
3453
|
handleShadowRoot(shRoot) {
|
|
3434
|
-
const observer = new ShadowRootObserver(this.app
|
|
3454
|
+
const observer = new ShadowRootObserver(this.app, false, {
|
|
3455
|
+
disableSprites: this.options.disableSprites,
|
|
3456
|
+
...getInlineOptions(this.options.inlineCss, console.warn),
|
|
3457
|
+
});
|
|
3435
3458
|
this.shadowRootObservers.set(shRoot, observer);
|
|
3436
3459
|
observer.observe(shRoot.host);
|
|
3437
3460
|
}
|
|
@@ -3467,7 +3490,10 @@ class TopObserver extends Observer {
|
|
|
3467
3490
|
};
|
|
3468
3491
|
this.app.nodes.clear();
|
|
3469
3492
|
this.app.nodes.crossdomainMode(frameLevel, frameOder);
|
|
3470
|
-
const iframeObserver = new IFrameObserver(this.app
|
|
3493
|
+
const iframeObserver = new IFrameObserver(this.app, false, {
|
|
3494
|
+
disableSprites: this.options.disableSprites,
|
|
3495
|
+
...getInlineOptions(this.options.inlineCss, console.warn),
|
|
3496
|
+
});
|
|
3471
3497
|
this.iframeObservers.set(window.document, iframeObserver);
|
|
3472
3498
|
iframeObserver.syntheticObserve(rootNodeId, window.document);
|
|
3473
3499
|
}
|
|
@@ -3826,7 +3852,7 @@ class App {
|
|
|
3826
3852
|
this.stopCallbacks = [];
|
|
3827
3853
|
this.commitCallbacks = [];
|
|
3828
3854
|
this.activityState = ActivityState.NotActive;
|
|
3829
|
-
this.version = '17.2.
|
|
3855
|
+
this.version = '17.2.3'; // TODO: version compatability check inside each plugin.
|
|
3830
3856
|
this.socketMode = false;
|
|
3831
3857
|
this.compressionThreshold = 24 * 1000;
|
|
3832
3858
|
this.bc = null;
|
|
@@ -4256,9 +4282,6 @@ class App {
|
|
|
4256
4282
|
window.addEventListener('message', this.parentCrossDomainFrameListener);
|
|
4257
4283
|
window.addEventListener('message', this.crossDomainIframeListener);
|
|
4258
4284
|
setInterval(() => {
|
|
4259
|
-
if (document.hidden) {
|
|
4260
|
-
return;
|
|
4261
|
-
}
|
|
4262
4285
|
window.parent.postMessage({
|
|
4263
4286
|
line: proto.polling,
|
|
4264
4287
|
context: this.contextId,
|
|
@@ -5728,19 +5751,21 @@ const labelElementFor = IN_BROWSER && 'labels' in HTMLInputElement.prototype
|
|
|
5728
5751
|
}
|
|
5729
5752
|
}
|
|
5730
5753
|
};
|
|
5731
|
-
function getInputLabel(node) {
|
|
5732
|
-
|
|
5733
|
-
if (
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5754
|
+
function getInputLabel(node, customAttributes) {
|
|
5755
|
+
const openreplayLabel = getLabelAttribute(node);
|
|
5756
|
+
if (openreplayLabel !== null)
|
|
5757
|
+
return normSpaces(openreplayLabel).slice(0, 100);
|
|
5758
|
+
const customAttributeLabel = getCustomAttributeLabel(node, customAttributes);
|
|
5759
|
+
if (customAttributeLabel)
|
|
5760
|
+
return customAttributeLabel;
|
|
5761
|
+
if (node.id)
|
|
5762
|
+
return `#${node.id}`;
|
|
5763
|
+
const classLabel = getClassSelector(node);
|
|
5764
|
+
if (classLabel)
|
|
5765
|
+
return classLabel;
|
|
5766
|
+
const labelElement = labelElementFor(node);
|
|
5767
|
+
const label = node.name || node.placeholder || (labelElement && labelElement.innerText) || node.type;
|
|
5768
|
+
return normSpaces(label || '').slice(0, 100);
|
|
5744
5769
|
}
|
|
5745
5770
|
const InputMode = {
|
|
5746
5771
|
Plain: 0,
|
|
@@ -5821,7 +5846,7 @@ function Input (app, opts) {
|
|
|
5821
5846
|
}, 3);
|
|
5822
5847
|
function sendInputChange(id, node, hesitationTime, inputTime) {
|
|
5823
5848
|
const { value, mask } = getInputValue(id, node);
|
|
5824
|
-
let label = getInputLabel(node);
|
|
5849
|
+
let label = getInputLabel(node, options.customAttributes);
|
|
5825
5850
|
if (app.sanitizer.privateMode) {
|
|
5826
5851
|
label = label.replaceAll(/./g, '*');
|
|
5827
5852
|
}
|
|
@@ -5930,21 +5955,28 @@ function _getTarget(target, document) {
|
|
|
5930
5955
|
return target === document.documentElement ? null : target;
|
|
5931
5956
|
}
|
|
5932
5957
|
function Mouse (app, options) {
|
|
5933
|
-
const { disableClickmaps = false } = options || {};
|
|
5958
|
+
const { disableClickmaps = false, customAttributes } = options || {};
|
|
5934
5959
|
function getTargetLabel(target) {
|
|
5935
5960
|
const dl = getLabelAttribute(target);
|
|
5936
5961
|
if (dl !== null) {
|
|
5937
5962
|
return dl;
|
|
5938
5963
|
}
|
|
5939
5964
|
if (hasTag(target, 'input')) {
|
|
5940
|
-
return getInputLabel(target);
|
|
5941
|
-
}
|
|
5965
|
+
return getInputLabel(target, customAttributes);
|
|
5966
|
+
}
|
|
5967
|
+
const customAttributeLabel = getCustomAttributeLabel(target, customAttributes);
|
|
5968
|
+
if (customAttributeLabel)
|
|
5969
|
+
return customAttributeLabel;
|
|
5970
|
+
if (target.id)
|
|
5971
|
+
return `#${target.id}`;
|
|
5972
|
+
const classLabel = getClassSelector(target);
|
|
5973
|
+
if (classLabel)
|
|
5974
|
+
return classLabel;
|
|
5942
5975
|
if (isClickable(target)) {
|
|
5943
5976
|
let label = '';
|
|
5944
5977
|
if (target instanceof HTMLElement) {
|
|
5945
5978
|
label = app.sanitizer.getInnerTextSecure(target);
|
|
5946
5979
|
}
|
|
5947
|
-
label = label || target.id || target.className;
|
|
5948
5980
|
return normSpaces(label).slice(0, 100);
|
|
5949
5981
|
}
|
|
5950
5982
|
return '';
|
|
@@ -6088,6 +6120,11 @@ function getCSSPath(el) {
|
|
|
6088
6120
|
return false;
|
|
6089
6121
|
if (el.id)
|
|
6090
6122
|
return `#${cssEscape(el.id)}`;
|
|
6123
|
+
// if has data attributes - use them as they are more likely to be stable and unique
|
|
6124
|
+
const dataAttr = Array.from(el.attributes).find(attr => attr.name.startsWith('data-'));
|
|
6125
|
+
if (dataAttr) {
|
|
6126
|
+
return `[${dataAttr.name}="${cssEscape(dataAttr.value)}"]`;
|
|
6127
|
+
}
|
|
6091
6128
|
const parts = [];
|
|
6092
6129
|
while (el && el.nodeType === 1 && el !== el.ownerDocument) {
|
|
6093
6130
|
if (el.id) {
|
|
@@ -6139,7 +6176,7 @@ function getUniqueSiblingClass(el) {
|
|
|
6139
6176
|
return null;
|
|
6140
6177
|
}
|
|
6141
6178
|
|
|
6142
|
-
|
|
6179
|
+
let e=-1;const t=t=>{addEventListener("pageshow",(n=>{n.persisted&&(e=n.timeStamp,t(n));}),true);},n=(e,t,n,i)=>{let s,o;return r=>{t.value>=0&&(r||i)&&(o=t.value-(s??0),(o||void 0===s)&&(s=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)));}},i=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))));},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},o=()=>{const e=s();return e?.activationStart??0},r=(t,n=-1)=>{const i=s();let r="navigate";e>=0?r="back-forward-cache":i&&(document.prerendering||o()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-")));return {name:t,value:n,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},c=new WeakMap;function a(e,t){return c.get(e)||c.set(e,new t),c.get(e)}class d{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e);}}const h=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries());}));}));return i.observe({type:e,buffered:!0,...n}),i}}catch{}},f=e=>{let t=false;return ()=>{t||(e(),t=true);}};let u=-1;const l=new Set,m=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,p=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(u)||(u="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",p,true));}},v=()=>{if(u<0){const e=o(),n=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;u=n??m(),addEventListener("visibilitychange",p,true),addEventListener("prerenderingchange",p,true),t((()=>{setTimeout((()=>{u=m();}));}));}return {get firstHiddenTime(){return u},onHidden(e){l.add(e);}}},g=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),true):e();},y=[1800,3e3],E=(e,s={})=>{g((()=>{const c=v();let a,d=r("FCP");const f=h("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<c.firstHiddenTime&&(d.value=Math.max(t.startTime-o(),0),d.entries.push(t),a(true)));}));f&&(a=n(e,d,y,s.reportAllChanges),t((t=>{d=r("FCP"),a=n(e,d,y,s.reportAllChanges),i((()=>{d.value=performance.now()-t.timeStamp,a(true);}));})));}));},b=[.1,.25],L=(e,s={})=>{const o=v();E(f((()=>{let c,f=r("CLS",0);const u=a(s,d),l=e=>{for(const t of e)u.h(t);u.i>f.value&&(f.value=u.i,f.entries=u.o,c());},m=h("layout-shift",l);m&&(c=n(e,f,b,s.reportAllChanges),o.onHidden((()=>{l(m.takeRecords()),c(true);})),t((()=>{u.i=0,f=r("CLS",0),c=n(e,f,b,s.reportAllChanges),i((()=>c()));})),setTimeout(c));})));};let P=0,T=1/0,_=0;const M=e=>{for(const t of e)t.interactionId&&(T=Math.min(T,t.interactionId),_=Math.max(_,t.interactionId),P=_?(_-T)/7+1:0);};let w;const C=()=>w?P:performance.interactionCount??0,I=()=>{"interactionCount"in performance||w||(w=h("event",M,{type:"event",buffered:true,durationThreshold:0}));};let F=0;class k{u=[];l=new Map;m;p;v(){F=C(),this.u.length=0,this.l.clear();}L(){const e=Math.min(this.u.length-1,Math.floor((C()-F)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id);}this.p?.(n);}}}const A=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=f(e),addEventListener("visibilitychange",e,{once:true,capture:true}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:true});})));},B=[200,500],S=(e,i={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const s=v();g((()=>{I();let o,c=r("INP");const d=a(i,k),f=e=>{A((()=>{for(const t of e)d.h(t);const t=d.L();t&&t.P!==c.value&&(c.value=t.P,c.entries=t.entries,o());}));},u=h("event",f,{durationThreshold:i.durationThreshold??40});o=n(e,c,B,i.reportAllChanges),u&&(u.observe({type:"first-input",buffered:true}),s.onHidden((()=>{f(u.takeRecords()),o(true);})),t((()=>{d.v(),c=r("INP"),o=n(e,c,B,i.reportAllChanges);})));}));};class N{m;h(e){this.m?.(e);}}const q=[2500,4e3],x=(e,s={})=>{g((()=>{const c=v();let d,u=r("LCP");const l=a(s,N),m=e=>{s.reportAllChanges||(e=e.slice(-1));for(const t of e)l.h(t),t.startTime<c.firstHiddenTime&&(u.value=Math.max(t.startTime-o(),0),u.entries=[t],d());},p=h("largest-contentful-paint",m);if(p){d=n(e,u,q,s.reportAllChanges);const o=f((()=>{m(p.takeRecords()),p.disconnect(),d(true);})),c=e=>{e.isTrusted&&(A(o),removeEventListener(e.type,c,{capture:true}));};for(const e of ["keydown","click","visibilitychange"])addEventListener(e,c,{capture:true});t((t=>{u=r("LCP"),d=n(e,u,q,s.reportAllChanges),i((()=>{u.value=performance.now()-t.timeStamp,d(true);}));}));}}));},H=[800,1800],O=e=>{document.prerendering?g((()=>O(e))):"complete"!==document.readyState?addEventListener("load",(()=>O(e)),true):setTimeout(e);},$=(e,i={})=>{let c=r("TTFB"),a=n(e,c,H,i.reportAllChanges);O((()=>{const d=s();d&&(c.value=Math.max(d.responseStart-o(),0),c.entries=[d],a(true),t((()=>{c=r("TTFB",0),a=n(e,c,H,i.reportAllChanges),a(true);})));}));};
|
|
6143
6180
|
|
|
6144
6181
|
function getPaintBlocks(resources) {
|
|
6145
6182
|
const paintBlocks = [];
|
|
@@ -6272,10 +6309,10 @@ function Timing (app, opts) {
|
|
|
6272
6309
|
// onINP(): Chromium
|
|
6273
6310
|
// onLCP(): Chromium, Firefox
|
|
6274
6311
|
// onTTFB(): Chromium, Firefox, Safari
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6312
|
+
L(onVitalsSignal);
|
|
6313
|
+
S(onVitalsSignal);
|
|
6314
|
+
x(onVitalsSignal);
|
|
6315
|
+
$(onVitalsSignal);
|
|
6279
6316
|
});
|
|
6280
6317
|
app.attachStopCallback(function () {
|
|
6281
6318
|
observer.disconnect();
|
|
@@ -7076,7 +7113,9 @@ class NetworkMessage {
|
|
|
7076
7113
|
});
|
|
7077
7114
|
if (!messageInfo)
|
|
7078
7115
|
return null;
|
|
7079
|
-
const
|
|
7116
|
+
const gqlHeader = "application/graphql-response";
|
|
7117
|
+
const isGraphql = messageInfo.url.includes("/graphql")
|
|
7118
|
+
|| Object.values(messageInfo.request.headers).some(v => v.includes(gqlHeader));
|
|
7080
7119
|
if (isGraphql && messageInfo.response.body && typeof messageInfo.response.body === 'string') {
|
|
7081
7120
|
const isError = messageInfo.response.body.includes("errors");
|
|
7082
7121
|
messageInfo.status = isError ? 400 : 200;
|
|
@@ -7382,6 +7421,7 @@ class FetchProxyHandler {
|
|
|
7382
7421
|
this.tokenUrlMatcher = tokenUrlMatcher;
|
|
7383
7422
|
}
|
|
7384
7423
|
apply(target, _, argsList) {
|
|
7424
|
+
var _a;
|
|
7385
7425
|
const input = argsList[0];
|
|
7386
7426
|
const init = argsList[1];
|
|
7387
7427
|
if (!input ||
|
|
@@ -7397,6 +7437,31 @@ class FetchProxyHandler {
|
|
|
7397
7437
|
}
|
|
7398
7438
|
const item = new NetworkMessage(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
|
|
7399
7439
|
this.beforeFetch(item, input, init);
|
|
7440
|
+
const signal = (argsList[0] instanceof Request ? argsList[0].signal : undefined) ||
|
|
7441
|
+
((_a = argsList[1]) === null || _a === void 0 ? void 0 : _a.signal);
|
|
7442
|
+
// guard to avoid double-send
|
|
7443
|
+
let abortedNotified = false;
|
|
7444
|
+
const notifyAbort = () => {
|
|
7445
|
+
if (abortedNotified)
|
|
7446
|
+
return;
|
|
7447
|
+
abortedNotified = true;
|
|
7448
|
+
item.endTime = performance.now();
|
|
7449
|
+
item.duration = item.endTime - (item.startTime || item.endTime);
|
|
7450
|
+
item.status = 0;
|
|
7451
|
+
item.statusText = "Aborted";
|
|
7452
|
+
item.readyState = 0;
|
|
7453
|
+
const msg = item.getMessage();
|
|
7454
|
+
if (msg)
|
|
7455
|
+
this.sendMessage(msg);
|
|
7456
|
+
};
|
|
7457
|
+
if (signal) {
|
|
7458
|
+
if (signal.aborted) {
|
|
7459
|
+
notifyAbort();
|
|
7460
|
+
}
|
|
7461
|
+
else {
|
|
7462
|
+
signal.addEventListener("abort", notifyAbort, { once: true });
|
|
7463
|
+
}
|
|
7464
|
+
}
|
|
7400
7465
|
this.setSessionTokenHeader((name, value) => {
|
|
7401
7466
|
if (this.tokenUrlMatcher !== undefined) {
|
|
7402
7467
|
if (!this.tokenUrlMatcher(item.url)) {
|
|
@@ -7425,11 +7490,22 @@ class FetchProxyHandler {
|
|
|
7425
7490
|
}
|
|
7426
7491
|
});
|
|
7427
7492
|
return target.apply(window, argsList)
|
|
7428
|
-
.then(this.afterFetch(item)
|
|
7493
|
+
.then(this.afterFetch(item, () => {
|
|
7494
|
+
abortedNotified = true;
|
|
7495
|
+
}))
|
|
7429
7496
|
.catch((e) => {
|
|
7430
|
-
// mock finally
|
|
7431
7497
|
item.endTime = performance.now();
|
|
7432
7498
|
item.duration = item.endTime - (item.startTime || item.endTime);
|
|
7499
|
+
if (e && e.name === "AbortError") {
|
|
7500
|
+
item.status = 0;
|
|
7501
|
+
item.statusText = "Aborted";
|
|
7502
|
+
item.readyState = 0;
|
|
7503
|
+
if (!abortedNotified) {
|
|
7504
|
+
const msg = item.getMessage();
|
|
7505
|
+
if (msg)
|
|
7506
|
+
this.sendMessage(msg);
|
|
7507
|
+
}
|
|
7508
|
+
}
|
|
7433
7509
|
throw e;
|
|
7434
7510
|
});
|
|
7435
7511
|
}
|
|
@@ -7481,8 +7557,10 @@ class FetchProxyHandler {
|
|
|
7481
7557
|
item.requestData = genStringBody(init.body);
|
|
7482
7558
|
}
|
|
7483
7559
|
}
|
|
7484
|
-
afterFetch(item) {
|
|
7560
|
+
afterFetch(item, onResolved) {
|
|
7485
7561
|
return (resp) => {
|
|
7562
|
+
if (onResolved)
|
|
7563
|
+
onResolved === null || onResolved === void 0 ? void 0 : onResolved();
|
|
7486
7564
|
item.endTime = performance.now();
|
|
7487
7565
|
item.duration = item.endTime - (item.startTime || item.endTime);
|
|
7488
7566
|
item.status = resp.status;
|
|
@@ -7518,7 +7596,15 @@ class FetchProxyHandler {
|
|
|
7518
7596
|
}
|
|
7519
7597
|
})
|
|
7520
7598
|
.catch((e) => {
|
|
7521
|
-
if (e.name
|
|
7599
|
+
if (e.name === "AbortError") {
|
|
7600
|
+
item.status = 0;
|
|
7601
|
+
item.statusText = "Aborted";
|
|
7602
|
+
item.readyState = 0;
|
|
7603
|
+
const msg = item.getMessage();
|
|
7604
|
+
if (msg)
|
|
7605
|
+
this.sendMessage(msg);
|
|
7606
|
+
}
|
|
7607
|
+
else {
|
|
7522
7608
|
throw e;
|
|
7523
7609
|
}
|
|
7524
7610
|
});
|
|
@@ -8619,7 +8705,7 @@ class ConstantProperties {
|
|
|
8619
8705
|
user_id: this.user_id,
|
|
8620
8706
|
distinct_id: this.deviceId,
|
|
8621
8707
|
sdk_edition: 'web',
|
|
8622
|
-
sdk_version: '17.2.
|
|
8708
|
+
sdk_version: '17.2.3',
|
|
8623
8709
|
timezone: getUTCOffsetString(),
|
|
8624
8710
|
search_engine: this.searchEngine,
|
|
8625
8711
|
};
|
|
@@ -9271,7 +9357,7 @@ class API {
|
|
|
9271
9357
|
this.signalStartIssue = (reason, missingApi) => {
|
|
9272
9358
|
const doNotTrack = this.checkDoNotTrack();
|
|
9273
9359
|
console.log("Tracker couldn't start due to:", JSON.stringify({
|
|
9274
|
-
trackerVersion: '17.2.
|
|
9360
|
+
trackerVersion: '17.2.3',
|
|
9275
9361
|
projectKey: this.options.projectKey,
|
|
9276
9362
|
doNotTrack,
|
|
9277
9363
|
reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
|
|
@@ -9434,7 +9520,7 @@ class API {
|
|
|
9434
9520
|
// no tabs in iframes yet
|
|
9435
9521
|
Tabs(app);
|
|
9436
9522
|
}
|
|
9437
|
-
Mouse(app, options.mouse);
|
|
9523
|
+
Mouse(app, { ...options.mouse, customAttributes: options.customAttributes });
|
|
9438
9524
|
// inside iframe, we ignore viewport scroll
|
|
9439
9525
|
Scroll(app, this.crossdomainMode);
|
|
9440
9526
|
CSSRules(app, options.css);
|