Decrease embedded img size for inlineImages (#836)
* Decrease embedded img size for inlineImages * Fix the test * Use webp for image snapshots * Implemented optional param dataURLOptions
This commit is contained in:
committed by
GitHub
parent
24202d2486
commit
4c06535309
@@ -199,14 +199,17 @@ iframe.contentDocument.querySelector('center').clientHeight
|
||||
waitUntil: 'load',
|
||||
});
|
||||
await page.waitForSelector('img', { timeout: 1000 });
|
||||
await page.evaluate(`${code}var snapshot = rrweb.snapshot(document, {inlineImages: true, inlineStylesheet: false});
|
||||
`);
|
||||
await page.evaluate(`${code}var snapshot = rrweb.snapshot(document, {
|
||||
dataURLOptions: { type: "image/webp", quality: 0.8 },
|
||||
inlineImages: true,
|
||||
inlineStylesheet: false
|
||||
})`);
|
||||
await page.waitFor(100);
|
||||
const snapshot = await page.evaluate(
|
||||
'JSON.stringify(snapshot[0], null, 2);',
|
||||
);
|
||||
assert(snapshot.includes('"rr_dataURL"'));
|
||||
assert(snapshot.includes('data:image/png;base64,'));
|
||||
assert(snapshot.includes('data:image/webp;base64,'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user