diff --git a/.changeset/chilly-wombats-hide.md b/.changeset/chilly-wombats-hide.md new file mode 100644 index 0000000000..ae39e52360 --- /dev/null +++ b/.changeset/chilly-wombats-hide.md @@ -0,0 +1,5 @@ +--- +"rrweb-snapshot": patch +--- + +Add support for chrome-extension://... urls in stylesheets diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 301f84430e..b704531551 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -66,7 +66,7 @@ let canvasService: HTMLCanvasElement | null; let canvasCtx: CanvasRenderingContext2D | null; const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm; -const URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\/\//i; +const URL_PROTOCOL_MATCH = /^(?:[a-z+-]+:)?\/\//i; const URL_WWW_MATCH = /^www\..*/i; const DATA_URI = /^(data:)([^,]*),(.*)/i; export function absoluteToStylesheet(