diff --git a/.changeset/nervous-kiwis-nail.md b/.changeset/nervous-kiwis-nail.md new file mode 100644 index 0000000000..897df7ed5f --- /dev/null +++ b/.changeset/nervous-kiwis-nail.md @@ -0,0 +1,6 @@ +--- +'rrweb-snapshot': patch +'rrweb': patch +--- + +Bugfix after #1434 perf improvements: fix that blob urls persist on the shared anchor element and can't be later modified diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 822fa04967..81dc2133a0 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -218,6 +218,8 @@ function getHref(doc: Document, customHref?: string) { } if (!customHref) { customHref = ''; + } else if (customHref.startsWith('blob:') || customHref.startsWith('data:')) { + return customHref; } // note: using `new URL` is slower. See #1434 or https://jsbench.me/uqlud17rxo/1 a.setAttribute('href', customHref);