XULRunner application debugging

Sorry for posting this here, but I could not find a better place for it.

I am trying to debug a XULRunner application, so I tried to do what this guide says, but it seems to be out of date.

Components.utils.import('resource://gre/modules/devtools/dbg-server.jsm');
if (!DebuggerServer.initialized) {
  DebuggerServer.init();
  // Don't specify a window type parameter below if "navigator:browser"
  // is suitable for your app.
  DebuggerServer.addBrowserActors("myXULRunnerAppWindowType");
}
DebuggerServer.openListener(6000);

The problem is, that DebuggerServer.openListener() seemingly no longer exists (at least that is the error thrown). I am running the XULRunner application via Firefox Developer Edition (43.0a2 (2015-10-07)).

I would greatly appreciate any help or suggestion on how to get this working (or even a suggestion for a possibly better place to ask this).
Thanks.

Maybe looking at its source code will help you. There is a createListener function, but I’m not sure if that’s what you need.

Thank you for the suggestion. By digging around I’ve managed to get halfway there. I can create a connection if I change this line:

DebuggerServer.openListener(6000);

to these:

let listener = DebuggerServer.createListener();
listener.portOrPath = 6000;
listener.open();

Now the problem is, that if I don’t call addBrowserActors() then it *“alert()”*s a message that I should add at least one actor. If I call addBrowserActors() with the windowtype of the main xul window, it manages to connect, but the list which shows the windows (or tabs in case of firefox for android) that can be debugged is empty, so I cannot inspect windows, read the console output, etc.
On the other hand, if I connect using WebIDE, it can take a screenshot of the main window, edit the preferences, etc. But I don’t know if it is possible to read the console from WebIDE (I didn’t find such an option so far). Could I achieve the same things using WebIDE as with the Connect… menu or should I try to figure out why the windows are not listed? Could it be a bug that the window is not listed on the Connect… page (since WebIDE can take a screenshot fine, or is it unrelated?), that I should probably report or am I missing something?

1 Like