Skip to content

support recording canvas in iframe and shadow dom - #1428

Open
p-mazhnik wants to merge 9 commits into
rrweb-io:mainfrom
p-mazhnik:rrweb-canvas
Open

p-mazhnik wants to merge 9 commits into
rrweb-io:mainfrom
p-mazhnik:rrweb-canvas

Conversation

@p-mazhnik

@p-mazhnik p-mazhnik commented Mar 15, 2024 •

Copy link
Copy Markdown

Resolves #1412, resolves #1081

Before

Red square is on the main page;
Green is inside the shadow dom on the main page;
Blue one is within the iframe;
Pink is inside the shadow dom within the iframe.

canvas-iframe-before.mov
After
canvas-iframe-after.mov

Key differences from existing PRs:

  • support for sampling: 'all' mode
  • ShadowDomManager is utilized for obtaining information about the shadow DOMs, rather than looping through all the elements on the page
  • support for exiting takeCanvasSnapshots loop on reset
  • tests

@changeset-bot

changeset-bot Bot commented Mar 15, 2024 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db60778

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
rrweb Patch
rrweb-snapshot Patch
rrdom Patch
rrdom-nodejs Patch
rrweb-player Patch
@rrweb/types Patch
@rrweb/web-extension Patch
rrvideo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

# Conflicts:
#	packages/rrweb/src/record/observers/canvas/canvas-manager.ts
@Juice10
Juice10 self-requested a review April 5, 2024 13:12
@Juice10 Juice10 self-assigned this Apr 5, 2024
billyvg added a commit to getsentry/rrweb that referenced this pull request May 29, 2024
Resolves getsentry/sentry-javascript#10758

rrweb PR: rrweb-io#1428

<details>
<summary>
Before
</summary>
<p>
Red square is on the main page;<br>
Green is inside the shadow dom on the main page;<br>
Blue one is within the iframe;<br>
Pink is inside the shadow dom within the iframe.
</p>
<video
src="https://github.com/rrweb-io/rrweb/assets/25964451/110f1e36-0a74-4d1c-9cd7-d28eba95af05"/>
</details>

<details>
<summary>
After
</summary>
<video
src="https://github.com/rrweb-io/rrweb/assets/25964451/902495b5-e1b3-40d0-85af-6aeff58a5628"/>
</details>
@EnzoPortela

Copy link
Copy Markdown

It still working?

@ptang-nr

Copy link
Copy Markdown

Hello, we are using rrweb and it's been a great product for capturing replays! We have also come across edge cases where we are not capturing <canvas> elements from shadow DOMS and we're greatly interested in utilizing the fix implemented within this PR.

It looks like this PR has been "stuck" in the current state for the last 6 months. What is the next step to move forward with this? Is it awaiting merge conflict resolution by original author or would it be ok if we or others try to help resolve the conflict?

(Asking as I'm still new to open source and not sure about etiquette, thanks for your consideration!)
@p-mazhnik @okejminja @Juice10

@GOSPDigitalAssets

Copy link
Copy Markdown

We're also waiting for this PR approval as we'd like to use rrweb with flutter canvaskit too. Hope it will be merged soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Changes in the canvas within the Shadow DOM cannot be recorded [Bug]: 页面有多个iframe,iframe里面的canvas 录制失败

6 participants