Skip to content

Commit e96f668

Browse files
authored
Fix that blob urls persist on the shared anchor element and can't be later modified (#1467)
* Fix that blob urls persist on the shared anchor element and can't be later modified * Create nervous-kiwis-nail.md
1 parent 5e7943d commit e96f668

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/nervous-kiwis-nail.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'rrweb-snapshot': patch
3+
'rrweb': patch
4+
---
5+
6+
Bugfix after #1434 perf improvements: fix that blob urls persist on the shared anchor element and can't be later modified

packages/rrweb-snapshot/src/snapshot.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ function getHref(doc: Document, customHref?: string) {
218218
}
219219
if (!customHref) {
220220
customHref = '';
221+
} else if (customHref.startsWith('blob:') || customHref.startsWith('data:')) {
222+
return customHref;
221223
}
222224
// note: using `new URL` is slower. See #1434 or https://jsbench.me/uqlud17rxo/1
223225
a.setAttribute('href', customHref);

0 commit comments

Comments
 (0)