@sitelint/webrewind 0.0.0-stage → 0.0.2
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 +65 -2
- package/dist/.test-helpers/setup.d.ts +2 -0
- package/dist/.test-helpers/setup.d.ts.map +1 -0
- package/dist/.test-helpers/setup.js +96 -0
- package/dist/.test-helpers/setup.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/record.d.ts +6 -0
- package/dist/record.d.ts.map +1 -0
- package/dist/record.js +300 -0
- package/dist/record.js.map +1 -0
- package/dist/record.test.d.ts +2 -0
- package/dist/record.test.d.ts.map +1 -0
- package/dist/record.test.js +119 -0
- package/dist/record.test.js.map +1 -0
- package/dist/replay.d.ts +24 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +422 -0
- package/dist/replay.js.map +1 -0
- package/dist/replay.test.d.ts +2 -0
- package/dist/replay.test.d.ts.map +1 -0
- package/dist/replay.test.js +279 -0
- package/dist/replay.test.js.map +1 -0
- package/dist/types.d.ts +68 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -0
- package/dist/types.test.d.ts +2 -0
- package/dist/types.test.d.ts.map +1 -0
- package/dist/types.test.js +46 -0
- package/dist/types.test.js.map +1 -0
- package/package.json +67 -4
package/README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sitelint/webrewind
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Independent record-and-replay library for the web. Captures DOM mutations and user interactions into a compact JSON event stream, then replays them in a viewer for session replay and bug reproduction.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sitelint/webrewind
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Record (in the page being audited)
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { record } from '@sitelint/webrewind';
|
|
17
|
+
|
|
18
|
+
const stop = record({
|
|
19
|
+
emit: (event) => {
|
|
20
|
+
// send event to your ring buffer / issue store
|
|
21
|
+
console.log(event.type, event.timestamp, event.data);
|
|
22
|
+
},
|
|
23
|
+
recordDOM: true,
|
|
24
|
+
sampling: { mousemove: 100, scroll: 150, input: 'last' }
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// later: stop recording
|
|
28
|
+
stop();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Replay (in the issue detail viewer)
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { Replayer } from '@sitelint/webrewind';
|
|
35
|
+
|
|
36
|
+
const replayer = new Replayer(events, {
|
|
37
|
+
root: document.querySelector('#replayContainer'),
|
|
38
|
+
speed: 1,
|
|
39
|
+
showWarning: false,
|
|
40
|
+
showDebug: false,
|
|
41
|
+
blockClass: 'auditor-block'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
replayer.play();
|
|
45
|
+
replayer.destroy(); // cleanup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### `record(options)`
|
|
51
|
+
|
|
52
|
+
Starts recording. Returns `stopRecording(): void`.
|
|
53
|
+
|
|
54
|
+
### `class Replayer`
|
|
55
|
+
|
|
56
|
+
- `constructor(events: eventWithTime[], config: ReplayerConfig)`
|
|
57
|
+
- `play(): void`
|
|
58
|
+
- `pause(): void`
|
|
59
|
+
- `resume(): void`
|
|
60
|
+
- `destroy(): void`
|
|
61
|
+
- `isPlaying(): boolean`
|
|
62
|
+
- `wrapper: HTMLElement`
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MPL-2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/.test-helpers/setup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { JSDOM } from 'jsdom';
|
|
2
|
+
const dom = new JSDOM('', {
|
|
3
|
+
contentType: 'text/html',
|
|
4
|
+
url: 'https://localhost/'
|
|
5
|
+
});
|
|
6
|
+
const domWindow = dom.window;
|
|
7
|
+
Object.defineProperty(globalThis, 'window', {
|
|
8
|
+
configurable: true,
|
|
9
|
+
value: domWindow,
|
|
10
|
+
writable: true
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(globalThis, 'document', {
|
|
13
|
+
configurable: true,
|
|
14
|
+
value: domWindow.document,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(globalThis, 'addEventListener', {
|
|
18
|
+
configurable: true,
|
|
19
|
+
value: domWindow.addEventListener.bind(domWindow),
|
|
20
|
+
writable: true
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(globalThis, 'removeEventListener', {
|
|
23
|
+
configurable: true,
|
|
24
|
+
value: domWindow.removeEventListener.bind(domWindow),
|
|
25
|
+
writable: true
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(globalThis, 'dispatchEvent', {
|
|
28
|
+
configurable: true,
|
|
29
|
+
value: domWindow.dispatchEvent.bind(domWindow),
|
|
30
|
+
writable: true
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(globalThis, 'Event', {
|
|
33
|
+
configurable: true,
|
|
34
|
+
value: domWindow.Event,
|
|
35
|
+
writable: true
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(globalThis, 'MutationObserver', {
|
|
38
|
+
configurable: true,
|
|
39
|
+
value: domWindow.MutationObserver,
|
|
40
|
+
writable: true
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(globalThis, 'requestAnimationFrame', {
|
|
43
|
+
configurable: true,
|
|
44
|
+
value: (cb) => {
|
|
45
|
+
return globalThis.setTimeout(() => cb(0), 0);
|
|
46
|
+
},
|
|
47
|
+
writable: true
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(globalThis, 'cancelAnimationFrame', {
|
|
50
|
+
configurable: true,
|
|
51
|
+
value: (id) => {
|
|
52
|
+
globalThis.clearTimeout(id);
|
|
53
|
+
},
|
|
54
|
+
writable: true
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(globalThis, 'getComputedStyle', {
|
|
57
|
+
configurable: true,
|
|
58
|
+
value: domWindow.getComputedStyle.bind(domWindow),
|
|
59
|
+
writable: true
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(globalThis, 'ShadowRoot', {
|
|
62
|
+
configurable: true,
|
|
63
|
+
value: domWindow.ShadowRoot,
|
|
64
|
+
writable: true
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(globalThis, 'HTMLElement', {
|
|
67
|
+
configurable: true,
|
|
68
|
+
value: domWindow.HTMLElement,
|
|
69
|
+
writable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(globalThis, 'Element', {
|
|
72
|
+
configurable: true,
|
|
73
|
+
value: domWindow.Element,
|
|
74
|
+
writable: true
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(globalThis, 'HTMLInputElement', {
|
|
77
|
+
configurable: true,
|
|
78
|
+
value: domWindow.HTMLInputElement,
|
|
79
|
+
writable: true
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(globalThis, 'location', {
|
|
82
|
+
configurable: true,
|
|
83
|
+
value: domWindow.location,
|
|
84
|
+
writable: true
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(globalThis, 'Node', {
|
|
87
|
+
configurable: true,
|
|
88
|
+
value: domWindow.Node,
|
|
89
|
+
writable: true
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(globalThis, 'DOMRect', {
|
|
92
|
+
configurable: true,
|
|
93
|
+
value: domWindow.DOMRect,
|
|
94
|
+
writable: true
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@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S,CAAC,WAAW;IAC5B,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE;IAC3C,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS,CAAC,OAAO;IACxB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,kBAAkB,EAAE;IACpD,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS,CAAC,gBAAgB;IACjC,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE;IAC5C,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS,CAAC,QAAQ;IACzB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE;IACxC,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS,CAAC,IAAI;IACrB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE;IAC3C,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS,CAAC,OAAO;IACxB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { eventWithTime, playerConfig, recordOptions, SamplingStrategy } from './types';
|
|
2
|
+
export { EventType, IncrementalSource } from './types';
|
|
3
|
+
export { Replayer } from './replay';
|
|
4
|
+
export { record, RECORDING_START_TIME } from './record';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/record.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,aAAa,EAAoB,MAAM,SAAS,CAAC;AAG9E,eAAO,MAAM,oBAAoB,EAAE,MAA8B,CAAC;AA2LlE,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,SAAS,CAoL/E"}
|
package/dist/record.js
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { EventType, IncrementalSource } from './types';
|
|
2
|
+
export const RECORDING_START_TIME = globalThis.Date.now();
|
|
3
|
+
const MAX_BUFFER_EVENTS = 5000;
|
|
4
|
+
const MAX_MUTATION_HTML_LENGTH = 4000;
|
|
5
|
+
const MUTATION_TYPE_ATTRIBUTES = 'attributes';
|
|
6
|
+
const MUTATION_TYPE_CHILD_LIST = 'childList';
|
|
7
|
+
const TRANSPARENT_COLOR = 'rgba(0, 0, 0, 0)';
|
|
8
|
+
const TRANSPARENT_KEYWORD = 'transparent';
|
|
9
|
+
const _MOUSEMOVE_THROTTLE_MS = 100;
|
|
10
|
+
const SCROLL_THROTTLE_MS = 150;
|
|
11
|
+
function getRelativeTime() {
|
|
12
|
+
return globalThis.Date.now() - RECORDING_START_TIME;
|
|
13
|
+
}
|
|
14
|
+
function resolveElement(node) {
|
|
15
|
+
if (node === null) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (node instanceof globalThis.Element) {
|
|
19
|
+
return node;
|
|
20
|
+
}
|
|
21
|
+
return node.parentElement;
|
|
22
|
+
}
|
|
23
|
+
function serializeNode(node) {
|
|
24
|
+
if (node.nodeType === globalThis.Node.ELEMENT_NODE) {
|
|
25
|
+
return node.outerHTML;
|
|
26
|
+
}
|
|
27
|
+
return node.textContent ?? '';
|
|
28
|
+
}
|
|
29
|
+
function collectMutationData(mutation) {
|
|
30
|
+
const target = resolveElement(mutation.target);
|
|
31
|
+
if (mutation.type === MUTATION_TYPE_CHILD_LIST) {
|
|
32
|
+
const nextSibling = mutation.nextSibling instanceof globalThis.Element ? mutation.nextSibling : null;
|
|
33
|
+
return {
|
|
34
|
+
addedHtml: Array.from(mutation.addedNodes).map(serializeNode).join('').slice(0, MAX_MUTATION_HTML_LENGTH),
|
|
35
|
+
mutationType: mutation.type,
|
|
36
|
+
nextSibling: buildCssSelector(nextSibling),
|
|
37
|
+
removedHtml: Array.from(mutation.removedNodes).map(serializeNode).join('').slice(0, MAX_MUTATION_HTML_LENGTH),
|
|
38
|
+
source: IncrementalSource.MouseMove,
|
|
39
|
+
target: buildCssSelector(target)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (mutation.type === MUTATION_TYPE_ATTRIBUTES) {
|
|
43
|
+
const attributeName = mutation.attributeName;
|
|
44
|
+
return {
|
|
45
|
+
attributeName,
|
|
46
|
+
mutationType: mutation.type,
|
|
47
|
+
newValue: target !== null && attributeName !== null ? target.getAttribute(attributeName) : null,
|
|
48
|
+
oldValue: mutation.oldValue,
|
|
49
|
+
source: IncrementalSource.MouseMove,
|
|
50
|
+
target: buildCssSelector(target)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
mutationType: mutation.type,
|
|
55
|
+
newValue: mutation.target.textContent ?? '',
|
|
56
|
+
oldValue: mutation.oldValue,
|
|
57
|
+
source: IncrementalSource.MouseMove,
|
|
58
|
+
target: buildCssSelector(target)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function createEvent(type, data) {
|
|
62
|
+
return {
|
|
63
|
+
data,
|
|
64
|
+
timestamp: getRelativeTime(),
|
|
65
|
+
type
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function buildCssSelector(target) {
|
|
69
|
+
if (target === null || !(target instanceof Element)) {
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
const parts = [];
|
|
73
|
+
let current = target;
|
|
74
|
+
while (current !== null && current.nodeType === globalThis.Node.ELEMENT_NODE) {
|
|
75
|
+
let selector = current.tagName.toLowerCase();
|
|
76
|
+
if (current.id) {
|
|
77
|
+
selector += `#${current.id}`;
|
|
78
|
+
}
|
|
79
|
+
const classes = Array.from(current.classList ?? []);
|
|
80
|
+
if (classes.length > 0) {
|
|
81
|
+
selector += `.${classes.join('.')}`;
|
|
82
|
+
}
|
|
83
|
+
parts.push(selector);
|
|
84
|
+
current = current.parentElement;
|
|
85
|
+
}
|
|
86
|
+
return parts.reverse().join(' > ');
|
|
87
|
+
}
|
|
88
|
+
function getAccessibleName(target) {
|
|
89
|
+
const ariaLabel = target.getAttribute('aria-label');
|
|
90
|
+
if (ariaLabel !== null && ariaLabel.length > 0) {
|
|
91
|
+
return ariaLabel;
|
|
92
|
+
}
|
|
93
|
+
const ariaLabelledby = target.getAttribute('aria-labelledby');
|
|
94
|
+
if (ariaLabelledby !== null) {
|
|
95
|
+
const labelledElement = globalThis.document.getElementById(ariaLabelledby);
|
|
96
|
+
if (labelledElement !== null) {
|
|
97
|
+
const text = labelledElement.textContent ?? '';
|
|
98
|
+
if (text.length > 0) {
|
|
99
|
+
return text.trim();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const textContent = target.textContent;
|
|
104
|
+
if (textContent !== null && textContent.trim().length > 0) {
|
|
105
|
+
return textContent.trim().slice(0, 80);
|
|
106
|
+
}
|
|
107
|
+
return target.tagName.toLowerCase();
|
|
108
|
+
}
|
|
109
|
+
function isSensitiveInput(target) {
|
|
110
|
+
if (target.tagName !== 'INPUT') {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
const input = target;
|
|
114
|
+
const type = (input.type ?? 'text').toLowerCase();
|
|
115
|
+
return type === 'password' || type === 'search';
|
|
116
|
+
}
|
|
117
|
+
function isOpaqueColor(color) {
|
|
118
|
+
if (color.length === 0) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return color !== TRANSPARENT_KEYWORD && color !== TRANSPARENT_COLOR;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The wheel of the recorded page must survive into the platform viewer, which
|
|
125
|
+
* may run in the opposite color scheme.
|
|
126
|
+
*/
|
|
127
|
+
function resolvePageBackgroundColor() {
|
|
128
|
+
const bodyColor = globalThis.getComputedStyle(globalThis.document.body).backgroundColor;
|
|
129
|
+
if (isOpaqueColor(bodyColor)) {
|
|
130
|
+
return bodyColor;
|
|
131
|
+
}
|
|
132
|
+
const rootColor = globalThis.getComputedStyle(globalThis.document.documentElement).backgroundColor;
|
|
133
|
+
return isOpaqueColor(rootColor) ? rootColor : '';
|
|
134
|
+
}
|
|
135
|
+
function captureFullSnapshot() {
|
|
136
|
+
return {
|
|
137
|
+
backgroundColor: resolvePageBackgroundColor(),
|
|
138
|
+
html: globalThis.document.documentElement.outerHTML,
|
|
139
|
+
title: globalThis.document.title,
|
|
140
|
+
url: globalThis.location.href,
|
|
141
|
+
viewport: {
|
|
142
|
+
height: globalThis.innerHeight,
|
|
143
|
+
width: globalThis.innerWidth
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export function record(options) {
|
|
148
|
+
const emit = options.emit;
|
|
149
|
+
const recordDOM = options.recordDOM ?? true;
|
|
150
|
+
const _sampling = options.sampling ?? {};
|
|
151
|
+
const events = [];
|
|
152
|
+
let isRecording = true;
|
|
153
|
+
const _lastMouseMoveTime = 0;
|
|
154
|
+
let lastScrollTime = 0;
|
|
155
|
+
let mutationObserver = null;
|
|
156
|
+
let clickListener = null;
|
|
157
|
+
let keydownListener = null;
|
|
158
|
+
let scrollListener = null;
|
|
159
|
+
let visibilityListener = null;
|
|
160
|
+
let popStateListener = null;
|
|
161
|
+
function emitEvent(event) {
|
|
162
|
+
if (isRecording === false) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
events.push(event);
|
|
166
|
+
if (events.length > MAX_BUFFER_EVENTS) {
|
|
167
|
+
events.shift();
|
|
168
|
+
}
|
|
169
|
+
emit(event);
|
|
170
|
+
}
|
|
171
|
+
function observeMutations() {
|
|
172
|
+
if (mutationObserver !== null) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const onMutations = (mutations) => {
|
|
176
|
+
if (isRecording === false) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
for (const mutation of mutations) {
|
|
180
|
+
emitEvent(createEvent(EventType.IncrementalSnapshot, collectMutationData(mutation)));
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
mutationObserver = new globalThis.MutationObserver(onMutations);
|
|
184
|
+
try {
|
|
185
|
+
mutationObserver.observe(globalThis.document.documentElement, {
|
|
186
|
+
attributeOldValue: true,
|
|
187
|
+
attributes: true,
|
|
188
|
+
characterData: true,
|
|
189
|
+
characterDataOldValue: true,
|
|
190
|
+
childList: true,
|
|
191
|
+
subtree: true
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
console.error('[webrewind.record] MutationObserver failed', error);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function stopObservers() {
|
|
199
|
+
if (mutationObserver !== null) {
|
|
200
|
+
mutationObserver.disconnect();
|
|
201
|
+
mutationObserver = null;
|
|
202
|
+
}
|
|
203
|
+
if (clickListener !== null && globalThis.document !== null) {
|
|
204
|
+
globalThis.document.removeEventListener('click', clickListener, true);
|
|
205
|
+
clickListener = null;
|
|
206
|
+
}
|
|
207
|
+
if (keydownListener !== null && globalThis.document !== null) {
|
|
208
|
+
globalThis.document.removeEventListener('keydown', keydownListener, true);
|
|
209
|
+
keydownListener = null;
|
|
210
|
+
}
|
|
211
|
+
if (scrollListener !== null) {
|
|
212
|
+
globalThis.removeEventListener('scroll', scrollListener, true);
|
|
213
|
+
scrollListener = null;
|
|
214
|
+
}
|
|
215
|
+
if (visibilityListener !== null) {
|
|
216
|
+
globalThis.removeEventListener('visibilitychange', visibilityListener);
|
|
217
|
+
visibilityListener = null;
|
|
218
|
+
}
|
|
219
|
+
if (popStateListener !== null) {
|
|
220
|
+
globalThis.removeEventListener('popstate', popStateListener);
|
|
221
|
+
popStateListener = null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
clickListener = (event) => {
|
|
225
|
+
if (isRecording === false || ((event.target instanceof Element) === false)) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
emitEvent(createEvent(EventType.IncrementalSnapshot, {
|
|
229
|
+
clientX: event.clientX,
|
|
230
|
+
clientY: event.clientY,
|
|
231
|
+
isSensitive: isSensitiveInput(event.target),
|
|
232
|
+
label: getAccessibleName(event.target),
|
|
233
|
+
source: IncrementalSource.MouseInteraction,
|
|
234
|
+
target: buildCssSelector(event.target),
|
|
235
|
+
type: 'click'
|
|
236
|
+
}));
|
|
237
|
+
};
|
|
238
|
+
keydownListener = (event) => {
|
|
239
|
+
if (isRecording === false || ((event.target instanceof Element) === false)) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
emitEvent(createEvent(EventType.IncrementalSnapshot, {
|
|
243
|
+
isSensitive: isSensitiveInput(event.target),
|
|
244
|
+
key: event.key,
|
|
245
|
+
source: IncrementalSource.Input,
|
|
246
|
+
target: buildCssSelector(event.target),
|
|
247
|
+
type: 'keydown'
|
|
248
|
+
}));
|
|
249
|
+
};
|
|
250
|
+
scrollListener = () => {
|
|
251
|
+
const now = globalThis.Date.now();
|
|
252
|
+
if (isRecording === false || now - lastScrollTime < SCROLL_THROTTLE_MS) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
lastScrollTime = now;
|
|
256
|
+
emitEvent(createEvent(EventType.IncrementalSnapshot, {
|
|
257
|
+
scrollX: globalThis.scrollX,
|
|
258
|
+
scrollY: globalThis.scrollY,
|
|
259
|
+
source: IncrementalSource.Scroll,
|
|
260
|
+
target: buildCssSelector(globalThis.document.scrollingElement)
|
|
261
|
+
}));
|
|
262
|
+
};
|
|
263
|
+
visibilityListener = () => {
|
|
264
|
+
emitEvent(createEvent(EventType.IncrementalSnapshot, {
|
|
265
|
+
source: IncrementalSource.MouseInteraction,
|
|
266
|
+
type: 'visibilitychange',
|
|
267
|
+
visibilityState: globalThis.document.visibilityState
|
|
268
|
+
}));
|
|
269
|
+
};
|
|
270
|
+
popStateListener = () => {
|
|
271
|
+
emitEvent(createEvent(EventType.IncrementalSnapshot, {
|
|
272
|
+
source: IncrementalSource.MouseInteraction,
|
|
273
|
+
type: 'popstate',
|
|
274
|
+
url: globalThis.location.href
|
|
275
|
+
}));
|
|
276
|
+
};
|
|
277
|
+
try {
|
|
278
|
+
globalThis.document.addEventListener('click', clickListener, true);
|
|
279
|
+
globalThis.document.addEventListener('keydown', keydownListener, true);
|
|
280
|
+
globalThis.addEventListener('scroll', scrollListener, true);
|
|
281
|
+
globalThis.addEventListener('visibilitychange', visibilityListener);
|
|
282
|
+
globalThis.addEventListener('popstate', popStateListener);
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
console.error('[webrewind.record] Failed to attach event listeners', error);
|
|
286
|
+
stopObservers();
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
observeMutations();
|
|
290
|
+
if (recordDOM) {
|
|
291
|
+
emitEvent(createEvent(EventType.FullSnapshot, captureFullSnapshot()));
|
|
292
|
+
}
|
|
293
|
+
return {
|
|
294
|
+
stop: () => {
|
|
295
|
+
isRecording = false;
|
|
296
|
+
stopObservers();
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAW,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAClE,MAAM,iBAAiB,GAAW,IAAI,CAAC;AACvC,MAAM,wBAAwB,GAAW,IAAI,CAAC;AAC9C,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAC9C,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAC7C,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAC7C,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAC1C,MAAM,sBAAsB,GAAW,GAAG,CAAC;AAC3C,MAAM,kBAAkB,GAAW,GAAG,CAAC;AAEvC,SAAS,eAAe;IACtB,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,oBAAoB,CAAC;AACtD,CAAC;AAED,SAAS,cAAc,CAAC,IAAiB;IACvC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,YAAY,UAAU,CAAC,OAAO,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,aAAa,CAAC;AAC5B,CAAC;AAED,SAAS,aAAa,CAAC,IA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GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,IAAI;SAC9B,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,IAAI,CAAC;QACH,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QACnE,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;QACvE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAC5D,UAAU,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACpE,UAAU,CAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qDAAqD,EAAE,KAAK,CAAC,CAAC;QAC5E,aAAa,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,gBAAgB,EAAE,CAAC;IAEnB,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,GAAS,EAAE;YACf,WAAW,GAAG,KAAK,CAAC;YACpB,aAAa,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.test.d.ts","sourceRoot":"","sources":["../src/record.test.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { record } from './index';
|
|
2
|
+
import './.test-helpers/setup';
|
|
3
|
+
import { describe, it } from 'node:test';
|
|
4
|
+
import assert from 'node:assert/strict';
|
|
5
|
+
describe('record', () => {
|
|
6
|
+
it('returns an object with a stop function', () => {
|
|
7
|
+
const events = [];
|
|
8
|
+
const result = record({
|
|
9
|
+
emit: (event) => {
|
|
10
|
+
events.push(event);
|
|
11
|
+
},
|
|
12
|
+
recordDOM: true
|
|
13
|
+
});
|
|
14
|
+
assert.ok(result !== undefined);
|
|
15
|
+
assert.ok(typeof result.stop === 'function');
|
|
16
|
+
result.stop();
|
|
17
|
+
});
|
|
18
|
+
it('emits a FullSnapshot event when recordDOM is true', () => {
|
|
19
|
+
const events = [];
|
|
20
|
+
const result = record({
|
|
21
|
+
emit: (event) => {
|
|
22
|
+
events.push(event);
|
|
23
|
+
},
|
|
24
|
+
recordDOM: true
|
|
25
|
+
});
|
|
26
|
+
assert.ok(result !== undefined);
|
|
27
|
+
result.stop();
|
|
28
|
+
assert.ok(events.length > 0);
|
|
29
|
+
assert.strictEqual(events[0].type, 2); // EventType.FullSnapshot
|
|
30
|
+
const snapshot = events[0].data;
|
|
31
|
+
assert.strictEqual(typeof snapshot.backgroundColor, 'string');
|
|
32
|
+
});
|
|
33
|
+
it('stops emitting events after stop() is called', () => {
|
|
34
|
+
const events = [];
|
|
35
|
+
const result = record({
|
|
36
|
+
emit: (event) => {
|
|
37
|
+
events.push(event);
|
|
38
|
+
},
|
|
39
|
+
recordDOM: false
|
|
40
|
+
});
|
|
41
|
+
const countBeforeStop = events.length;
|
|
42
|
+
result.stop();
|
|
43
|
+
// Clicking after stop should not add events
|
|
44
|
+
const clickEvent = new globalThis.Event('click');
|
|
45
|
+
globalThis.document.dispatchEvent(clickEvent);
|
|
46
|
+
assert.strictEqual(events.length, countBeforeStop);
|
|
47
|
+
});
|
|
48
|
+
it('accepts sampling options without throwing', () => {
|
|
49
|
+
assert.doesNotThrow(() => {
|
|
50
|
+
const result = record({
|
|
51
|
+
emit: () => {
|
|
52
|
+
// noop
|
|
53
|
+
},
|
|
54
|
+
recordDOM: false,
|
|
55
|
+
sampling: {
|
|
56
|
+
mousemove: 100,
|
|
57
|
+
scroll: 150,
|
|
58
|
+
input: 'last'
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
assert.ok(result !== undefined);
|
|
62
|
+
result.stop();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
it('emits events with timestamp and data', () => {
|
|
66
|
+
const events = [];
|
|
67
|
+
const result = record({
|
|
68
|
+
emit: (event) => {
|
|
69
|
+
events.push(event);
|
|
70
|
+
},
|
|
71
|
+
recordDOM: false
|
|
72
|
+
});
|
|
73
|
+
// Dispatch a click to generate an event
|
|
74
|
+
const clickEvent = new globalThis.Event('click');
|
|
75
|
+
Object.defineProperty(clickEvent, 'target', {
|
|
76
|
+
value: globalThis.document.body,
|
|
77
|
+
configurable: true
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(clickEvent, 'clientX', { value: 100, configurable: true });
|
|
80
|
+
Object.defineProperty(clickEvent, 'clientY', { value: 200, configurable: true });
|
|
81
|
+
globalThis.document.dispatchEvent(clickEvent);
|
|
82
|
+
result.stop();
|
|
83
|
+
assert.ok(events.length > 0);
|
|
84
|
+
for (const event of events) {
|
|
85
|
+
assert.ok(typeof event.timestamp === 'number');
|
|
86
|
+
assert.ok(event.data !== undefined);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
it('records mutation selectors from root to target', () => {
|
|
90
|
+
const events = [];
|
|
91
|
+
const result = record({
|
|
92
|
+
emit: (event) => {
|
|
93
|
+
events.push(event);
|
|
94
|
+
},
|
|
95
|
+
recordDOM: false
|
|
96
|
+
});
|
|
97
|
+
assert.ok(result !== undefined);
|
|
98
|
+
const child = globalThis.document.createElement('div');
|
|
99
|
+
child.id = 'selector-order-child';
|
|
100
|
+
globalThis.document.body.appendChild(child);
|
|
101
|
+
return new Promise((resolve) => {
|
|
102
|
+
globalThis.setTimeout(() => {
|
|
103
|
+
result.stop();
|
|
104
|
+
child.remove();
|
|
105
|
+
const childListEvent = events.find((event) => {
|
|
106
|
+
return (event.type === 3 &&
|
|
107
|
+
typeof event.data === 'object' &&
|
|
108
|
+
event.data !== null &&
|
|
109
|
+
event.data.mutationType === 'childList');
|
|
110
|
+
});
|
|
111
|
+
assert.ok(childListEvent !== undefined);
|
|
112
|
+
const data = childListEvent.data;
|
|
113
|
+
assert.strictEqual(data.target, 'html > body');
|
|
114
|
+
resolve();
|
|
115
|
+
}, 50);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=record.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.test.js","sourceRoot":"","sources":["../src/record.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,SAAS,CAAC;AACrD,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,MAAM,GAAoB,EAAE,CAAC;QAEnC,MAAM,MAAM,GAAG,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC,KAAoB,EAAQ,EAAE;gBACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;YACD,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;QAChC,MAAM,CAAC,EAAE,CAAC,OAAO,MAAO,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;QAE9C,MAAO,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAoB,EAAE,CAAC;QAEnC,MAAM,MAAM,GAAG,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC,KAAoB,EAAQ,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