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
  • Loading branch information
eoghanmurray committed May 2, 2024
1 parent 5e7943d commit d4d82c6
Showing 1 changed file with 2 additions and 0 deletions.
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 d4d82c6

Please sign in to comment.