@openreplay/tracker 7.0.3 → 8.0.0
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/CHANGELOG.md +4 -0
- package/cjs/app/index.d.ts +10 -0
- package/cjs/app/index.js +56 -5
- package/cjs/app/messages.gen.d.ts +2 -0
- package/cjs/app/messages.gen.js +15 -1
- package/cjs/app/observer/observer.js +2 -2
- package/cjs/app/sanitizer.d.ts +1 -0
- package/cjs/app/sanitizer.js +6 -4
- package/cjs/app/session.d.ts +4 -0
- package/cjs/app/session.js +18 -0
- package/cjs/common/interaction.d.ts +1 -0
- package/cjs/common/messages.gen.d.ts +12 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +9 -1
- package/cjs/modules/attributeSender.d.ts +14 -0
- package/cjs/modules/attributeSender.js +44 -0
- package/cjs/modules/img.js +4 -4
- package/cjs/modules/tabs.d.ts +2 -0
- package/cjs/modules/tabs.js +13 -0
- package/cjs/utils.d.ts +1 -1
- package/cjs/utils.js +13 -11
- package/coverage/clover.xml +683 -620
- package/coverage/coverage-final.json +13 -12
- package/coverage/lcov-report/index.html +47 -47
- package/coverage/lcov-report/main/app/guards.ts.html +42 -42
- package/coverage/lcov-report/main/app/index.html +34 -34
- package/coverage/lcov-report/main/app/index.ts.html +62 -8
- package/coverage/lcov-report/main/app/logger.ts.html +1 -1
- package/coverage/lcov-report/main/app/messages.gen.ts.html +1 -1
- 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 +98 -98
- package/coverage/lcov-report/main/app/session.ts.html +1 -1
- package/coverage/lcov-report/main/app/ticker.ts.html +1 -1
- package/coverage/lcov-report/main/index.html +24 -24
- package/coverage/lcov-report/main/index.ts.html +126 -6
- package/coverage/lcov-report/main/modules/attributeSender.ts.html +217 -0
- 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 +1 -1
- 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/{app/nodes.ts.html → modules/featureFlags.ts.html} +124 -127
- 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 +6 -6
- package/coverage/lcov-report/main/modules/index.html +38 -8
- 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 +1 -1
- 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 +112 -112
- package/coverage/lcov-report/webworker/BatchWriter.ts.html +125 -176
- package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +88 -88
- package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +110 -110
- package/coverage/lcov-report/webworker/QueueSender.ts.html +140 -110
- package/coverage/lcov-report/webworker/index.html +56 -71
- package/coverage/lcov-report/webworker/index.ts.html +34 -10
- package/coverage/lcov.info +1232 -1092
- package/lib/app/index.d.ts +10 -0
- package/lib/app/index.js +57 -6
- package/lib/app/messages.gen.d.ts +2 -0
- package/lib/app/messages.gen.js +12 -0
- package/lib/app/observer/observer.js +3 -3
- package/lib/app/sanitizer.d.ts +1 -0
- package/lib/app/sanitizer.js +4 -3
- package/lib/app/session.d.ts +4 -0
- package/lib/app/session.js +18 -0
- package/lib/common/interaction.d.ts +1 -0
- package/lib/common/messages.gen.d.ts +12 -2
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +9 -1
- package/lib/modules/attributeSender.d.ts +14 -0
- package/lib/modules/attributeSender.js +39 -0
- package/lib/modules/img.js +5 -5
- package/lib/modules/tabs.d.ts +2 -0
- package/lib/modules/tabs.js +10 -0
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +11 -9
- package/package.json +5 -2
- package/coverage/lcov-report/main/app/observer/observer.ts.html +0 -1282
- package/coverage/lcov-report/main/vendors/finder/finder.ts.html +0 -1381
- package/coverage/lcov-report/main/vendors/finder/index.html +0 -116
- package/coverage/lcov-report/webworker/StringDictionary.ts.html +0 -124
|
@@ -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-
|
|
829
|
+
at 2023-06-15T15:49:15.198Z
|
|
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-
|
|
238
|
+
at 2023-06-15T15:49:15.198Z
|
|
239
239
|
</div>
|
|
240
240
|
<script src="../../prettify.js"></script>
|
|
241
241
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>0/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">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/24</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/14</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>0/51</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -170,219 +170,219 @@
|
|
|
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-no"> </span>
|
|
174
174
|
<span class="cline-any cline-neutral"> </span>
|
|
175
|
-
<span class="cline-any cline-
|
|
175
|
+
<span class="cline-any cline-no"> </span>
|
|
176
176
|
<span class="cline-any cline-neutral"> </span>
|
|
177
|
-
<span class="cline-any cline-
|
|
177
|
+
<span class="cline-any cline-no"> </span>
|
|
178
178
|
<span class="cline-any cline-neutral"> </span>
|
|
179
|
-
<span class="cline-any cline-
|
|
179
|
+
<span class="cline-any cline-no"> </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-
|
|
186
|
-
<span class="cline-any cline-
|
|
184
|
+
<span class="cline-any cline-no"> </span>
|
|
185
|
+
<span class="cline-any cline-no"> </span>
|
|
186
|
+
<span class="cline-any cline-no"> </span>
|
|
187
187
|
<span class="cline-any cline-neutral"> </span>
|
|
188
|
-
<span class="cline-any cline-
|
|
189
|
-
<span class="cline-any cline-
|
|
188
|
+
<span class="cline-any cline-no"> </span>
|
|
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-no"> </span>
|
|
192
192
|
<span class="cline-any cline-neutral"> </span>
|
|
193
|
-
<span class="cline-any cline-
|
|
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-no"> </span>
|
|
197
197
|
<span class="cline-any cline-neutral"> </span>
|
|
198
|
-
<span class="cline-any cline-
|
|
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-
|
|
202
|
-
<span class="cline-any cline-
|
|
201
|
+
<span class="cline-any cline-no"> </span>
|
|
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-
|
|
207
|
-
<span class="cline-any cline-
|
|
206
|
+
<span class="cline-any cline-no"> </span>
|
|
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-no"> </span>
|
|
213
213
|
<span class="cline-any cline-neutral"> </span>
|
|
214
|
-
<span class="cline-any cline-
|
|
215
|
-
<span class="cline-any cline-
|
|
216
|
-
<span class="cline-any cline-
|
|
217
|
-
<span class="cline-any cline-
|
|
214
|
+
<span class="cline-any cline-no"> </span>
|
|
215
|
+
<span class="cline-any cline-no"> </span>
|
|
216
|
+
<span class="cline-any cline-no"> </span>
|
|
217
|
+
<span class="cline-any cline-no"> </span>
|
|
218
218
|
<span class="cline-any cline-neutral"> </span>
|
|
219
|
-
<span class="cline-any cline-
|
|
219
|
+
<span class="cline-any cline-no"> </span>
|
|
220
220
|
<span class="cline-any cline-neutral"> </span>
|
|
221
221
|
<span class="cline-any cline-neutral"> </span>
|
|
222
222
|
<span class="cline-any cline-neutral"> </span>
|
|
223
223
|
<span class="cline-any cline-neutral"> </span>
|
|
224
|
-
<span class="cline-any cline-
|
|
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-
|
|
228
|
-
<span class="cline-any cline-
|
|
229
|
-
<span class="cline-any cline-
|
|
230
|
-
<span class="cline-any cline-
|
|
227
|
+
<span class="cline-any cline-no"> </span>
|
|
228
|
+
<span class="cline-any cline-no"> </span>
|
|
229
|
+
<span class="cline-any cline-no"> </span>
|
|
230
|
+
<span class="cline-any cline-no"> </span>
|
|
231
231
|
<span class="cline-any cline-neutral"> </span>
|
|
232
|
-
<span class="cline-any cline-
|
|
233
|
-
<span class="cline-any cline-
|
|
234
|
-
<span class="cline-any cline-
|
|
232
|
+
<span class="cline-any cline-no"> </span>
|
|
233
|
+
<span class="cline-any cline-no"> </span>
|
|
234
|
+
<span class="cline-any cline-no"> </span>
|
|
235
235
|
<span class="cline-any cline-neutral"> </span>
|
|
236
|
-
<span class="cline-any cline-
|
|
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-
|
|
240
|
-
<span class="cline-any cline-
|
|
241
|
-
<span class="cline-any cline-
|
|
239
|
+
<span class="cline-any cline-no"> </span>
|
|
240
|
+
<span class="cline-any cline-no"> </span>
|
|
241
|
+
<span class="cline-any cline-no"> </span>
|
|
242
242
|
<span class="cline-any cline-neutral"> </span>
|
|
243
|
-
<span class="cline-any cline-
|
|
244
|
-
<span class="cline-any cline-
|
|
243
|
+
<span class="cline-any cline-no"> </span>
|
|
244
|
+
<span class="cline-any cline-no"> </span>
|
|
245
245
|
<span class="cline-any cline-neutral"> </span>
|
|
246
246
|
<span class="cline-any cline-neutral"> </span>
|
|
247
247
|
<span class="cline-any cline-neutral"> </span>
|
|
248
248
|
<span class="cline-any cline-neutral"> </span>
|
|
249
249
|
<span class="cline-any cline-neutral"> </span>
|
|
250
250
|
<span class="cline-any cline-neutral"> </span>
|
|
251
|
-
<span class="cline-any cline-
|
|
251
|
+
<span class="cline-any cline-no"> </span>
|
|
252
252
|
<span class="cline-any cline-neutral"> </span>
|
|
253
253
|
<span class="cline-any cline-neutral"> </span>
|
|
254
|
-
<span class="cline-any cline-
|
|
254
|
+
<span class="cline-any cline-no"> </span>
|
|
255
255
|
<span class="cline-any cline-neutral"> </span>
|
|
256
256
|
<span class="cline-any cline-neutral"> </span>
|
|
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-
|
|
261
|
-
<span class="cline-any cline-
|
|
262
|
-
<span class="cline-any cline-
|
|
260
|
+
<span class="cline-any cline-no"> </span>
|
|
261
|
+
<span class="cline-any cline-no"> </span>
|
|
262
|
+
<span class="cline-any cline-no"> </span>
|
|
263
263
|
<span class="cline-any cline-neutral"> </span>
|
|
264
|
-
<span class="cline-any cline-
|
|
264
|
+
<span class="cline-any cline-no"> </span>
|
|
265
265
|
<span class="cline-any cline-neutral"> </span>
|
|
266
266
|
<span class="cline-any cline-neutral"> </span>
|
|
267
267
|
<span class="cline-any cline-neutral"> </span>
|
|
268
268
|
<span class="cline-any cline-neutral"> </span>
|
|
269
|
-
<span class="cline-any cline-
|
|
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-
|
|
273
|
-
<span class="cline-any cline-
|
|
272
|
+
<span class="cline-any cline-no"> </span>
|
|
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>
|
|
276
|
-
<span class="cline-any cline-
|
|
277
|
-
<span class="cline-any cline-
|
|
278
|
-
<span class="cline-any cline-
|
|
276
|
+
<span class="cline-any cline-no"> </span>
|
|
277
|
+
<span class="cline-any cline-no"> </span>
|
|
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 = { htmlmasked: 'hidden', masked: 'obscured' }
|
|
280
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const DEPRECATED_ATTRS = <span class="cstat-no" title="statement not covered" >{ htmlmasked: 'hidden', masked: 'obscured' }</span>
|
|
281
281
|
|
|
282
|
-
export const IN_BROWSER = !(typeof window === 'undefined')
|
|
282
|
+
export const <span class="cstat-no" title="statement not covered" >IN_BROWSER = !(typeof window === 'undefined')</span>
|
|
283
283
|
|
|
284
|
-
export const IS_FIREFOX = IN_BROWSER && navigator.userAgent.match(/firefox|fxios/i)
|
|
284
|
+
export const <span class="cstat-no" title="statement not covered" >IS_FIREFOX = IN_BROWSER && navigator.userAgent.match(/firefox|fxios/i)</span>
|
|
285
285
|
|
|
286
|
-
export const MAX_STR_LEN = 1e5
|
|
286
|
+
export const <span class="cstat-no" title="statement not covered" >MAX_STR_LEN = 1e5</span>
|
|
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 = IN_BROWSER ? Date.now() - performance.now() :
|
|
292
|
-
export function
|
|
293
|
-
timeOrigin = Date.now() - performance.now()
|
|
291
|
+
let timeOrigin: number = <span class="cstat-no" title="statement not covered" >IN_BROWSER ? Date.now() - performance.now() : 0</span>
|
|
292
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >a</span>djustTimeOrigin(</span>) {
|
|
293
|
+
<span class="cstat-no" title="statement not covered" > timeOrigin = Date.now() - performance.now()</span>
|
|
294
294
|
}
|
|
295
|
-
export function
|
|
296
|
-
return timeOrigin
|
|
295
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >g</span>etTimeOrigin(</span>) {
|
|
296
|
+
<span class="cstat-no" title="statement not covered" > return timeOrigin</span>
|
|
297
297
|
}
|
|
298
|
-
export const now: () => number
|
|
298
|
+
export const <span class="cstat-no" title="statement not covered" >now: () => number =</span>
|
|
299
299
|
IN_BROWSER && !!performance.now
|
|
300
|
-
? ()
|
|
301
|
-
: <span class="fstat-no" title="function not covered"
|
|
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>
|
|
302
302
|
|
|
303
|
-
export const stars: (str: string) => string
|
|
303
|
+
export const <span class="cstat-no" title="statement not covered" >stars: (str: string) => string =</span>
|
|
304
304
|
'repeat' in String.prototype
|
|
305
|
-
? (
|
|
306
|
-
: <span class="fstat-no" title="function not covered"
|
|
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>
|
|
307
307
|
|
|
308
|
-
export function
|
|
309
|
-
return str.trim().replace(/\s+/g, ' ')
|
|
308
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >n</span>ormSpaces(</span>str: string): string {
|
|
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
|
-
export function
|
|
314
|
-
return s.startsWith('https://') || s.startsWith('http://')
|
|
313
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >i</span>sURL(</span>s: string): boolean {
|
|
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 DOCS_HOST = 'https://docs.openreplay.com'
|
|
319
|
+
export const <span class="cstat-no" title="statement not covered" >DOCS_HOST = 'https://docs.openreplay.com'</span>
|
|
320
320
|
|
|
321
|
-
const warnedFeatures: { [key: string]: boolean } = {}
|
|
322
|
-
export function
|
|
323
|
-
if (warnedFeatures[nameOfFeature]) {
|
|
324
|
-
return
|
|
321
|
+
const warnedFeatures: { [key: string]: boolean } = <span class="cstat-no" title="statement not covered" >{}</span>
|
|
322
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >d</span>eprecationWarn(</span>nameOfFeature: string, useInstead: string, docsPath = <span class="branch-0 cbranch-no" title="branch not covered" >'/')</span>: void {
|
|
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
|
+
<span class="cstat-no" title="statement not covered" > return</span>
|
|
325
325
|
}
|
|
326
|
-
console.warn(
|
|
326
|
+
<span class="cstat-no" title="statement not covered" > console.warn(</span>
|
|
327
327
|
`OpenReplay: ${nameOfFeature} is deprecated. ${
|
|
328
|
-
useInstead ? `Please, use ${useInstead} instead.` :
|
|
328
|
+
useInstead ? `Please, use ${useInstead} instead.` : ''
|
|
329
329
|
} Visit ${DOCS_HOST}${docsPath} for more information.`,
|
|
330
330
|
)
|
|
331
|
-
warnedFeatures[nameOfFeature] = true
|
|
331
|
+
<span class="cstat-no" title="statement not covered" > warnedFeatures[nameOfFeature] = true</span>
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
export function
|
|
335
|
-
let value = e.getAttribute('data-openreplay-label')
|
|
336
|
-
if (value !== null) {
|
|
337
|
-
return value
|
|
334
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >g</span>etLabelAttribute(</span>e: Element): string | null {
|
|
335
|
+
let value = <span class="cstat-no" title="statement not covered" >e.getAttribute('data-openreplay-label')</span>
|
|
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
|
+
<span class="cstat-no" title="statement not covered" > return value</span>
|
|
338
338
|
}
|
|
339
|
-
value = e.getAttribute('data-asayer-label')
|
|
340
|
-
if (value !== null) {
|
|
341
|
-
deprecationWarn('"data-asayer-label" attribute', '"data-openreplay-label" attribute', '/')
|
|
339
|
+
<span class="cstat-no" title="statement not covered" > value = e.getAttribute('data-asayer-label')</span>
|
|
340
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (value !== null) {</span>
|
|
341
|
+
<span class="cstat-no" title="statement not covered" > deprecationWarn('"data-asayer-label" attribute', '"data-openreplay-label" attribute', '/')</span>
|
|
342
342
|
}
|
|
343
|
-
return value
|
|
343
|
+
<span class="cstat-no" title="statement not covered" > return value</span>
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
export function
|
|
347
|
-
const newName =
|
|
348
|
-
if (e.hasAttribute(newName)) {
|
|
346
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >h</span>asOpenreplayAttribute(</span>e: Element, attr: string): boolean {
|
|
347
|
+
const newName = <span class="cstat-no" title="statement not covered" >`data-openreplay-${attr}`</span>
|
|
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
|
|
350
|
-
if (DEPRECATED_ATTRS[attr]) {
|
|
351
|
-
deprecationWarn(
|
|
350
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (DEPRECATED_ATTRS[attr]) {</span>
|
|
351
|
+
<span class="cstat-no" title="statement not covered" > deprecationWarn(</span>
|
|
352
352
|
`"${newName}" attribute`,
|
|
353
353
|
// @ts-ignore
|
|
354
354
|
`"${DEPRECATED_ATTRS[attr] as string}" attribute`,
|
|
355
355
|
'/installation/sanitize-data',
|
|
356
356
|
)
|
|
357
357
|
}
|
|
358
|
-
return true
|
|
358
|
+
<span class="cstat-no" title="statement not covered" > return true</span>
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
return false
|
|
361
|
+
<span class="cstat-no" title="statement not covered" > return false</span>
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
/**
|
|
365
365
|
* checks if iframe is accessible
|
|
366
366
|
**/
|
|
367
|
-
export function
|
|
368
|
-
try {
|
|
369
|
-
return Boolean(iframe.contentDocument)
|
|
367
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >c</span>anAccessIframe(</span>iframe: HTMLIFrameElement) {
|
|
368
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
369
|
+
<span class="cstat-no" title="statement not covered" > return Boolean(iframe.contentDocument)</span>
|
|
370
370
|
} catch (e) {
|
|
371
|
-
return false
|
|
371
|
+
<span class="cstat-no" title="statement not covered" > return false</span>
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
function dec2hex(dec: number) {
|
|
376
|
-
return dec.toString(16).padStart(2, '0')
|
|
375
|
+
function <span class="fstat-no" title="function not covered" >dec2hex(</span>dec: number) {
|
|
376
|
+
<span class="cstat-no" title="statement not covered" > return dec.toString(16).padStart(2, '0')</span>
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
export function
|
|
380
|
-
const arr: Uint8Array = new Uint8Array((len || 40) / 2)
|
|
379
|
+
<span class="cstat-no" title="statement not covered" >export function <span class="fstat-no" title="function not covered" >g</span>enerateRandomId(</span>len?: number) {
|
|
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
|
|
383
|
-
const safeCrypto =
|
|
384
|
-
safeCrypto.getRandomValues(arr)
|
|
385
|
-
return Array.from(arr, dec2hex).join('')
|
|
383
|
+
const safeCrypto = <span class="cstat-no" title="statement not covered" >window.crypto || window.msCrypto</span>
|
|
384
|
+
<span class="cstat-no" title="statement not covered" > safeCrypto.getRandomValues(arr)</span>
|
|
385
|
+
<span class="cstat-no" title="statement not covered" > return Array.from(arr, dec2hex).join('')</span>
|
|
386
386
|
}
|
|
387
387
|
</pre></td></tr></table></pre>
|
|
388
388
|
|
|
@@ -391,7 +391,7 @@ export function generateRandomId(len?: number) {
|
|
|
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-
|
|
394
|
+
at 2023-06-15T15:49:15.198Z
|
|
395
395
|
</div>
|
|
396
396
|
<script src="../prettify.js"></script>
|
|
397
397
|
<script>
|