调试JS修改某些特定的canvas元素 [英] Debug JS modifying some specific canvas element
问题描述
我正在尝试使用Chrome开发者工具调试canvas元素.
从此:
如何检查画布框架
我可以看到有一个实验功能可以执行类似的操作,但已被删除.
I'm trying to debug a canvas element with Chrome Developer Tools.
From this:
How to inspect Canvas Frames
I can see there was an experimental feature to do something like that but was removed.
有没有一种方法可以搜索/查找负责修改某些特定canvas元素的JS代码?这样至少我们可以在JS上添加断点
Is there a way to search/find the JS code responsible of modifying some specifig canvas element? in that way at least we could add breakpoints to the JS
推荐答案
我找到了一种解决方法:从CanvasRenderingContext2D覆盖该函数并添加一个调试器".每次调用时要在那里停止的行(或添加一些额外条件来停止)
I've found a workaround: override the function from CanvasRenderingContext2D and add a "debugger;" line there to stop every time is called (or add some extra condition to stop)
这篇关于调试JS修改某些特定的canvas元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!