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

当页面中有img标签且src地址无法获取到图片资源时。截图控件报错。 #162

Open
hzboy192 opened this issue Jul 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hzboy192
Copy link

hzboy192 commented Jul 4, 2024

Version of js-screen-shot

1.7.9

Operating system and its version

Windows

Browser and its version

126.0.6478.127(正式版本) (64 位)

Sandbox to reproduce

在被截图的页面body中添加<img src="https://xxx.com/demo.jpg"/>然后截图

What happened?

截图遮罩层出现后鼠标无法选择截图区域。控制台有错误,提示图片not fond。

使用html2canvas模式截图,相关配置:
enableWebRtc: false,
loadCrossImg: true,
clickCutFullScreen: false,
wrcWindowMode: false,
hiddenScrollBar: {state: true},

页面错误不应该影响截图软件的运行,临时处理方案修改源码drawCrossImg函数中img.onerror将src替换成空白图片后按onload中的逻辑执行,截图是优化的逻辑供参考。
2024-07-04_15-41-27

报错信息

报错信息见浏览器控制台错误。

处理建议

插件提供一个dom转换的onerror回调函数,将出现异常的dom对象传递给过去,让开发人员自定义实现异常修复逻辑。框架可默认实现一个异常修复方案,保证截图控件正常运行。

@hzboy192 hzboy192 added the bug Something isn't working label Jul 4, 2024
@likaia
Copy link
Owner

likaia commented Jul 4, 2024

Hello @hzboy192. Your feedback has been received, and you will be notified in the issue area when the problem is resolved.
你好 @hzboy192,已收到你反馈的问题,问题解决后将在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

No branches or pull requests

2 participants