From 124727beee4c618801538057e18463e906050f63 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Fri, 26 Jul 2024 17:30:47 +0100 Subject: [PATCH] Fix regression on test [html file]: with-style-sheet-with-import.html The prior 'dynamic stylesheet' route is now the main route for serializing a stylesheet; dynamic stylesheet were missed out in #1533 but are caught in this PR by the tests added in that PR as the stylesheet handling is simplified/centralised --- packages/rrweb-snapshot/src/utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index e2240d1ed9..4b04fbed04 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -108,8 +108,13 @@ export function stringifyStylesheet(s: CSSStyleSheet): string | null { if (!rules) { return null; } + let sheetHref = s.href; + if (!sheetHref && s.ownerNode && s.ownerNode.ownerDocument) { + // an inline