Snapshot CSS background-image URL as base64
The quest for embedding all resources in the snapshot continues. See: https://github.com/rrweb-io/rrweb/issues/737 - saving images offline as base64
Currently there's no way that I know of, to include the CSS background-image URL inside the snapshot JSON. I mean, if the CSS has something like:
.elem {
background-image: url(example.com/some.css);
}The CSS is just a link and when the website goes dark, the styles are lost forever.
I made a small hack to convert all the urls from links, into base64, for all the DOM elements on the page. The big problem is how to deal with the pseudo elements ::before and ::after, that can also contain background-images and quite popular?
Does anyone have any ideas? Is there maybe something in the codebase to help with this? Is it a plan to support anything like that?
Thanks!
Source: rrweb-io/rrweb