@openreplay/tracker 8.0.0 → 8.0.1-beta14
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/cjs/app/index.d.ts +4 -1
- package/cjs/app/index.js +18 -2
- package/cjs/app/session.d.ts +10 -0
- package/cjs/app/session.js +3 -0
- package/cjs/index.d.ts +11 -0
- package/cjs/index.js +28 -1
- package/cjs/modules/Network/fetchProxy.d.ts +34 -0
- package/cjs/modules/Network/fetchProxy.js +240 -0
- package/cjs/modules/Network/index.d.ts +3 -0
- package/cjs/modules/Network/index.js +9 -0
- package/cjs/modules/Network/networkMessage.d.ts +49 -0
- package/cjs/modules/Network/networkMessage.js +82 -0
- package/cjs/modules/Network/types.d.ts +13 -0
- package/cjs/modules/Network/types.js +3 -0
- package/cjs/modules/Network/utils.d.ts +11 -0
- package/cjs/modules/Network/utils.js +213 -0
- package/cjs/modules/Network/xhrProxy.d.ts +47 -0
- package/cjs/modules/Network/xhrProxy.js +209 -0
- package/cjs/modules/console.js +21 -13
- package/cjs/modules/featureFlags.d.ts +25 -0
- package/cjs/modules/featureFlags.js +100 -0
- package/cjs/modules/network.d.ts +3 -4
- package/cjs/modules/network.js +13 -3
- package/coverage/clover.xml +898 -449
- package/coverage/coverage-final.json +13 -8
- package/coverage/lcov-report/index.html +50 -35
- package/coverage/lcov-report/main/app/guards.ts.html +1 -1
- package/coverage/lcov-report/main/app/index.html +21 -21
- package/coverage/lcov-report/main/app/index.ts.html +46 -4
- package/coverage/lcov-report/main/app/logger.ts.html +1 -1
- package/coverage/lcov-report/main/app/messages.gen.ts.html +146 -146
- package/coverage/lcov-report/main/app/observer/iframe_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/iframe_offsets.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/index.html +1 -1
- package/coverage/lcov-report/main/app/observer/shadow_root_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/top_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/sanitizer.ts.html +1 -1
- package/coverage/lcov-report/main/app/session.ts.html +47 -5
- package/coverage/lcov-report/main/app/ticker.ts.html +1 -1
- package/coverage/lcov-report/main/index.html +20 -20
- package/coverage/lcov-report/main/index.ts.html +38 -26
- package/coverage/lcov-report/main/modules/Network/fetchProxy.ts.html +949 -0
- package/coverage/lcov-report/main/modules/Network/index.html +176 -0
- package/coverage/lcov-report/main/modules/Network/index.ts.html +169 -0
- package/coverage/lcov-report/main/modules/Network/networkMessage.ts.html +382 -0
- package/coverage/lcov-report/main/modules/Network/utils.ts.html +700 -0
- package/coverage/lcov-report/main/modules/Network/xhrProxy.ts.html +823 -0
- package/coverage/lcov-report/main/modules/attributeSender.ts.html +1 -1
- package/coverage/lcov-report/main/modules/axiosSpy.ts.html +1 -1
- package/coverage/lcov-report/main/modules/connection.ts.html +1 -1
- package/coverage/lcov-report/main/modules/console.ts.html +174 -147
- package/coverage/lcov-report/main/modules/constructedStyleSheets.ts.html +1 -1
- package/coverage/lcov-report/main/modules/cssrules.ts.html +1 -1
- package/coverage/lcov-report/main/modules/exception.ts.html +1 -1
- package/coverage/lcov-report/main/modules/featureFlags.ts.html +102 -51
- package/coverage/lcov-report/main/modules/focus.ts.html +1 -1
- package/coverage/lcov-report/main/modules/fonts.ts.html +1 -1
- package/coverage/lcov-report/main/modules/img.ts.html +1 -1
- package/coverage/lcov-report/main/modules/index.html +33 -33
- package/coverage/lcov-report/main/modules/input.ts.html +1 -1
- package/coverage/lcov-report/main/modules/mouse.ts.html +1 -1
- package/coverage/lcov-report/main/modules/network.ts.html +70 -70
- package/coverage/lcov-report/main/modules/performance.ts.html +1 -1
- package/coverage/lcov-report/main/modules/scroll.ts.html +1 -1
- package/coverage/lcov-report/main/modules/selection.ts.html +1 -1
- package/coverage/lcov-report/main/modules/tabs.ts.html +1 -1
- package/coverage/lcov-report/main/modules/timing.ts.html +1 -1
- package/coverage/lcov-report/main/modules/viewport.ts.html +1 -1
- package/coverage/lcov-report/main/utils.ts.html +45 -45
- package/coverage/lcov-report/webworker/BatchWriter.ts.html +1 -1
- package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +1 -1
- package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +1 -1
- package/coverage/lcov-report/webworker/QueueSender.ts.html +1 -1
- package/coverage/lcov-report/webworker/index.html +1 -1
- package/coverage/lcov-report/webworker/index.ts.html +1 -1
- package/coverage/lcov.info +1558 -726
- package/lib/app/index.d.ts +4 -1
- package/lib/app/index.js +18 -2
- package/lib/app/session.d.ts +10 -0
- package/lib/app/session.js +3 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +28 -1
- package/lib/modules/Network/fetchProxy.d.ts +34 -0
- package/lib/modules/Network/fetchProxy.js +234 -0
- package/lib/modules/Network/index.d.ts +3 -0
- package/lib/modules/Network/index.js +6 -0
- package/lib/modules/Network/networkMessage.d.ts +49 -0
- package/lib/modules/Network/networkMessage.js +78 -0
- package/lib/modules/Network/types.d.ts +13 -0
- package/lib/modules/Network/types.js +2 -0
- package/lib/modules/Network/utils.d.ts +11 -0
- package/lib/modules/Network/utils.js +201 -0
- package/lib/modules/Network/xhrProxy.d.ts +47 -0
- package/lib/modules/Network/xhrProxy.js +204 -0
- package/lib/modules/console.js +21 -13
- package/lib/modules/featureFlags.d.ts +25 -0
- package/lib/modules/featureFlags.js +97 -0
- package/lib/modules/network.d.ts +3 -4
- package/lib/modules/network.js +13 -3
- package/package.json +1 -1
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/127</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/54</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
40
|
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/
|
|
42
|
+
<span class='fraction'>0/27</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/124</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -416,36 +416,7 @@
|
|
|
416
416
|
<span class="cline-any cline-no"> </span>
|
|
417
417
|
<span class="cline-any cline-neutral"> </span>
|
|
418
418
|
<span class="cline-any cline-no"> </span>
|
|
419
|
-
<span class="cline-any cline-
|
|
420
|
-
<span class="cline-any cline-neutral"> </span>
|
|
421
|
-
<span class="cline-any cline-neutral"> </span>
|
|
422
|
-
<span class="cline-any cline-neutral"> </span>
|
|
423
|
-
<span class="cline-any cline-neutral"> </span>
|
|
424
|
-
<span class="cline-any cline-neutral"> </span>
|
|
425
|
-
<span class="cline-any cline-neutral"> </span>
|
|
426
|
-
<span class="cline-any cline-neutral"> </span>
|
|
427
|
-
<span class="cline-any cline-neutral"> </span>
|
|
428
|
-
<span class="cline-any cline-neutral"> </span>
|
|
429
|
-
<span class="cline-any cline-neutral"> </span>
|
|
430
|
-
<span class="cline-any cline-neutral"> </span>
|
|
431
|
-
<span class="cline-any cline-neutral"> </span>
|
|
432
|
-
<span class="cline-any cline-neutral"> </span>
|
|
433
|
-
<span class="cline-any cline-neutral"> </span>
|
|
434
|
-
<span class="cline-any cline-neutral"> </span>
|
|
435
|
-
<span class="cline-any cline-neutral"> </span>
|
|
436
|
-
<span class="cline-any cline-neutral"> </span>
|
|
437
|
-
<span class="cline-any cline-neutral"> </span>
|
|
438
|
-
<span class="cline-any cline-neutral"> </span>
|
|
439
|
-
<span class="cline-any cline-neutral"> </span>
|
|
440
|
-
<span class="cline-any cline-neutral"> </span>
|
|
441
|
-
<span class="cline-any cline-neutral"> </span>
|
|
442
|
-
<span class="cline-any cline-neutral"> </span>
|
|
443
|
-
<span class="cline-any cline-neutral"> </span>
|
|
444
|
-
<span class="cline-any cline-neutral"> </span>
|
|
445
|
-
<span class="cline-any cline-neutral"> </span>
|
|
446
|
-
<span class="cline-any cline-neutral"> </span>
|
|
447
|
-
<span class="cline-any cline-neutral"> </span>
|
|
448
|
-
<span class="cline-any cline-neutral"> </span>
|
|
419
|
+
<span class="cline-any cline-no"> </span>
|
|
449
420
|
<span class="cline-any cline-neutral"> </span>
|
|
450
421
|
<span class="cline-any cline-neutral"> </span>
|
|
451
422
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -499,6 +470,7 @@
|
|
|
499
470
|
<span class="cline-any cline-neutral"> </span>
|
|
500
471
|
<span class="cline-any cline-neutral"> </span>
|
|
501
472
|
<span class="cline-any cline-neutral"> </span>
|
|
473
|
+
<span class="cline-any cline-neutral"> </span>
|
|
502
474
|
<span class="cline-any cline-no"> </span>
|
|
503
475
|
<span class="cline-any cline-no"> </span>
|
|
504
476
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -512,6 +484,7 @@
|
|
|
512
484
|
<span class="cline-any cline-neutral"> </span>
|
|
513
485
|
<span class="cline-any cline-neutral"> </span>
|
|
514
486
|
<span class="cline-any cline-neutral"> </span>
|
|
487
|
+
<span class="cline-any cline-neutral"> </span>
|
|
515
488
|
<span class="cline-any cline-no"> </span>
|
|
516
489
|
<span class="cline-any cline-no"> </span>
|
|
517
490
|
<span class="cline-any cline-no"> </span>
|
|
@@ -531,6 +504,7 @@
|
|
|
531
504
|
<span class="cline-any cline-neutral"> </span>
|
|
532
505
|
<span class="cline-any cline-neutral"> </span>
|
|
533
506
|
<span class="cline-any cline-no"> </span>
|
|
507
|
+
<span class="cline-any cline-neutral"> </span>
|
|
534
508
|
<span class="cline-any cline-no"> </span>
|
|
535
509
|
<span class="cline-any cline-no"> </span>
|
|
536
510
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -562,6 +536,17 @@
|
|
|
562
536
|
<span class="cline-any cline-no"> </span>
|
|
563
537
|
<span class="cline-any cline-neutral"> </span>
|
|
564
538
|
<span class="cline-any cline-no"> </span>
|
|
539
|
+
<span class="cline-any cline-no"> </span>
|
|
540
|
+
<span class="cline-any cline-neutral"> </span>
|
|
541
|
+
<span class="cline-any cline-neutral"> </span>
|
|
542
|
+
<span class="cline-any cline-neutral"> </span>
|
|
543
|
+
<span class="cline-any cline-neutral"> </span>
|
|
544
|
+
<span class="cline-any cline-no"> </span>
|
|
545
|
+
<span class="cline-any cline-no"> </span>
|
|
546
|
+
<span class="cline-any cline-neutral"> </span>
|
|
547
|
+
<span class="cline-any cline-neutral"> </span>
|
|
548
|
+
<span class="cline-any cline-neutral"> </span>
|
|
549
|
+
<span class="cline-any cline-no"> </span>
|
|
565
550
|
<span class="cline-any cline-neutral"> </span>
|
|
566
551
|
<span class="cline-any cline-no"> </span>
|
|
567
552
|
<span class="cline-any cline-no"> </span>
|
|
@@ -627,6 +612,7 @@
|
|
|
627
612
|
<span class="cline-any cline-neutral"> </span>
|
|
628
613
|
<span class="cline-any cline-neutral"> </span>
|
|
629
614
|
<span class="cline-any cline-neutral"> </span>
|
|
615
|
+
<span class="cline-any cline-neutral"> </span>
|
|
630
616
|
<span class="cline-any cline-no"> </span>
|
|
631
617
|
<span class="cline-any cline-no"> </span>
|
|
632
618
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -646,6 +632,19 @@
|
|
|
646
632
|
<span class="cline-any cline-neutral"> </span>
|
|
647
633
|
<span class="cline-any cline-no"> </span>
|
|
648
634
|
<span class="cline-any cline-neutral"> </span>
|
|
635
|
+
<span class="cline-any cline-neutral"> </span>
|
|
636
|
+
<span class="cline-any cline-neutral"> </span>
|
|
637
|
+
<span class="cline-any cline-neutral"> </span>
|
|
638
|
+
<span class="cline-any cline-neutral"> </span>
|
|
639
|
+
<span class="cline-any cline-neutral"> </span>
|
|
640
|
+
<span class="cline-any cline-neutral"> </span>
|
|
641
|
+
<span class="cline-any cline-neutral"> </span>
|
|
642
|
+
<span class="cline-any cline-neutral"> </span>
|
|
643
|
+
<span class="cline-any cline-neutral"> </span>
|
|
644
|
+
<span class="cline-any cline-neutral"> </span>
|
|
645
|
+
<span class="cline-any cline-neutral"> </span>
|
|
646
|
+
<span class="cline-any cline-no"> </span>
|
|
647
|
+
<span class="cline-any cline-neutral"> </span>
|
|
649
648
|
<span class="cline-any cline-no"> </span>
|
|
650
649
|
<span class="cline-any cline-neutral"> </span>
|
|
651
650
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -697,6 +696,7 @@
|
|
|
697
696
|
<span class="cline-any cline-neutral"> </span>
|
|
698
697
|
<span class="cline-any cline-neutral"> </span>
|
|
699
698
|
<span class="cline-any cline-neutral"> </span>
|
|
699
|
+
<span class="cline-any cline-neutral"> </span>
|
|
700
700
|
<span class="cline-any cline-no"> </span>
|
|
701
701
|
<span class="cline-any cline-no"> </span>
|
|
702
702
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -764,42 +764,13 @@
|
|
|
764
764
|
<span class="cstat-no" title="statement not covered" >import { getTimeOrigin } from '../utils.js'</span>
|
|
765
765
|
import type { AxiosInstance } from './axiosSpy.js'
|
|
766
766
|
<span class="cstat-no" title="statement not covered" >import axiosSpy from './axiosSpy.js'</span>
|
|
767
|
+
<span class="cstat-no" title="statement not covered" >import setProxy from './Network/index.js'</span>
|
|
767
768
|
|
|
768
769
|
type WindowFetch = typeof window.fetch
|
|
769
770
|
type XHRRequestBody = Parameters<XMLHttpRequest['send']>[0]
|
|
770
|
-
type FetchRequestBody = RequestInit['body']
|
|
771
|
-
|
|
772
|
-
// Request:
|
|
773
|
-
// declare const enum BodyType {
|
|
774
|
-
// Blob = "Blob",
|
|
775
|
-
// ArrayBuffer = "ArrayBuffer",
|
|
776
|
-
// TypedArray = "TypedArray",
|
|
777
|
-
// DataView = "DataView",
|
|
778
|
-
// FormData = "FormData",
|
|
779
|
-
// URLSearchParams = "URLSearchParams",
|
|
780
|
-
// Document = "Document", // XHR only
|
|
781
|
-
// ReadableStream = "ReadableStream", // Fetch only
|
|
782
|
-
// Literal = "literal",
|
|
783
|
-
// Unknown = "unk",
|
|
784
|
-
// }
|
|
785
|
-
// XHRResponse body: ArrayBuffer, a Blob, a Document, a JavaScript Object, or a string
|
|
786
|
-
|
|
787
|
-
// TODO: extract maximum of useful information from any type of Request/Response bodies
|
|
788
|
-
// function objectifyBody(body: any): RequestBody {
|
|
789
|
-
// if (body instanceof Blob) {
|
|
790
|
-
// return {
|
|
791
|
-
// body: `<Blob type: ${body.type}>; size: ${body.size}`,
|
|
792
|
-
// bodyType: BodyType.Blob,
|
|
793
|
-
// }
|
|
794
|
-
// }
|
|
795
|
-
// return {
|
|
796
|
-
// body,
|
|
797
|
-
// bodyType: BodyType.Literal,
|
|
798
|
-
// }
|
|
799
|
-
// }
|
|
800
771
|
|
|
801
772
|
interface RequestData {
|
|
802
|
-
body:
|
|
773
|
+
body: string | null
|
|
803
774
|
headers: Record<string, string>
|
|
804
775
|
}
|
|
805
776
|
|
|
@@ -835,7 +806,7 @@ function <span class="fstat-no" title="function not covered" >strMethod(</span>m
|
|
|
835
806
|
<span class="cstat-no" title="statement not covered" > return typeof method === 'string' ? method.toUpperCase() : 'GET'</span>
|
|
836
807
|
}
|
|
837
808
|
|
|
838
|
-
type Sanitizer = (data: RequestResponseData) => RequestResponseData
|
|
809
|
+
type Sanitizer = (data: RequestResponseData) => RequestResponseData
|
|
839
810
|
|
|
840
811
|
export interface Options {
|
|
841
812
|
sessionTokenHeader: string | boolean
|
|
@@ -845,6 +816,7 @@ export interface Options {
|
|
|
845
816
|
captureInIframes: boolean
|
|
846
817
|
sanitizer?: Sanitizer
|
|
847
818
|
axiosInstances?: Array<AxiosInstance>
|
|
819
|
+
useProxy?: boolean
|
|
848
820
|
}
|
|
849
821
|
|
|
850
822
|
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >export default function (a</span></span>pp: App, opts: Partial<Options> = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> {
|
|
@@ -856,6 +828,7 @@ export interface Options {
|
|
|
856
828
|
sessionTokenHeader: false,
|
|
857
829
|
captureInIframes: true,
|
|
858
830
|
axiosInstances: undefined,
|
|
831
|
+
useProxy: true,
|
|
859
832
|
},
|
|
860
833
|
opts,
|
|
861
834
|
)
|
|
@@ -879,13 +852,14 @@ export interface Options {
|
|
|
879
852
|
|
|
880
853
|
function <span class="fstat-no" title="function not covered" >sanitize(</span>reqResInfo: RequestResponseData) {
|
|
881
854
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (!options.capturePayload) {</span>
|
|
855
|
+
// @ts-ignore
|
|
882
856
|
<span class="cstat-no" title="statement not covered" > delete reqResInfo.request.body</span>
|
|
883
857
|
<span class="cstat-no" title="statement not covered" > delete reqResInfo.response.body</span>
|
|
884
858
|
}
|
|
885
859
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (options.sanitizer) {</span>
|
|
886
860
|
const resBody = <span class="cstat-no" title="statement not covered" >reqResInfo.response.body</span>
|
|
887
861
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof resBody === 'string') {</span>
|
|
888
|
-
// Parse response in order to have handy view in
|
|
862
|
+
// Parse response in order to have handy view in sanitization function
|
|
889
863
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
890
864
|
<span class="cstat-no" title="statement not covered" > reqResInfo.response.body = JSON.parse(resBody)</span>
|
|
891
865
|
} catch {}
|
|
@@ -908,6 +882,17 @@ export interface Options {
|
|
|
908
882
|
}
|
|
909
883
|
|
|
910
884
|
const patchWindow = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(c</span>ontext: typeof globalThis) => {</span>
|
|
885
|
+
/* ====== modern way ====== */
|
|
886
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (options.useProxy) {</span>
|
|
887
|
+
<span class="cstat-no" title="statement not covered" > return setProxy(</span>
|
|
888
|
+
context,
|
|
889
|
+
options.ignoreHeaders,
|
|
890
|
+
setSessionTokenHeader,
|
|
891
|
+
sanitize,
|
|
892
|
+
<span class="fstat-no" title="function not covered" > (m</span>essage) => <span class="cstat-no" title="statement not covered" >app.send(message),</span>
|
|
893
|
+
<span class="fstat-no" title="function not covered" > (u</span>rl) => <span class="cstat-no" title="statement not covered" >app.isServiceURL(url),</span>
|
|
894
|
+
)
|
|
895
|
+
}
|
|
911
896
|
/* ====== Fetch ====== */
|
|
912
897
|
const origFetch = <span class="cstat-no" title="statement not covered" >context.fetch.bind(context) as WindowFetch</span>
|
|
913
898
|
|
|
@@ -968,7 +953,8 @@ export interface Options {
|
|
|
968
953
|
status: r.status,
|
|
969
954
|
request: {
|
|
970
955
|
headers: reqHs,
|
|
971
|
-
|
|
956
|
+
// @ts-ignore
|
|
957
|
+
body: init.body || null,
|
|
972
958
|
},
|
|
973
959
|
response: {
|
|
974
960
|
headers: resHs,
|
|
@@ -979,6 +965,19 @@ export interface Options {
|
|
|
979
965
|
<span class="cstat-no" title="statement not covered" > return</span>
|
|
980
966
|
}
|
|
981
967
|
|
|
968
|
+
<span class="cstat-no" title="statement not covered" > console.log(</span>
|
|
969
|
+
'original',
|
|
970
|
+
NetworkRequest(
|
|
971
|
+
'fetch',
|
|
972
|
+
method,
|
|
973
|
+
String(reqResInfo.url),
|
|
974
|
+
stringify(reqResInfo.request),
|
|
975
|
+
stringify(reqResInfo.response),
|
|
976
|
+
r.status,
|
|
977
|
+
startTime + getTimeOrigin(),
|
|
978
|
+
duration,
|
|
979
|
+
),
|
|
980
|
+
)
|
|
982
981
|
<span class="cstat-no" title="statement not covered" > app.send(</span>
|
|
983
982
|
NetworkRequest(
|
|
984
983
|
'fetch',
|
|
@@ -1038,7 +1037,8 @@ export interface Options {
|
|
|
1038
1037
|
status: xhr.status,
|
|
1039
1038
|
request: {
|
|
1040
1039
|
headers: reqHs,
|
|
1041
|
-
|
|
1040
|
+
// @ts-ignore
|
|
1041
|
+
body: reqBody || null,
|
|
1042
1042
|
},
|
|
1043
1043
|
response: {
|
|
1044
1044
|
headers: headerMap,
|
|
@@ -1114,7 +1114,7 @@ export interface Options {
|
|
|
1114
1114
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1115
1115
|
Code coverage generated by
|
|
1116
1116
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1117
|
-
at 2023-06-
|
|
1117
|
+
at 2023-06-28T09:57:19.259Z
|
|
1118
1118
|
</div>
|
|
1119
1119
|
<script src="../../prettify.js"></script>
|
|
1120
1120
|
<script>
|
|
@@ -352,7 +352,7 @@ export interface Options {
|
|
|
352
352
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
353
353
|
Code coverage generated by
|
|
354
354
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
355
|
-
at 2023-06-
|
|
355
|
+
at 2023-06-28T09:57:19.259Z
|
|
356
356
|
</div>
|
|
357
357
|
<script src="../../prettify.js"></script>
|
|
358
358
|
<script>
|
|
@@ -349,7 +349,7 @@ function <span class="fstat-no" title="function not covered" >getDocumentScroll(
|
|
|
349
349
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
350
350
|
Code coverage generated by
|
|
351
351
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
352
|
-
at 2023-06-
|
|
352
|
+
at 2023-06-28T09:57:19.259Z
|
|
353
353
|
</div>
|
|
354
354
|
<script src="../../prettify.js"></script>
|
|
355
355
|
<script>
|
|
@@ -187,7 +187,7 @@ function <span class="fstat-no" title="function not covered" >selection(</span>a
|
|
|
187
187
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
188
188
|
Code coverage generated by
|
|
189
189
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
190
|
-
at 2023-06-
|
|
190
|
+
at 2023-06-28T09:57:19.259Z
|
|
191
191
|
</div>
|
|
192
192
|
<script src="../../prettify.js"></script>
|
|
193
193
|
<script>
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
110
110
|
Code coverage generated by
|
|
111
111
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
112
|
-
at 2023-06-
|
|
112
|
+
at 2023-06-28T09:57:19.259Z
|
|
113
113
|
</div>
|
|
114
114
|
<script src="../../prettify.js"></script>
|
|
115
115
|
<script>
|
|
@@ -826,7 +826,7 @@ export interface Options {
|
|
|
826
826
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
827
827
|
Code coverage generated by
|
|
828
828
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
829
|
-
at 2023-06-
|
|
829
|
+
at 2023-06-28T09:57:19.259Z
|
|
830
830
|
</div>
|
|
831
831
|
<script src="../../prettify.js"></script>
|
|
832
832
|
<script>
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
236
236
|
Code coverage generated by
|
|
237
237
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
238
|
-
at 2023-06-
|
|
238
|
+
at 2023-06-28T09:57:19.259Z
|
|
239
239
|
</div>
|
|
240
240
|
<script src="../../prettify.js"></script>
|
|
241
241
|
<script>
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">35.29% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>18/51</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">29.16% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>7/24</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">35.29% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>18/51</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -170,49 +170,49 @@
|
|
|
170
170
|
<a name='L105'></a><a href='#L105'>105</a>
|
|
171
171
|
<a name='L106'></a><a href='#L106'>106</a>
|
|
172
172
|
<a name='L107'></a><a href='#L107'>107</a>
|
|
173
|
-
<a name='L108'></a><a href='#L108'>108</a></td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
173
|
+
<a name='L108'></a><a href='#L108'>108</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
174
174
|
<span class="cline-any cline-neutral"> </span>
|
|
175
|
-
<span class="cline-any cline-
|
|
175
|
+
<span class="cline-any cline-yes">1x</span>
|
|
176
176
|
<span class="cline-any cline-neutral"> </span>
|
|
177
|
-
<span class="cline-any cline-
|
|
177
|
+
<span class="cline-any cline-yes">1x</span>
|
|
178
178
|
<span class="cline-any cline-neutral"> </span>
|
|
179
|
-
<span class="cline-any cline-
|
|
179
|
+
<span class="cline-any cline-yes">1x</span>
|
|
180
180
|
<span class="cline-any cline-neutral"> </span>
|
|
181
181
|
<span class="cline-any cline-neutral"> </span>
|
|
182
182
|
<span class="cline-any cline-neutral"> </span>
|
|
183
183
|
<span class="cline-any cline-neutral"> </span>
|
|
184
|
-
<span class="cline-any cline-
|
|
185
|
-
<span class="cline-any cline-
|
|
184
|
+
<span class="cline-any cline-yes">1x</span>
|
|
185
|
+
<span class="cline-any cline-yes">1x</span>
|
|
186
186
|
<span class="cline-any cline-no"> </span>
|
|
187
187
|
<span class="cline-any cline-neutral"> </span>
|
|
188
|
-
<span class="cline-any cline-
|
|
188
|
+
<span class="cline-any cline-yes">1x</span>
|
|
189
189
|
<span class="cline-any cline-no"> </span>
|
|
190
190
|
<span class="cline-any cline-neutral"> </span>
|
|
191
|
-
<span class="cline-any cline-
|
|
191
|
+
<span class="cline-any cline-yes">1x</span>
|
|
192
192
|
<span class="cline-any cline-neutral"> </span>
|
|
193
193
|
<span class="cline-any cline-no"> </span>
|
|
194
194
|
<span class="cline-any cline-no"> </span>
|
|
195
195
|
<span class="cline-any cline-neutral"> </span>
|
|
196
|
-
<span class="cline-any cline-
|
|
196
|
+
<span class="cline-any cline-yes">1x</span>
|
|
197
197
|
<span class="cline-any cline-neutral"> </span>
|
|
198
198
|
<span class="cline-any cline-no"> </span>
|
|
199
199
|
<span class="cline-any cline-no"> </span>
|
|
200
200
|
<span class="cline-any cline-neutral"> </span>
|
|
201
|
-
<span class="cline-any cline-
|
|
201
|
+
<span class="cline-any cline-yes">1x</span>
|
|
202
202
|
<span class="cline-any cline-no"> </span>
|
|
203
203
|
<span class="cline-any cline-neutral"> </span>
|
|
204
204
|
<span class="cline-any cline-neutral"> </span>
|
|
205
205
|
<span class="cline-any cline-neutral"> </span>
|
|
206
|
-
<span class="cline-any cline-
|
|
206
|
+
<span class="cline-any cline-yes">1x</span>
|
|
207
207
|
<span class="cline-any cline-no"> </span>
|
|
208
208
|
<span class="cline-any cline-neutral"> </span>
|
|
209
209
|
<span class="cline-any cline-neutral"> </span>
|
|
210
210
|
<span class="cline-any cline-neutral"> </span>
|
|
211
211
|
<span class="cline-any cline-neutral"> </span>
|
|
212
|
-
<span class="cline-any cline-
|
|
212
|
+
<span class="cline-any cline-yes">1x</span>
|
|
213
213
|
<span class="cline-any cline-neutral"> </span>
|
|
214
|
-
<span class="cline-any cline-
|
|
215
|
-
<span class="cline-any cline-
|
|
214
|
+
<span class="cline-any cline-yes">1x</span>
|
|
215
|
+
<span class="cline-any cline-yes">1x</span>
|
|
216
216
|
<span class="cline-any cline-no"> </span>
|
|
217
217
|
<span class="cline-any cline-no"> </span>
|
|
218
218
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
<span class="cline-any cline-no"> </span>
|
|
225
225
|
<span class="cline-any cline-neutral"> </span>
|
|
226
226
|
<span class="cline-any cline-neutral"> </span>
|
|
227
|
-
<span class="cline-any cline-
|
|
227
|
+
<span class="cline-any cline-yes">1x</span>
|
|
228
228
|
<span class="cline-any cline-no"> </span>
|
|
229
229
|
<span class="cline-any cline-no"> </span>
|
|
230
230
|
<span class="cline-any cline-no"> </span>
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
<span class="cline-any cline-no"> </span>
|
|
237
237
|
<span class="cline-any cline-neutral"> </span>
|
|
238
238
|
<span class="cline-any cline-neutral"> </span>
|
|
239
|
-
<span class="cline-any cline-
|
|
239
|
+
<span class="cline-any cline-yes">1x</span>
|
|
240
240
|
<span class="cline-any cline-no"> </span>
|
|
241
241
|
<span class="cline-any cline-no"> </span>
|
|
242
242
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
<span class="cline-any cline-neutral"> </span>
|
|
258
258
|
<span class="cline-any cline-neutral"> </span>
|
|
259
259
|
<span class="cline-any cline-neutral"> </span>
|
|
260
|
-
<span class="cline-any cline-
|
|
260
|
+
<span class="cline-any cline-yes">1x</span>
|
|
261
261
|
<span class="cline-any cline-no"> </span>
|
|
262
262
|
<span class="cline-any cline-no"> </span>
|
|
263
263
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
<span class="cline-any cline-no"> </span>
|
|
270
270
|
<span class="cline-any cline-neutral"> </span>
|
|
271
271
|
<span class="cline-any cline-neutral"> </span>
|
|
272
|
-
<span class="cline-any cline-
|
|
272
|
+
<span class="cline-any cline-yes">1x</span>
|
|
273
273
|
<span class="cline-any cline-no"> </span>
|
|
274
274
|
<span class="cline-any cline-neutral"> </span>
|
|
275
275
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -277,49 +277,49 @@
|
|
|
277
277
|
<span class="cline-any cline-no"> </span>
|
|
278
278
|
<span class="cline-any cline-no"> </span>
|
|
279
279
|
<span class="cline-any cline-neutral"> </span>
|
|
280
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const DEPRECATED_ATTRS =
|
|
280
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const DEPRECATED_ATTRS = { htmlmasked: 'hidden', masked: 'obscured' }
|
|
281
281
|
|
|
282
|
-
export const
|
|
282
|
+
export const IN_BROWSER = !(typeof window === 'undefined')
|
|
283
283
|
|
|
284
|
-
export const
|
|
284
|
+
export const IS_FIREFOX = IN_BROWSER && navigator.userAgent.match(/firefox|fxios/i)
|
|
285
285
|
|
|
286
|
-
export const
|
|
286
|
+
export const MAX_STR_LEN = 1e5
|
|
287
287
|
|
|
288
288
|
// Buggy to use `performance.timeOrigin || performance.timing.navigationStart`
|
|
289
289
|
// https://github.com/mdn/content/issues/4713
|
|
290
290
|
// Maybe move to timer/ticker
|
|
291
|
-
let timeOrigin: number = <span class="
|
|
292
|
-
|
|
291
|
+
let timeOrigin: number = IN_BROWSER ? Date.now() - performance.now() : <span class="branch-1 cbranch-no" title="branch not covered" >0</span>
|
|
292
|
+
export function <span class="fstat-no" title="function not covered" >adjustTimeOrigin(</span>) {
|
|
293
293
|
<span class="cstat-no" title="statement not covered" > timeOrigin = Date.now() - performance.now()</span>
|
|
294
294
|
}
|
|
295
|
-
|
|
295
|
+
export function <span class="fstat-no" title="function not covered" >getTimeOrigin(</span>) {
|
|
296
296
|
<span class="cstat-no" title="statement not covered" > return timeOrigin</span>
|
|
297
297
|
}
|
|
298
|
-
export const
|
|
298
|
+
export const now: () => number =
|
|
299
299
|
IN_BROWSER && !!performance.now
|
|
300
300
|
? <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >Math.round(performance.now() + timeOrigin)</span>
|
|
301
|
-
: <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >Date.now()</span>
|
|
301
|
+
: <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >Date.now()</span></span>
|
|
302
302
|
|
|
303
|
-
export const
|
|
303
|
+
export const stars: (str: string) => string =
|
|
304
304
|
'repeat' in String.prototype
|
|
305
305
|
? <span class="fstat-no" title="function not covered" >(s</span>tr: string): string => <span class="cstat-no" title="statement not covered" >'*'.repeat(str.length)</span>
|
|
306
|
-
: <span class="fstat-no" title="function not covered" >(s</span>tr: string): string => <span class="cstat-no" title="statement not covered" >str.replace(/./g, '*')</span>
|
|
306
|
+
: <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >(s</span>tr: string): string => <span class="cstat-no" title="statement not covered" >str.replace(/./g, '*')</span></span>
|
|
307
307
|
|
|
308
|
-
|
|
308
|
+
export function <span class="fstat-no" title="function not covered" >normSpaces(</span>str: string): string {
|
|
309
309
|
<span class="cstat-no" title="statement not covered" > return str.trim().replace(/\s+/g, ' ')</span>
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// isAbsoluteUrl regexp: /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)
|
|
313
|
-
|
|
313
|
+
export function <span class="fstat-no" title="function not covered" >isURL(</span>s: string): boolean {
|
|
314
314
|
<span class="cstat-no" title="statement not covered" > return s.startsWith('https://') || s.startsWith('http://')</span>
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
// TODO: JOIN IT WITH LOGGER somehow (use logging decorators?); Don't forget about index.js loggin when there is no logger instance.
|
|
318
318
|
|
|
319
|
-
export const
|
|
319
|
+
export const DOCS_HOST = 'https://docs.openreplay.com'
|
|
320
320
|
|
|
321
|
-
const warnedFeatures: { [key: string]: boolean } =
|
|
322
|
-
|
|
321
|
+
const warnedFeatures: { [key: string]: boolean } = {}
|
|
322
|
+
export function <span class="fstat-no" title="function not covered" >deprecationWarn(</span>nameOfFeature: string, useInstead: string, docsPath = <span class="branch-0 cbranch-no" title="branch not covered" >'/')</span>: void {
|
|
323
323
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (warnedFeatures[nameOfFeature]) {</span>
|
|
324
324
|
<span class="cstat-no" title="statement not covered" > return</span>
|
|
325
325
|
}
|
|
@@ -331,7 +331,7 @@ const warnedFeatures: { [key: string]: boolean } = <span class="cstat-no" title=
|
|
|
331
331
|
<span class="cstat-no" title="statement not covered" > warnedFeatures[nameOfFeature] = true</span>
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
|
|
334
|
+
export function <span class="fstat-no" title="function not covered" >getLabelAttribute(</span>e: Element): string | null {
|
|
335
335
|
let value = <span class="cstat-no" title="statement not covered" >e.getAttribute('data-openreplay-label')</span>
|
|
336
336
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (value !== null) {</span>
|
|
337
337
|
<span class="cstat-no" title="statement not covered" > return value</span>
|
|
@@ -343,7 +343,7 @@ const warnedFeatures: { [key: string]: boolean } = <span class="cstat-no" title=
|
|
|
343
343
|
<span class="cstat-no" title="statement not covered" > return value</span>
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
export function <span class="fstat-no" title="function not covered" >hasOpenreplayAttribute(</span>e: Element, attr: string): boolean {
|
|
347
347
|
const newName = <span class="cstat-no" title="statement not covered" >`data-openreplay-${attr}`</span>
|
|
348
348
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (e.hasAttribute(newName)) {</span>
|
|
349
349
|
// @ts-ignore
|
|
@@ -364,7 +364,7 @@ const warnedFeatures: { [key: string]: boolean } = <span class="cstat-no" title=
|
|
|
364
364
|
/**
|
|
365
365
|
* checks if iframe is accessible
|
|
366
366
|
**/
|
|
367
|
-
|
|
367
|
+
export function <span class="fstat-no" title="function not covered" >canAccessIframe(</span>iframe: HTMLIFrameElement) {
|
|
368
368
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
369
369
|
<span class="cstat-no" title="statement not covered" > return Boolean(iframe.contentDocument)</span>
|
|
370
370
|
} catch (e) {
|
|
@@ -376,7 +376,7 @@ function <span class="fstat-no" title="function not covered" >dec2hex(</span>dec
|
|
|
376
376
|
<span class="cstat-no" title="statement not covered" > return dec.toString(16).padStart(2, '0')</span>
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
|
|
379
|
+
export function <span class="fstat-no" title="function not covered" >generateRandomId(</span>len?: number) {
|
|
380
380
|
const arr: Uint8Array = <span class="cstat-no" title="statement not covered" >new Uint8Array((len || 40) / 2)</span>
|
|
381
381
|
// msCrypto = IE11
|
|
382
382
|
// @ts-ignore
|
|
@@ -391,7 +391,7 @@ function <span class="fstat-no" title="function not covered" >dec2hex(</span>dec
|
|
|
391
391
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
392
392
|
Code coverage generated by
|
|
393
393
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
394
|
-
at 2023-06-
|
|
394
|
+
at 2023-06-28T09:57:19.259Z
|
|
395
395
|
</div>
|
|
396
396
|
<script src="../prettify.js"></script>
|
|
397
397
|
<script>
|
|
@@ -466,7 +466,7 @@ const MAX_M_SIZE = <span class="cstat-no" title="statement not covered" >(1 <
|
|
|
466
466
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
467
467
|
Code coverage generated by
|
|
468
468
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
469
|
-
at 2023-06-
|
|
469
|
+
at 2023-06-28T09:57:19.259Z
|
|
470
470
|
</div>
|
|
471
471
|
<script src="../prettify.js"></script>
|
|
472
472
|
<script>
|
|
@@ -934,7 +934,7 @@ import Message from '../common/messages.gen.js'
|
|
|
934
934
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
935
935
|
Code coverage generated by
|
|
936
936
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
937
|
-
at 2023-06-
|
|
937
|
+
at 2023-06-28T09:57:19.259Z
|
|
938
938
|
</div>
|
|
939
939
|
<script src="../prettify.js"></script>
|
|
940
940
|
<script>
|