-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: rrweb is not reverting "crossorigin" attribute changes made to "img" elements #904
Comments
Hi @dkozlovskyi, thanks for submitting the bug report! I looked through the rrweb source code and noticed rrweb isn't changing any of the cases. As far as I know every attribute is automatically lowercased by the browser before it is returned. Example below: const el = document.createElement('div');
el.setAttribute('MYATTR', 'upcase?')
console.log(el.attributes[0].name) //=> 'myattr' Could you share your |
Thanks for your response. rrweb is changing value of attribute in this line and reverting back original value here. Setting crossorigin attribute is case-insensitive because it always puts the value into the lower case. However, reading the attribute is case-sensitive. Below you can see code example that you can run in the browser:
Video Recording rrweb-crossorigin-issue-recording.movPlease correct me if I'm wrong. |
Thanks for clarifying that, adding a video and pointing to exactly the lines in the rrweb source code that are causing this issue @dkozlovskyi! You made the fix quite easy, here it is: #906 |
* Speed up snapshotting of many new dom nodes By avoiding reflow we shave about 15-25% off our snapshotting time * Improve newlyAddedElement docs * Optimize needMaskingText by using el.closest and less recursion * Serve all rrweb dist files * Split serializeNode into smaller functions Makes it easier to profile * Slow down cpu enhance tracing on fast machines * Increase timeout * Perf: only loop through ancestors when they have something to compare to * Perf: `hasNode` is cheaper than `getMeta` * Perf: If parents where already checked, no need to do it again * Perf: reverse for loops are faster Because they only do the .lenght check once. In this case I don't think we'll see much performance gains if any * Clean up code * Perf: check ancestors once with isBlocked * guessing this might fixes canvas test * Update packages/rrweb/src/record/observers/canvas/webgl.ts Co-authored-by: yz-yu <[email protected]> * Fix #904 (#906) Properly remove crossorigin attribute * Bump minimist from 1.2.5 to 1.2.6 (#902) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: yz-yu <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Preflight Checklist
What package is this bug report for?
rrweb
Expected Behavior
rrweb sets the original "crossorigin" attribute value or removes it in case it was empty before the recording
Actual Behavior
rrweb is referencing to the attribute in CamelCase ("crossOrigin"), as the result it can not preserve and revert the original value.
Testcase Gist URL
No response
Additional Information
Steps to reproduce:
Fix suggestion
reference to the case-sensitive "crossorigin" attribute instead of "crossOrigin".
The text was updated successfully, but these errors were encountered: