Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/rrweb-snapshot/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ describe('integration tests', function (this: ISuite) {
});
}
await waitForRAF(page);
const rebuildHtml = ((await page.evaluate(`${code}
const rebuildHtml = (
(await page.evaluate(`${code}
const x = new XMLSerializer();
const snap = rrweb.snapshot(document);
let out = x.serializeToString(rrweb.rebuild(snap, { doc: document }));
Expand All @@ -138,7 +139,8 @@ describe('integration tests', function (this: ISuite) {
out = out.replace(' xmlns=\"http://www.w3.org/1999/xhtml\"', '');
}
out; // return
`)) as string)
`)) as string
)
.replace(/\n\n/g, '')
.replace(
/blob:http:\/\/localhost:\d+\/[0-9a-z\-]+/,
Expand Down
50 changes: 26 additions & 24 deletions packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,30 +181,32 @@ export default class MutationBuffer {
private processedNodeManager: observerParam['processedNodeManager'];

public init(options: MutationBufferParam) {
([
'mutationCb',
'blockClass',
'blockSelector',
'maskTextClass',
'maskTextSelector',
'inlineStylesheet',
'maskInputOptions',
'maskTextFn',
'maskInputFn',
'keepIframeSrcFn',
'recordCanvas',
'inlineImages',
'enableStrictPrivacy',
'slimDOMOptions',
'dataURLOptions',
'doc',
'mirror',
'iframeManager',
'stylesheetManager',
'shadowDomManager',
'canvasManager',
'processedNodeManager',
] as const).forEach((key) => {
(
[
'mutationCb',
'blockClass',
'blockSelector',
'maskTextClass',
'maskTextSelector',
'inlineStylesheet',
'maskInputOptions',
'maskTextFn',
'maskInputFn',
'keepIframeSrcFn',
'recordCanvas',
'inlineImages',
'enableStrictPrivacy',
'slimDOMOptions',
'dataURLOptions',
'doc',
'mirror',
'iframeManager',
'stylesheetManager',
'shadowDomManager',
'canvasManager',
'processedNodeManager',
] as const
).forEach((key) => {
// just a type trick, the runtime result is correct
this[key] = options[key] as never;
});
Expand Down
6 changes: 3 additions & 3 deletions packages/rrweb/test/record.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ describe('record', function (this: ISuite) {
iframe!.contentDocument!.adoptedStyleSheets = [sheet2];
iframe!.contentDocument!.body.innerHTML = '<h1>h1 in iframe</h1>';

const { rrweb, emit } = (window as unknown) as IWindow;
const { rrweb, emit } = window as unknown as IWindow;
rrweb.record({
emit,
});
Expand Down Expand Up @@ -569,7 +569,7 @@ describe('record', function (this: ISuite) {
sheet2.replaceSync!('div {font-size: large;}');
shadowHost.shadowRoot!.adoptedStyleSheets = [sheet2];

const { rrweb, emit } = (window as unknown) as IWindow;
const { rrweb, emit } = window as unknown as IWindow;
rrweb.record({
emit,
});
Expand Down Expand Up @@ -603,7 +603,7 @@ describe('record', function (this: ISuite) {
sheet.replaceSync!('h1 {color: blue;}');
shadowHost.shadowRoot!.adoptedStyleSheets = [sheet];

const { rrweb, emit } = (window as unknown) as IWindow;
const { rrweb, emit } = window as unknown as IWindow;
rrweb.record({
emit,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import * as url from 'url';
import * as fs from 'fs';

export async function launchPuppeteer(
options?: Parameters<typeof puppeteer['launch']>[0],
options?: Parameters<(typeof puppeteer)['launch']>[0],
) {
return await puppeteer.launch({
headless: process.env.PUPPETEER_HEADLESS ? true : false,
Expand Down