是否可以在使用 devtools 进行调试时进行模拟/覆盖?

Is it possible to mock/override while debugging using devtools?

提问人:unknown_boundaries 提问时间:7/20/2023 更新时间:7/20/2023 访问量:65

问:

我正在使用浏览器开发工具进行调试。我知道在当前 setuo 中有一个 if 条件是 false,但我想调试到 if 块中进行一些代码执行检查。有没有办法模拟/覆盖函数的返回值,以便对于该特定运行调试流将进入该 if 块。

if (isEnabled()) {
   // I want to go into this if block
   someFunc();
} else {
   // flow going here.
}

我想模拟,这样我就可以进入 if 块,而无需更改代码中的函数并重新运行请求。我想自己在调试流程中做。isEnabled()

调试 google-chrome-devtools devtools 边缘 devtools

评论


答: 暂无答案