From 34def579c2de1546f2882671fa6578aaef98127b 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 b02f5d72f6..1d582954dc 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -114,8 +114,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