@glimt/record 0.0.1 → 0.0.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/README.md +0 -201
- package/dist/record.cjs +48 -181
- package/dist/record.cjs.map +1 -1
- package/dist/record.js +48 -181
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +48 -181
- package/dist/record.umd.cjs.map +3 -3
- package/dist/record.umd.min.cjs +24 -24
- package/dist/record.umd.min.cjs.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
# @rrweb/record
|
|
2
|
-
|
|
3
|
-
This package contains all the record related code in rrweb.
|
|
4
|
-
See the [guide](../../guide.md) for more info on rrweb.
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm install @rrweb/record
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
import { record } from '@rrweb/record';
|
|
16
|
-
|
|
17
|
-
record({
|
|
18
|
-
emit(event) {
|
|
19
|
-
// send event to server
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Notes
|
|
25
|
-
|
|
26
|
-
Currently this package is really just a wrapper around the `record` function in the main `rrweb` package.
|
|
27
|
-
All `record` related code will get moved here in the future.
|
|
28
|
-
|
|
29
|
-
## Sponsors
|
|
30
|
-
|
|
31
|
-
[Become a sponsor](https://opencollective.com/rrweb#sponsor) and get your logo on our README on Github with a link to your site.
|
|
32
|
-
|
|
33
|
-
### Gold Sponsors 🥇
|
|
34
|
-
|
|
35
|
-
<div dir="auto">
|
|
36
|
-
|
|
37
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/0/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
38
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/1/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
39
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/2/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
40
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/3/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
41
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/4/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
42
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/5/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
43
|
-
<a href="https://opencollective.com/rrweb/tiers/gold-sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/6/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
|
|
44
|
-
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
### Silver Sponsors 🥈
|
|
48
|
-
|
|
49
|
-
<div dir="auto">
|
|
50
|
-
|
|
51
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/0/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
52
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/1/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
53
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/2/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
54
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/3/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
55
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/4/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
56
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/5/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
57
|
-
<a href="https://opencollective.com/rrweb/tiers/silver-sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/6/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
|
|
58
|
-
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
### Bronze Sponsors 🥉
|
|
62
|
-
|
|
63
|
-
<div dir="auto">
|
|
64
|
-
|
|
65
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/0/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
66
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/1/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
67
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/2/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
68
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/3/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
69
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/4/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
70
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/5/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
71
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/6/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
72
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/7/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
73
|
-
<a href="https://opencollective.com/rrweb/tiers/sponsors/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/8/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
|
|
74
|
-
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
### Backers
|
|
78
|
-
|
|
79
|
-
<a href="https://opencollective.com/rrweb#sponsor" rel="nofollow"><img src="https://opencollective.com/rrweb/tiers/backers.svg?avatarHeight=36"></a>
|
|
80
|
-
|
|
81
|
-
## Core Team Members
|
|
82
|
-
|
|
83
|
-
<table>
|
|
84
|
-
<tr>
|
|
85
|
-
<td align="center">
|
|
86
|
-
<a href="https://github.com/Yuyz0112">
|
|
87
|
-
<img
|
|
88
|
-
src="https://avatars.githubusercontent.com/u/13651389?s=100"
|
|
89
|
-
width="100px;"
|
|
90
|
-
alt=""
|
|
91
|
-
/>
|
|
92
|
-
<br /><sub><b>Yuyz0112</b></sub>
|
|
93
|
-
<br /><br />
|
|
94
|
-
</a>
|
|
95
|
-
</td>
|
|
96
|
-
<td align="center">
|
|
97
|
-
<a href="https://github.com/YunFeng0817">
|
|
98
|
-
<img
|
|
99
|
-
src="https://avatars.githubusercontent.com/u/27533910?s=100"
|
|
100
|
-
width="100px;"
|
|
101
|
-
alt=""
|
|
102
|
-
/>
|
|
103
|
-
<br /><sub><b>Yun Feng</b></sub>
|
|
104
|
-
<br /><br />
|
|
105
|
-
</a>
|
|
106
|
-
</td>
|
|
107
|
-
<td align="center">
|
|
108
|
-
<a href="https://github.com/eoghanmurray">
|
|
109
|
-
<img
|
|
110
|
-
src="https://avatars.githubusercontent.com/u/156780?s=100"
|
|
111
|
-
width="100px;"
|
|
112
|
-
alt=""
|
|
113
|
-
/>
|
|
114
|
-
<br /><sub><b>eoghanmurray</b></sub>
|
|
115
|
-
<br /><br />
|
|
116
|
-
</a>
|
|
117
|
-
</td>
|
|
118
|
-
<td align="center">
|
|
119
|
-
<a href="https://github.com/Juice10">
|
|
120
|
-
<img
|
|
121
|
-
src="https://avatars.githubusercontent.com/u/4106?s=100"
|
|
122
|
-
width="100px;"
|
|
123
|
-
alt=""
|
|
124
|
-
/>
|
|
125
|
-
<br /><sub><b>Juice10</b></sub>
|
|
126
|
-
<br /><sub>open for rrweb consulting</sub>
|
|
127
|
-
</a>
|
|
128
|
-
</td>
|
|
129
|
-
</tr>
|
|
130
|
-
</table>
|
|
131
|
-
|
|
132
|
-
## Who's using rrweb?
|
|
133
|
-
|
|
134
|
-
<table>
|
|
135
|
-
<tr>
|
|
136
|
-
<td align="center">
|
|
137
|
-
<a href="http://www.smartx.com/" target="_blank">
|
|
138
|
-
<img width="195px" src="https://www.rrweb.io/logos/smartx.png">
|
|
139
|
-
</a>
|
|
140
|
-
</td>
|
|
141
|
-
<td align="center">
|
|
142
|
-
<a href="https://posthog.com?utm_source=rrweb&utm_medium=sponsorship&utm_campaign=open-source-sponsorship" target="_blank">
|
|
143
|
-
<img width="195px" src="https://www.rrweb.io/logos/posthog.png">
|
|
144
|
-
</a>
|
|
145
|
-
</td>
|
|
146
|
-
<td align="center">
|
|
147
|
-
<a href="https://statcounter.com/session-replay/" target="_blank">
|
|
148
|
-
<img width="195px" src="https://statcounter.com/images/logo-statcounter-arc-blue.svg">
|
|
149
|
-
</a>
|
|
150
|
-
</td>
|
|
151
|
-
<td align="center">
|
|
152
|
-
<a href="https://recordonce.com/" target="_blank">
|
|
153
|
-
<img width="195px" alt="Smart screen recording for SaaS" src="https://uploads-ssl.webflow.com/5f3d133183156245630d4446/5f3d1940abe8db8612c23521_Record-Once-logo-554x80px.svg">
|
|
154
|
-
</a>
|
|
155
|
-
</td>
|
|
156
|
-
</tr>
|
|
157
|
-
<tr>
|
|
158
|
-
<td align="center">
|
|
159
|
-
<a href="https://cux.io" target="_blank">
|
|
160
|
-
<img style="padding: 8px" alt="The first ever UX automation tool" width="195px" src="https://cux.io/cux-logo.svg">
|
|
161
|
-
</a>
|
|
162
|
-
</td>
|
|
163
|
-
<td align="center">
|
|
164
|
-
<a href="https://remsupp.com" target="_blank">
|
|
165
|
-
<img style="padding: 8px" alt="Remote Access & Co-Browsing" width="195px" src="https://remsupp.com/images/logo.png">
|
|
166
|
-
</a>
|
|
167
|
-
</td>
|
|
168
|
-
<td align="center">
|
|
169
|
-
<a href="https://highlight.io" target="_blank">
|
|
170
|
-
<img style="padding: 8px" alt="The open source, fullstack Monitoring Platform." width="195px" src="https://github.com/highlight/highlight/raw/main/highlight.io/public/images/logo.png">
|
|
171
|
-
</a>
|
|
172
|
-
</td>
|
|
173
|
-
<td align="center">
|
|
174
|
-
<a href="https://analyzee.io" target="_blank">
|
|
175
|
-
<img style="padding: 8px" alt="Comprehensive data analytics platform that empowers businesses to gain valuable insights and make data-driven decisions." width="195px" src="https://cdn.analyzee.io/assets/analyzee-logo.png">
|
|
176
|
-
</a>
|
|
177
|
-
</td>
|
|
178
|
-
</tr>
|
|
179
|
-
<tr>
|
|
180
|
-
<td align="center">
|
|
181
|
-
<a href="https://requestly.io" target="_blank">
|
|
182
|
-
<img style="padding: 8px" alt="Intercept, Modify, Record & Replay HTTP Requests." width="195px" src="https://github.com/requestly/requestly/assets/16779465/652552db-c867-44cb-9bb5-94a2026e04ca">
|
|
183
|
-
</a>
|
|
184
|
-
</td>
|
|
185
|
-
<td align="center">
|
|
186
|
-
<a href="https://gleap.io" target="_blank">
|
|
187
|
-
<img style="padding: 8px" alt="In-app bug reporting & customer feedback platform." width="195px" src="https://assets-global.website-files.com/6506f3f29c68b1724807619d/6506f56010237164c6306591_GleapLogo.svg">
|
|
188
|
-
</a>
|
|
189
|
-
</td>
|
|
190
|
-
<td align="center">
|
|
191
|
-
<a href="https://uxwizz.com" target="_blank">
|
|
192
|
-
<img style="padding: 8px" alt="Self-hosted website analytics with heatmaps and session recordings." width="195px" src="https://github.com/UXWizz/public-files/raw/main/assets/logo.png">
|
|
193
|
-
</a>
|
|
194
|
-
</td>
|
|
195
|
-
<td align="center">
|
|
196
|
-
<a href="https://www.howdygo.com" target="_blank">
|
|
197
|
-
<img style="padding: 8px" alt="Interactive product demos for small marketing teams" width="195px" src="https://assets-global.website-files.com/650afb446f1dd5bd410f00cc/650b2cec6188ff54dd9b01e1_Logo.svg">
|
|
198
|
-
</a>
|
|
199
|
-
</td>
|
|
200
|
-
</tr>
|
|
201
|
-
</table>
|
package/dist/record.cjs
CHANGED
|
@@ -144,32 +144,6 @@ function querySelectorAll$1(n2, selectors) {
|
|
|
144
144
|
function mutationObserverCtor$1() {
|
|
145
145
|
return getUntaintedPrototype$1("MutationObserver").constructor;
|
|
146
146
|
}
|
|
147
|
-
function patch$1(source, name, replacement) {
|
|
148
|
-
try {
|
|
149
|
-
if (!(name in source)) {
|
|
150
|
-
return () => {
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
const original = source[name];
|
|
154
|
-
const wrapped = replacement(original);
|
|
155
|
-
if (typeof wrapped === "function") {
|
|
156
|
-
wrapped.prototype = wrapped.prototype || {};
|
|
157
|
-
Object.defineProperties(wrapped, {
|
|
158
|
-
__rrweb_original__: {
|
|
159
|
-
enumerable: false,
|
|
160
|
-
value: original
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
source[name] = wrapped;
|
|
165
|
-
return () => {
|
|
166
|
-
source[name] = original;
|
|
167
|
-
};
|
|
168
|
-
} catch {
|
|
169
|
-
return () => {
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
147
|
const index$1 = {
|
|
174
148
|
childNodes: childNodes$1,
|
|
175
149
|
parentNode: parentNode$1,
|
|
@@ -182,8 +156,7 @@ const index$1 = {
|
|
|
182
156
|
shadowRoot: shadowRoot$1,
|
|
183
157
|
querySelector: querySelector$1,
|
|
184
158
|
querySelectorAll: querySelectorAll$1,
|
|
185
|
-
mutationObserver: mutationObserverCtor$1
|
|
186
|
-
patch: patch$1
|
|
159
|
+
mutationObserver: mutationObserverCtor$1
|
|
187
160
|
};
|
|
188
161
|
function isElement(n2) {
|
|
189
162
|
return n2.nodeType === n2.ELEMENT_NODE;
|
|
@@ -452,97 +425,26 @@ function absolutifyURLs(cssText, href) {
|
|
|
452
425
|
}
|
|
453
426
|
);
|
|
454
427
|
}
|
|
455
|
-
function normalizeCssString(cssText
|
|
456
|
-
|
|
457
|
-
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "");
|
|
458
|
-
} else {
|
|
459
|
-
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0");
|
|
460
|
-
}
|
|
428
|
+
function normalizeCssString(cssText) {
|
|
429
|
+
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "");
|
|
461
430
|
}
|
|
462
|
-
function splitCssText(cssText, style
|
|
431
|
+
function splitCssText(cssText, style) {
|
|
463
432
|
const childNodes2 = Array.from(style.childNodes);
|
|
464
433
|
const splits = [];
|
|
465
|
-
let iterCount = 0;
|
|
466
434
|
if (childNodes2.length > 1 && cssText && typeof cssText === "string") {
|
|
467
|
-
|
|
468
|
-
const normFactor = cssTextNorm.length / cssText.length;
|
|
435
|
+
const cssTextNorm = normalizeCssString(cssText);
|
|
469
436
|
for (let i2 = 1; i2 < childNodes2.length; i2++) {
|
|
470
437
|
if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === "string") {
|
|
471
|
-
const textContentNorm = normalizeCssString(
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
if (
|
|
479
|
-
// keep consuming css identifiers (to get a decent chunk more quickly)
|
|
480
|
-
textContentNorm[j].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section
|
|
481
|
-
textContentNorm.indexOf(textContentNorm.substring(0, j), 1) !== -1
|
|
482
|
-
) {
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
break;
|
|
486
|
-
}
|
|
487
|
-
for (; j < textContentNorm.length; j++) {
|
|
488
|
-
let startSubstring = textContentNorm.substring(0, j);
|
|
489
|
-
let cssNormSplits = cssTextNorm.split(startSubstring);
|
|
490
|
-
let splitNorm = -1;
|
|
491
|
-
if (cssNormSplits.length === 2) {
|
|
492
|
-
splitNorm = cssNormSplits[0].length;
|
|
493
|
-
} else if (cssNormSplits.length > 2 && cssNormSplits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
|
|
494
|
-
splitNorm = cssTextNorm.indexOf(startSubstring, 1);
|
|
495
|
-
} else if (cssNormSplits.length === 1) {
|
|
496
|
-
startSubstring = startSubstring.substring(
|
|
497
|
-
0,
|
|
498
|
-
startSubstring.length - 1
|
|
499
|
-
);
|
|
500
|
-
cssNormSplits = cssTextNorm.split(startSubstring);
|
|
501
|
-
if (cssNormSplits.length <= 1) {
|
|
502
|
-
splits.push(cssText);
|
|
503
|
-
return splits;
|
|
504
|
-
}
|
|
505
|
-
j = jLimit + 1;
|
|
506
|
-
} else if (j === textContentNorm.length - 1) {
|
|
507
|
-
splitNorm = cssTextNorm.indexOf(startSubstring);
|
|
508
|
-
}
|
|
509
|
-
if (cssNormSplits.length >= 2 && j > jLimit) {
|
|
510
|
-
const prevTextContent = childNodes2[i2 - 1].textContent;
|
|
511
|
-
if (prevTextContent && typeof prevTextContent === "string") {
|
|
512
|
-
const prevMinLength = normalizeCssString(prevTextContent).length;
|
|
513
|
-
splitNorm = cssTextNorm.indexOf(startSubstring, prevMinLength);
|
|
514
|
-
}
|
|
515
|
-
if (splitNorm === -1) {
|
|
516
|
-
splitNorm = cssNormSplits[0].length;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
if (splitNorm !== -1) {
|
|
520
|
-
let k = Math.floor(splitNorm / normFactor);
|
|
521
|
-
for (; k > 0 && k < cssText.length; ) {
|
|
522
|
-
iterCount += 1;
|
|
523
|
-
if (iterCount > 50 * childNodes2.length) {
|
|
524
|
-
splits.push(cssText);
|
|
525
|
-
return splits;
|
|
526
|
-
}
|
|
527
|
-
const normPart = normalizeCssString(
|
|
528
|
-
cssText.substring(0, k),
|
|
529
|
-
_testNoPxNorm
|
|
530
|
-
);
|
|
531
|
-
if (normPart.length === splitNorm) {
|
|
438
|
+
const textContentNorm = normalizeCssString(childNodes2[i2].textContent);
|
|
439
|
+
for (let j = 3; j < textContentNorm.length; j++) {
|
|
440
|
+
const bit = textContentNorm.substring(0, j);
|
|
441
|
+
if (cssTextNorm.split(bit).length === 2) {
|
|
442
|
+
const splitNorm = cssTextNorm.indexOf(bit);
|
|
443
|
+
for (let k = splitNorm; k < cssText.length; k++) {
|
|
444
|
+
if (normalizeCssString(cssText.substring(0, k)).length === splitNorm) {
|
|
532
445
|
splits.push(cssText.substring(0, k));
|
|
533
446
|
cssText = cssText.substring(k);
|
|
534
|
-
cssTextNorm = cssTextNorm.substring(splitNorm);
|
|
535
447
|
break;
|
|
536
|
-
} else if (normPart.length < splitNorm) {
|
|
537
|
-
k += Math.max(
|
|
538
|
-
1,
|
|
539
|
-
Math.floor((splitNorm - normPart.length) / normFactor)
|
|
540
|
-
);
|
|
541
|
-
} else {
|
|
542
|
-
k -= Math.max(
|
|
543
|
-
1,
|
|
544
|
-
Math.floor((normPart.length - splitNorm) * normFactor)
|
|
545
|
-
);
|
|
546
448
|
}
|
|
547
449
|
}
|
|
548
450
|
break;
|
|
@@ -1024,19 +926,8 @@ function serializeElementNode(n2, options) {
|
|
|
1024
926
|
const image = n2;
|
|
1025
927
|
const imageSrc = image.currentSrc || image.getAttribute("src") || "<unknown-src>";
|
|
1026
928
|
const priorCrossOrigin = image.crossOrigin;
|
|
1027
|
-
const cleanupCrossOriginAttribute = () => {
|
|
1028
|
-
if (image.crossOrigin === "anonymous") {
|
|
1029
|
-
if (priorCrossOrigin) {
|
|
1030
|
-
image.setAttribute("crossorigin", priorCrossOrigin);
|
|
1031
|
-
attributes.crossOrigin = priorCrossOrigin;
|
|
1032
|
-
} else {
|
|
1033
|
-
image.removeAttribute("crossorigin");
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1037
929
|
const recordInlineImage = () => {
|
|
1038
930
|
image.removeEventListener("load", recordInlineImage);
|
|
1039
|
-
image.removeEventListener("error", onImageLoadError);
|
|
1040
931
|
try {
|
|
1041
932
|
canvasService.width = image.naturalWidth;
|
|
1042
933
|
canvasService.height = image.naturalHeight;
|
|
@@ -1050,10 +941,7 @@ function serializeElementNode(n2, options) {
|
|
|
1050
941
|
image.crossOrigin = "anonymous";
|
|
1051
942
|
if (image.complete && image.naturalWidth !== 0)
|
|
1052
943
|
recordInlineImage();
|
|
1053
|
-
else
|
|
1054
|
-
image.addEventListener("load", recordInlineImage);
|
|
1055
|
-
image.addEventListener("error", onImageLoadError);
|
|
1056
|
-
}
|
|
944
|
+
else image.addEventListener("load", recordInlineImage);
|
|
1057
945
|
return;
|
|
1058
946
|
} else {
|
|
1059
947
|
console.warn(
|
|
@@ -1061,18 +949,12 @@ function serializeElementNode(n2, options) {
|
|
|
1061
949
|
);
|
|
1062
950
|
}
|
|
1063
951
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
image.removeEventListener("load", recordInlineImage);
|
|
1068
|
-
image.removeEventListener("error", onImageLoadError);
|
|
1069
|
-
cleanupCrossOriginAttribute();
|
|
952
|
+
if (image.crossOrigin === "anonymous") {
|
|
953
|
+
priorCrossOrigin ? attributes.crossOrigin = priorCrossOrigin : image.removeAttribute("crossorigin");
|
|
954
|
+
}
|
|
1070
955
|
};
|
|
1071
956
|
if (image.complete && image.naturalWidth !== 0) recordInlineImage();
|
|
1072
|
-
else
|
|
1073
|
-
image.addEventListener("load", recordInlineImage);
|
|
1074
|
-
image.addEventListener("error", onImageLoadError);
|
|
1075
|
-
}
|
|
957
|
+
else image.addEventListener("load", recordInlineImage);
|
|
1076
958
|
}
|
|
1077
959
|
if (tagName === "audio" || tagName === "video") {
|
|
1078
960
|
const mediaAttributes = attributes;
|
|
@@ -1134,7 +1016,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
|
|
|
1134
1016
|
} else if (sn.type === NodeType$3.Element) {
|
|
1135
1017
|
if (slimDOMOptions.script && // script tag
|
|
1136
1018
|
(sn.tagName === "script" || // (module)preload link
|
|
1137
|
-
sn.tagName === "link" && (sn.attributes.rel === "preload"
|
|
1019
|
+
sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
|
|
1138
1020
|
sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) {
|
|
1139
1021
|
return true;
|
|
1140
1022
|
} else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(
|
|
@@ -1278,10 +1160,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1278
1160
|
bypassOptions.cssCaptured = true;
|
|
1279
1161
|
}
|
|
1280
1162
|
for (const childN of Array.from(index$1.childNodes(n2))) {
|
|
1281
|
-
const serializedChildNode = serializeNodeWithId(
|
|
1282
|
-
childN,
|
|
1283
|
-
bypassOptions
|
|
1284
|
-
);
|
|
1163
|
+
const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
|
|
1285
1164
|
if (serializedChildNode) {
|
|
1286
1165
|
serializedNode.childNodes.push(serializedChildNode);
|
|
1287
1166
|
}
|
|
@@ -1290,10 +1169,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1290
1169
|
let shadowRootEl = null;
|
|
1291
1170
|
if (isElement(n2) && (shadowRootEl = index$1.shadowRoot(n2))) {
|
|
1292
1171
|
for (const childN of Array.from(index$1.childNodes(shadowRootEl))) {
|
|
1293
|
-
const serializedChildNode = serializeNodeWithId(
|
|
1294
|
-
childN,
|
|
1295
|
-
bypassOptions
|
|
1296
|
-
);
|
|
1172
|
+
const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
|
|
1297
1173
|
if (serializedChildNode) {
|
|
1298
1174
|
isNativeShadowDom(shadowRootEl) && (serializedChildNode.isShadow = true);
|
|
1299
1175
|
serializedNode.childNodes.push(serializedChildNode);
|
|
@@ -8761,32 +8637,6 @@ function querySelectorAll(n2, selectors) {
|
|
|
8761
8637
|
function mutationObserverCtor() {
|
|
8762
8638
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
8763
8639
|
}
|
|
8764
|
-
function patch(source, name, replacement) {
|
|
8765
|
-
try {
|
|
8766
|
-
if (!(name in source)) {
|
|
8767
|
-
return () => {
|
|
8768
|
-
};
|
|
8769
|
-
}
|
|
8770
|
-
const original = source[name];
|
|
8771
|
-
const wrapped = replacement(original);
|
|
8772
|
-
if (typeof wrapped === "function") {
|
|
8773
|
-
wrapped.prototype = wrapped.prototype || {};
|
|
8774
|
-
Object.defineProperties(wrapped, {
|
|
8775
|
-
__rrweb_original__: {
|
|
8776
|
-
enumerable: false,
|
|
8777
|
-
value: original
|
|
8778
|
-
}
|
|
8779
|
-
});
|
|
8780
|
-
}
|
|
8781
|
-
source[name] = wrapped;
|
|
8782
|
-
return () => {
|
|
8783
|
-
source[name] = original;
|
|
8784
|
-
};
|
|
8785
|
-
} catch {
|
|
8786
|
-
return () => {
|
|
8787
|
-
};
|
|
8788
|
-
}
|
|
8789
|
-
}
|
|
8790
8640
|
const index = {
|
|
8791
8641
|
childNodes,
|
|
8792
8642
|
parentNode,
|
|
@@ -8799,8 +8649,7 @@ const index = {
|
|
|
8799
8649
|
shadowRoot,
|
|
8800
8650
|
querySelector,
|
|
8801
8651
|
querySelectorAll,
|
|
8802
|
-
mutationObserver: mutationObserverCtor
|
|
8803
|
-
patch
|
|
8652
|
+
mutationObserver: mutationObserverCtor
|
|
8804
8653
|
};
|
|
8805
8654
|
function on(type, fn, target = document) {
|
|
8806
8655
|
const options = { capture: true, passive: true };
|
|
@@ -8883,6 +8732,32 @@ function hookSetter(target, key, d, isRevoked, win = window) {
|
|
|
8883
8732
|
);
|
|
8884
8733
|
return () => hookSetter(target, key, original || {}, true);
|
|
8885
8734
|
}
|
|
8735
|
+
function patch(source, name, replacement) {
|
|
8736
|
+
try {
|
|
8737
|
+
if (!(name in source)) {
|
|
8738
|
+
return () => {
|
|
8739
|
+
};
|
|
8740
|
+
}
|
|
8741
|
+
const original = source[name];
|
|
8742
|
+
const wrapped = replacement(original);
|
|
8743
|
+
if (typeof wrapped === "function") {
|
|
8744
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
8745
|
+
Object.defineProperties(wrapped, {
|
|
8746
|
+
__rrweb_original__: {
|
|
8747
|
+
enumerable: false,
|
|
8748
|
+
value: original
|
|
8749
|
+
}
|
|
8750
|
+
});
|
|
8751
|
+
}
|
|
8752
|
+
source[name] = wrapped;
|
|
8753
|
+
return () => {
|
|
8754
|
+
source[name] = original;
|
|
8755
|
+
};
|
|
8756
|
+
} catch {
|
|
8757
|
+
return () => {
|
|
8758
|
+
};
|
|
8759
|
+
}
|
|
8760
|
+
}
|
|
8886
8761
|
let nowTimestamp = Date.now;
|
|
8887
8762
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
8888
8763
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -9444,18 +9319,10 @@ class MutationBuffer {
|
|
|
9444
9319
|
this.attributes.push(item);
|
|
9445
9320
|
this.attributeMap.set(textarea, item);
|
|
9446
9321
|
}
|
|
9447
|
-
|
|
9322
|
+
item.attributes.value = Array.from(
|
|
9448
9323
|
index.childNodes(textarea),
|
|
9449
9324
|
(cn) => index.textContent(cn) || ""
|
|
9450
9325
|
).join("");
|
|
9451
|
-
item.attributes.value = maskInputValue({
|
|
9452
|
-
element: textarea,
|
|
9453
|
-
maskInputOptions: this.maskInputOptions,
|
|
9454
|
-
tagName: textarea.tagName,
|
|
9455
|
-
type: getInputType(textarea),
|
|
9456
|
-
value,
|
|
9457
|
-
maskInputFn: this.maskInputFn
|
|
9458
|
-
});
|
|
9459
9326
|
});
|
|
9460
9327
|
__publicField(this, "processMutation", (m) => {
|
|
9461
9328
|
if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {
|