简体   繁体   English

如何调试Thunderbird插件/扩展的JavaScript

[英]How to debug a Thunderbird addon/extension's JavaScript

I want to develop a Thunderbird 12 addon. 我想开发一个Thunderbird 12插件。 I have written a simple JS function. 我写了一个简单的JS函数。 (File: "chrome\\content\\myApp.js"). (文件:“chrome \\ content \\ myApp.js”)。 This file is called by a xul-'onclick'-event. 该文件由xul-'onclick'事件调用。 I have packed my addon as a .xpi file and then I have installed it. 我已将我的插件打包为.xpi文件,然后我安装了它。 (All ok, it's working!) (好的,它正在工作!)

Now I'd like to debug my JS functions. 现在我想调试我的JS函数。 But I can't find a working JS Debugger. 但我找不到一个有效的JS Debugger。 I have tried this addons: 我试过这个插件:

  • "Javascript Debugger"(0.9.89). “Javascript Debugger”(0.9.89)。 Not working: The thread doesn't stop at my breakpoints. 不工作:线程不会在我的断点处停止。
  • Firebug(1.7.2) + Chromebug(1.7.2). Firebug(1.7.2)+ Chromebug(1.7.2)。 Not working: I can't enable the JS debug tab. 不工作:我无法启用JS调试选项卡。 ( Update : I also can't set/change a "context") 更新 :我也无法设置/更改“上下文”)

Happily we once again have a debugger for Thunderbird! 令人高兴的是,我们再次拥有Thunderbird的调试器! You need a newer/nightly version, but hanks to Philipp Kewisch's summer of code project we can use the Firefox debugger to remotely debug Thunderbird. 你需要一个更新/每晚的版本,但是对于Philipp Kewisch夏天的代码项目,我们可以使用Firefox调试器来远程调试Thunderbird。 More details at the following links: http://kewisch.wordpress.com/2013/09/22/thunderbird-developer-tools-wrapup/ http://kewisch.wordpress.com/2013/06/13/the-thunderbird-remote-debugger-is-alive/ https://bugzilla.mozilla.org/show_bug.cgi?id=876636 更多详情请访问以下链接: http//kewisch.wordpress.com/2013/09/22/thunderbird-developer-tools-wrapup/ http://kewisch.wordpress.com/2013/06/13/the-thunderbird -remote-debugger-is-alive / https://bugzilla.mozilla.org/show_bug.cgi?id=876636

If you are really committed to TB12, you can debug on the nightly then test on TB12. 如果您真的致力于TB12,您可以在每晚调试然后在TB12上进行测试。

Unfortunately there's no such thing as a decent debugger for chrome (addons) javascript. 不幸的是,没有像chrome(插件)javascript那样体面的调试器。 Chromebug has been long abandoned, venkman doesn't work, addon authors are a little bit stranded there. Chromebug一直被抛弃,venkman不起作用,插件作者有点滞留在那里。 A new debugging API called JSD2 is in the works at Mozilla, but it looks from the wiki that it's mostly targeted at content (webpage) javascript, not chrome (addons) javascript, at least not in the short term. 一个名为JSD2的新调试API正在Mozilla中运行,但它从维基看起来它主要针对内容(网页)javascript,而不是chrome(插件)javascript,至少在短期内不会。

Fortunately, a very recent effort seems to have paid off: there's now a way to execute easily small snippets of javascript in a decent console-like window. 幸运的是,最近的努力似乎已经得到了回报:现在有一种方法可以在类似控制台的窗口中轻松执行javascript的小片段。 See http://mikeconley.ca/blog/2012/05/11/scratchpad-ported-to-thunderbird-kinda/ for the details :). 有关详细信息,请参见http://mikeconley.ca/blog/2012/05/11/scratchpad-ported-to-thunderbird-kinda/

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

相关问题 如何在Thunderbird插件中使用(或避免)Rhino Javascript? - How to use (or avoid) Rhino Javascript in Thunderbird addon? Thunderbird扩展-如何在Javascript中使用相对路径? - Thunderbird extension - How to use relative paths with Javascript? 如何调试 vscode 扩展的 WebView javascript - How To Debug a vscode extension's WebView javascript 如何使用thunderbird-addon显示电子邮件的正文? - How to display the body of an email with a thunderbird-addon? 在Thunderbird扩展中,不同的javascript文件如何相互引用? - In a Thunderbird extension, how can different javascript files refer to each other? 如何通过Thunderbird扩展中的javascript在nsIEditor / nsIPlaintextEditor中设置光标位置? - How to set the cursor position in nsIEditor/nsIPlaintextEditor via javascript in a Thunderbird extension? 如何在JavaScript中制作IE插件/扩展程序? - How to make an IE addon/extension in JavaScript? 从无重启(自举)插件中获取Thunderbird的电子邮件编辑器对象 - Getting Thunderbird's email editor object from a restartless (bootstrapped) addon 雷鸟插件-按发件人筛选 - Thunderbird Addon - Filter by Sender 如何在 Thunderbird Addon 中添加没有 XUL 的 onload 监听器? - How to add onload listener without XUL in Thunderbird Addon?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM