简体   繁体   English

在 Thunderbird 的 userChrome.js 中调试日志记录

[英]Debug logging in Thunderbird's userChrome.js

I'm trying to debug a custom javascript for Thunderbird that is defined in userChrome.js.我正在尝试为 userChrome.js 中定义的 Thunderbird 调试自定义 javascript。 Unfortunately I did not find a decent way to log to the javascript console.不幸的是,我没有找到登录 javascript 控制台的合适方法。 Is there an easy way to dump some information to an easily accessible console/logfile so that I can debug my script?有没有一种简单的方法可以将一些信息转储到易于访问的控制台/日志文件中,以便我可以调试我的脚本? I have console² installed and tried calling我安装了 console² 并尝试调用

throw Error("foobar");

already, without success.已经,没有成功。

Does Application.console.log("message") work? Application.console.log("message") 是否有效?

  1. Write console.log("hello");写入console.log("hello"); in your *.uc.js file.在你的*.uc.js文件中。
  2. Open browser console(ctrl + shift + j).打开浏览器控制台(ctrl + shift + j)。

Now, you can see message from file *.uc.js .现在,您可以看到来自文件*.uc.js的消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM