Skip to content

Commit

Permalink
Add a test for using the image.crossOrigin = 'anonymous'; hack
Browse files Browse the repository at this point in the history
  • Loading branch information
eoghanmurray committed May 8, 2024
1 parent 136af88 commit 71298d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rrweb-snapshot/test/html/picture.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<img src="assets/img/characters/robot.png" />
</picture>
<img src="/images/robot.png" alt="This is a robot" />
<img src="https://avatars.githubusercontent.com/u/43396833?s=20&v=4" alt="CORS restricted but has access-control-allow-origin: *" />
</body>
</html>
8 changes: 8 additions & 0 deletions packages/rrweb-snapshot/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ iframe.contentDocument.querySelector('center').clientHeight
rr_dataURL: expect.stringMatching(/^data:image\/webp;base64,/),
},
}),
expect.objectContaining({
tagName: 'img',
attributes: {
src: 'https://avatars.githubusercontent.com/u/43396833?s=20&v=4',
alt: 'CORS restricted but has access-control-allow-origin: *',
rr_dataURL: expect.stringMatching(/^data:image\/webp;base64,/),
},
}),
]),
);
});
Expand Down

0 comments on commit 71298d8

Please sign in to comment.