rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

fix: The URL involved in the dynamic modification element inline style is not converted to an absolute path

Open champkeh opened this issue 3 years ago • 5 comments

champkeh avatar Dec 13 '21 10:12 champkeh

Maybe we need transform all the style attribute here?

Yuyz0112 avatar Dec 23 '21 15:12 Yuyz0112

Yes, indeed. I'll update it later.

champkeh avatar Dec 24 '21 03:12 champkeh

Is this to fix that there are URLs in the background-image attribute?

  • does transformAttribute handle css shorthand e.g. background: black url(/xyz.jpg) no-repeat;
  • should (can) we do this on the replayer side?
  • is it possible to write a test for this?

eoghanmurray avatar Jan 11 '22 13:01 eoghanmurray

@eoghanmurray I wrote some test case for this.

champkeh avatar Jan 13 '22 04:01 champkeh

Thanks for the test case!

Is this going down the if (name === 'style' && value) code path in transformAttribute ? I think in that case, calling absoluteToStylesheet directly is preferable as we are not actually dealing with an entire attribute here.

Is it necessary to update your test case with a shorthand one; background: black url(/xyz.jpg) no-repeat; or can we trust that absoluteToStylesheet will do the right thing?

eoghanmurray avatar Feb 22 '22 10:02 eoghanmurray