Skip to content

Commit

Permalink
Fix that blob urls persist on the shared anchor element and can't be …
Browse files Browse the repository at this point in the history
…later modified (#1467)

* Fix that blob urls persist on the shared anchor element and can't be later modified

* Create nervous-kiwis-nail.md
  • Loading branch information
eoghanmurray authored May 3, 2024
1 parent 5e7943d commit e96f668
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/nervous-kiwis-nail.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions packages/rrweb-snapshot/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e96f668

Please sign in to comment.