From 969565173a84016036b1354498868ab415a45f33 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 10 Jul 2024 14:44:08 +0100 Subject: [PATCH] Honour the 'omits css contents for asset managed stylesheet' test: // presence of onAssetDetected means we should get // rr_captured_href (with contents promised later - i.e. using rrweb/record) Not sure when this test started failing --- packages/rrweb-snapshot/src/snapshot.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index e38f3f623b..355dce87d3 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -1119,8 +1119,18 @@ export function serializeNodeWithId( let { needsMask } = options; let { preserveWhiteSpace = true } = options; - if (inlineImages) { - captureAssets.images = true; + if (onAssetDetected) { + if (captureAssets.images === undefined && inlineImages) { + captureAssets.images = true; + } + if (captureAssets.stylesheets === undefined) { + if (inlineStylesheet) { + // the prior default setting + captureAssets.stylesheets = 'without-fetch'; + } else { + captureAssets.stylesheets = false; + } + } } if (!needsMask) {