Startup JS debugging (sometimes) possible via Browser Toolbox

J. Ryan Stinnett jryans at
Wed Mar 8 19:09:10 UTC 2017

With bug 1275942 in Firefox 55, a new Firefox CLI option was added:

Example usage:

1. Add "debugger;" to top of browser/base/content/browser.js
2. $ ./mach run --jsdebugger --wait-for-jsdebugger
3. Browser Toolbox opens, pausing Firefox startup at the added line

This triggers Firefox to wait until the debugger connects, which makes it
possible to debug some Firefox startup JS code paths. (Some startup paths
might run before the DevTools command line handler, so for the moment they
won't pause. This could be improved in the future by moving the CLI handler
earlier in startup.)

(If you're wondering why an extra flag was added, this mode makes the
Browser Toolbox use a different default window in the Inspector, which
might confuse people if it was the default.)

Let me know if it's useful and / or you see room for improvement.

- Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the firefox-dev mailing list