Best Debugging Tools for JavaScript/xulrunner Development

Question!

In the past few months I began my first serious JavaScript development, as I began developing XUL applications. I use Notepad++ as my editor, but I was pretty appalled to find (as far as I can tell) that Venkman/Javascript Debugger is the tool for debugging. It seems like a poor replacement to Visual Studio for .Net languages.

Am I missing something? What are the best tools and best practices for JavaScript development? Is there some killer IDE/debugger/editor combination I'm not aware of?

It has to be easier than this, though.

I've heard some mention of Eclipse - is it a good choice here? I know very little about it.

Edit: Some of you have pointed out Firebug - I guess my problem was that I'm not actually using JavaScript for web development for which Firebug seems to be the tool -- instead I'm using it for XUL development in xulrunner. Which may simply be a weakness or immaturity of xulrunner.



Answers

XULRunner/Firefox support native remote debugging now! You can use XULRunner as debuggee, and firefox as debugger.

Instruction for remote debgging can be found at MDN.

You must set pref devtools.debugger.remote-enabled to true in both debuggee and debugger.

Use this code in your app:

var windowtype = ...
Components.utils.import('resource://gre/modules/devtools/dbg-server.jsm');
DebuggerServer.chromeWindowType = windowtype;

if (!DebuggerServer.initialized) {
  DebuggerServer.init();
  DebuggerServer.addBrowserActors(windowtype);
}

DebuggerServer.openListener(6000);

If your page is (x)html, assign windowtype with null; if your page is xul, assign windowtype with the same value of the windowtype attribute of the xul:window element:

<xul:window windowtype=... >
...
</xul:window>

Start your XULRunner app, and in Firefox, go to Tools > Web Developer > Connect..., connect to localhost, port 6000, and you should be able to debug.

By : Duan Yao


Try a combination of Script# (http://www.nikhilk.net/ScriptSharpIntro.aspx)

and

Firebug

Cheers

By : user352


I have not done any XUL development/debugging, but following is the list of my tools for Javascript debugging/dev.

  • Firebug

  • FireRainbow, FireRainbow enables javascript syntax highlighting for Firebug

  • FirePHP,FirePHP enables you to log to your Firebug Console using a simple PHP method call.

  • Widerbug, can leverage wide screens for js debugging/development. Obsolete now as it is supported in Firebug 1.9 right out of the box.

By : user_v


This video can help you solving your question :)
By: admin