Skip to content

LibDevTools: Support launching Firefox devtools directly from Ladybird#10707

Open
trflynn89 wants to merge 7 commits into
LadybirdBrowser:masterfrom
trflynn89:devtools_client2
Open

LibDevTools: Support launching Firefox devtools directly from Ladybird#10707
trflynn89 wants to merge 7 commits into
LadybirdBrowser:masterfrom
trflynn89:devtools_client2

Conversation

@trflynn89

Copy link
Copy Markdown
Contributor

We previously would have to start the devtools server in Ladybird and manually open about:debugging in Firefox to connect to the server, then pick which tab to inspect. We can now detect an already-installed Firefox instance and launch the devtools client directly through that. To do so, we create a Ladybird-owned Firefox profile with specific prefs and CSS to enable immediate communication with Ladybird.

devtools.webm

@trflynn89
trflynn89 force-pushed the devtools_client2 branch 2 times, most recently from acd45ce to c11ec6e Compare July 15, 2026 20:06
TabActors are currently only registered when the client requests the
tab list, which about:debugging always does before opening a toolbox.
A toolbox connecting directly to a known tab (about:devtools-toolbox
with host, port, and tab id query parameters) issues getTab as its
first request, on a fresh connection where no TabActor exists yet.
The response then had no tab entry, and the client failed with:

    TypeError: can't access property "actor", v is undefined

Look up the tab in the delegate's tab list and register its actor on
demand, as the listTabs handler does.
LibDevTools only supports one active client. It previously checked for
one before accepting a waiting client, leaving that client in the listen
backlog. The accept notifier would then fire in a busy loop and starve
the active connection's event processing.

Accept every client first and immediately close it if another connection
is active. This drains the listen backlog while preserving the
single-client contract.
Locate Firefox installations on each supported desktop platforms.
Generate a Ladybird-owned profile that pre-seeds the DevTools network
location, then launch Firefox into about:devtools-toolbox without
modifying its installation.
Own one stock Firefox client process at the application level. Launch it
with the active DevTools server port and terminate it when the server is
disabled.
Launch the application-owned Firefox client from the DevTools banner and
report discovery or startup errors through the existing error dialog.
Extend the shared info bar with an action button that launches the
application-owned Firefox client. Report discovery or startup errors
through the existing error dialog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant