"Fossies" - the Fresh Open Source Software Archive

Member "firefox-69.0.1/remote/doc/Usage.md" (17 Sep 2019, 2589 Bytes) of package /linux/www/firefox-69.0.1.source.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the last Fossies "Diffs" side-by-side code changes report for "Usage.md": 67.0.4_vs_68.0.

Usage

When using the CDP-based remote debugger in Firefox, there are three different programs/components running simultaneously:

The remote agent currently only ships with builds of Firefox Nightly and is not enabled by default. To enable it, you must flip the remote.enabled preference to true.

To check if your Firefox binary has the remote agent enabled, you can look in its help message for this:

% ./firefox -h
…
  --remote-debugging-port <port>
  --remote-debugger [<host>][:<port>] Start the Firefox remote agent, which is
                     a low-level debugging interface based on the CDP protocol.
                     Defaults to listen on localhost:9222.
…

As you will tell from the flag description, --remote-debugger takes an optional address spec as input:

[<host>][:<port>]

You can use this to instruct the remote agent to bind to a particular interface and port on your system. Either host and port are optional, which means ./firefox --remote-debugger will bind the HTTPD to the default localhost:9222.

Other examples of address specs include:

localhost:9222
127.0.0.1:9999
[::1]:4567
:0

The use of localhost in the first example above will, depending on whether the system supports IPv6, bind to both IP layers and accept incoming connections from either IPv4 or IPv6. The second (127.0.0.1) and third ([::1]) examples will, respecitvely, force the HTTP to listen on IPv4 or IPv6.

The fourth example will use the default hostname, localhost, to listen on all available IP layers, but override the default port with the special purpose port 0. When you ask the remote agent to listen on port 0, the system will atomically allocate an arbitrary free port.

Allocating an atomic port can be useful if you want to avoid race conditions. The atomically allocated port will be somewhere in the ephemeral port range, which varies depending on your system and system configuration, but is always guaranteed to be free thus eliminating the risk of binding to a port that is already in use.