Skip to content
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]: 页面有多个iframe,iframe里面的canvas 录制失败 #1081

Open
1 task done
Vale-sail opened this issue Jan 4, 2023 · 3 comments · May be fixed by #1428
Open
1 task done

[Bug]: 页面有多个iframe,iframe里面的canvas 录制失败 #1081

Vale-sail opened this issue Jan 4, 2023 · 3 comments · May be fixed by #1428
Labels
bug Something isn't working

Comments

@Vale-sail
Copy link

Vale-sail commented Jan 4, 2023

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

master

Expected Behavior

页面有多个iframe,iframe里面的canvas的录制应该能成功

Actual Behavior

页面有多个iframe,iframe里面的canvas的录制应该能成功

Steps to Reproduce

使用puppeteer录制一个多iframe并且iframe内有canvas的页面。

Testcase Gist URL

No response

Additional Information

canvasManager 仅仅使用window对象初始化了一次,如果页面有多个iframe。
那么getCanvas()执行会报错
image
我尝试使用这么修改,能够正常录制
image
由于我水平有限,initCanvasMutationObserver 里面我不知道怎么去改

@Vale-sail Vale-sail added the bug Something isn't working label Jan 4, 2023
@Vale-sail
Copy link
Author

另外如果录制的页面有一个大的canvas,绘制时会闪烁严重

@Juice10
Copy link
Contributor

Juice10 commented Jan 6, 2023

Hi @Vale-sail, thank you for your excellent issue and code suggestion. Could you please create a Pull Request with these code changes? We would be more than happy to accept it

@davidleon
Copy link

After viewing the source code for a while. I think the canvasmanager constructor should have document instead of window. and the iframe walk function should automatically call up canvasmanager with corresponding document. I don't quite really understand the post fix of looping through windows. From my test cases there's always one window if i have a nested iframe canvas in browser.

@p-mazhnik p-mazhnik linked a pull request Mar 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants