Dra*_*421 4 debugging firefox firefox-addon
我不知道如何调试我的简单扩展。脚本(内容脚本)加载(因为第一个 console.log 调用显示在选项卡的控制台中),但随后什么也没有。没有任何错误,也没有第二次 console.log 调用。
我的问题不是关于解决我的代码问题(肯定有一个,如果只有 Firefox 能告诉我在哪里),而是关于找到有关附加组件的警告/错误在 Firefox 中的位置(例如 'sdfsdf has no object property )。 ..')
about:调试没有帮助,它可以打开的控制台显示一些错误(例如:“错误:服务“domainInfo”不可用。请确保它出现在使用它的模块背景的“requiresServices”属性中。”)这与我想做的事情无关(我可以从错误的来源和性质中看出)
// start of file
console.log('I AM LOADING');
// simple DOM manipulation code here...
console.log('I AM LOADED');
// end of file
Run Code Online (Sandbox Code Playgroud)
内容脚本应该使用附加到网页的 DevTools 实例进行调试。
但是,正如您所注意到的,由于 bug ,内容脚本中的错误不会在选项卡的 Web 控制台中报告。(从 Firefox 70 开始。)
作为解决方法,您可以:
| 归档时间: |
|
| 查看次数: |
1214 次 |
| 最近记录: |