The downside is that only Firefox is supported now — other applications simply don’t have Developer Tools to integrate with. Also, debugging add-ons or the browser itself isn’t possible—— Developer Tools run in a separate process for that, no add-ons installed there. Finally, the search functionality is absolutely rudimentary right now, that’s something I hope to improve eventually.
Using the new debugging API turned out to be tricky to say the least. Did I link to MDN above? Sorry about that, I should have linked to the SpiderMonkey source code. It’s very similar to the MDN documentation but the later is outdated. And even if you look at the SpiderMonkey source, much of the documentation is merely wishful thinking, listing features that were never implemented.
A new UI concept had to be developed as well, and the only good option for per-tab debugging would be integrating into the Firefox Developer Tools. That’s where the fun really started. I tried to make sense of the documentation, studied the source code, figured out that
ToolDefinition.build() is supposed to return a promise. Then I looked at what
TargetType is and how existing tools work with it — this was the point where I realized that there are so many implementation details involved that an extension cannot possibly do it. So I gave up.
When I came back a few months later things improved, slightly. Somebody wrote an Add-on SDK module to create new Developer Tools panels. While I didn’t use that module directly, it showed nicely which parts of the API are contractual and which ones are merely implementation details. It also showed that things aren’t too bad if you limit yourself to a single target type — a local tab. Handling remote connections to browser and add-ons is more complicated, but as I mentioned above extensions cannot do that anyway.
Now that article stops at the point where you “merely” need to use the remote debugging protocol to communicate with the built-in debugging actor. Well, maybe it is really simple but I couldn’t figure out how to do this — and whether that protocol is something I can rely on. See, the built-in tools will certainly be adjusted when the debugging actor or/and the protocol change. My extension on the other hand will be broken, and I’ll need to invest time into figuring out what changed and how my code needs to be adjusted while staying compatible with older Firefox versions.
I guess to debug add-ons you could use manual remote debugging like you would for Thunderbird or SeaMonkey?
Sure. It’s merely impossible to integrate with Developer Tools, but one could always replicate their functionality in own code.