зеркало из https://github.com/mozilla/gecko-dev.git
bug 1544393: remote: ship remote agent in Firefox Nightly r=remote-protocol-reviewers,whimboo,maja_zf
Now that the security review in bug 1542229 and the follow-up work that came out of it is complete, we should go ahead and flip the remote.enabled preference. This patch causes the remote agent to be available to users on the Firefox Nightly release channel. This meansusing --remote-debugger will no longer cause a fatal error Differential Revision: https://phabricator.services.mozilla.com/D55137 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
1f8d0692a0
Коммит
c0c59383f9
|
@ -4848,13 +4848,19 @@ pref("marionette.prefs.recommended", true);
|
|||
// https://bugzil.la/marionette-window-tracking
|
||||
pref("marionette.contentListener", false);
|
||||
|
||||
// Indicates whether the remote agent is enabled. If it is false, the remote
|
||||
// agent will not be loaded.
|
||||
pref("remote.enabled", false);
|
||||
#if defined(ENABLE_REMOTE_AGENT)
|
||||
// Indicates whether the remote agent is enabled.
|
||||
// If it is false, the remote agent will not be loaded.
|
||||
#if defined(NIGHTLY_BUILD)
|
||||
pref("remote.enabled", true);
|
||||
#else
|
||||
pref("remote.enabled", false);
|
||||
#endif
|
||||
|
||||
// Limits remote agent to listen on loopback devices, e.g. 127.0.0.1,
|
||||
// localhost, and ::1.
|
||||
pref("remote.force-local", true);
|
||||
// Limits remote agent to listen on loopback devices,
|
||||
// e.g. 127.0.0.1, localhost, and ::1.
|
||||
pref("remote.force-local", true);
|
||||
#endif
|
||||
|
||||
// Defines the verbosity of the internal logger.
|
||||
//
|
||||
|
|
|
@ -12,7 +12,6 @@ layer.
|
|||
|
||||
See https://firefox-source-docs.mozilla.org/remote/ for documentation.
|
||||
|
||||
The remote agent is disabled by default, but can be enabled by
|
||||
setting a preference before running it:
|
||||
It is available in Firefox Nightly and is started this way:
|
||||
|
||||
% ./mach run --setpref "remote.enabled=true" --remote-debugger
|
||||
% ./mach run --remote-debugger
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
Building
|
||||
========
|
||||
|
||||
The remote agent is included in the default Firefox build, but
|
||||
disabled by default. To expose the remote agent you can set the
|
||||
`remote.enabled` preference to true before running it:
|
||||
The remote agent is included in the default Firefox build, but only
|
||||
ships on the Firefox Nightly release channel:
|
||||
|
||||
% ./mach run --setpref="remote.enabled=true" --remote-debugger
|
||||
% ./mach run --remote-debugger
|
||||
|
||||
The source code is found under `$(topsrcdir)/remote`.
|
||||
The source code can be found under [remote/ in central].
|
||||
|
||||
There are two build modes to choose from:
|
||||
|
||||
Full build mode
|
||||
---------------
|
||||
|
@ -47,5 +48,6 @@ them, place this in your [mozconfig]:
|
|||
ac_add_options --enable-artifact-builds
|
||||
|
||||
|
||||
[remote/ in central]: https://searchfox.org/mozilla-central/source/remote
|
||||
[mozconfig]: ../build/buildsystem/mozconfigs.html
|
||||
[artifact builds]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds
|
||||
|
|
|
@ -10,7 +10,7 @@ To increase the internal logging verbosity you can use the
|
|||
|
||||
If you use mach to start Firefox:
|
||||
|
||||
./mach run --setpref "remote.enabled=true" --setpref "remote.log.level=Debug" --remote-debugger
|
||||
./mach run --setpref "remote.log.level=Debug" --remote-debugger
|
||||
|
||||
|
||||
Enabling logging of emitted events
|
||||
|
@ -20,7 +20,7 @@ To dump events produced by EventEmitter,
|
|||
including CDP events produced by the remote agent,
|
||||
you can use the `toolkit.dump.emit` [preference]:
|
||||
|
||||
./mach run --setpref "remote.enabled=true" --setpref "toolkit.dump.emit=true" --remote-debugger
|
||||
./mach run --setpref "toolkit.dump.emit=true" --remote-debugger
|
||||
|
||||
|
||||
Logging observer notifications
|
||||
|
|
|
@ -91,8 +91,9 @@ It is our assumption that if an attacker has shell access to the
|
|||
user account, there is little we can do to prevent secrets from
|
||||
being accessed or leaked.
|
||||
|
||||
The preference `remote.enabled` defaults to false in Nightly, and
|
||||
it is the purpose to flip this to true to ship the remote agent for
|
||||
Firefox Nightly users following [a security review].
|
||||
The preference `remote.enabled` is true on the Firefox Nightly
|
||||
release channel. The [security review] was completed in November
|
||||
2019.
|
||||
|
||||
[a security review]: https://bugzilla.mozilla.org/show_bug.cgi?id=1542229
|
||||
|
||||
[security review]: https://bugzilla.mozilla.org/show_bug.cgi?id=1542229
|
||||
|
|
|
@ -14,9 +14,7 @@ three different programs/components running simultaneously:
|
|||
|
||||
* and the __target__, which is the web document being debugging.
|
||||
|
||||
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.
|
||||
The remote agent ships in [Firefox Nightly] only.
|
||||
|
||||
To check if your Firefox binary has the remote agent enabled, you
|
||||
can look in its help message for this:
|
||||
|
@ -29,6 +27,13 @@ can look in its help message for this:
|
|||
Defaults to listen on localhost:9222.
|
||||
…
|
||||
|
||||
When used, the remote agent will start an HTTP server and print a
|
||||
message on stderr with the location of the main target’s WebSocket
|
||||
listener:
|
||||
|
||||
% firefox --remote-debugger
|
||||
DevTools listening on ws://localhost:9222/devtools/browser/7b4e84a4-597f-4839-ac6d-c9e86d16fb83
|
||||
|
||||
As you will tell from the flag description, `--remote-debugger`
|
||||
takes an optional address spec as input:
|
||||
|
||||
|
@ -65,4 +70,3 @@ system configuration, but is always guaranteed to be free thus
|
|||
eliminating the risk of binding to a port that is already in use.
|
||||
|
||||
[Firefox Nightly]: https://www.mozilla.org/en-GB/firefox/channel/desktop/#nightly
|
||||
[`remote.enabled` preference]: ./Prefs.html
|
||||
|
|
|
@ -1,19 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* nodejs script to test basic CDP behaviors against Firefox and Chromium.
|
||||
*
|
||||
* Install chrome-remote-interface, the npm package for a CDP client in node:
|
||||
* $ npm install chrome-remote-interface
|
||||
*
|
||||
* Run Firefox or Chromium with server turned on:
|
||||
* $ ./mach run --setpref "remote.enabled=true" --remote-debugging-port 9222
|
||||
* $ firefox --remote-debugging-port 9222
|
||||
* $ chromium-browser --remote-debugging-port=9222
|
||||
*
|
||||
* Run this script:
|
||||
* $ node demo.js
|
||||
*/
|
||||
// Node.js script to test basic CDP behaviors against Firefox and Chromium.
|
||||
//
|
||||
// Install chrome-remote-interface, the npm package for a CDP client in node:
|
||||
//
|
||||
// % npm install chrome-remote-interface
|
||||
//
|
||||
// Run Firefox or Chromium with server turned on:
|
||||
//
|
||||
// % ./mach run --remote-debugging-port 9222
|
||||
// % firefox --remote-debugging-port 9222
|
||||
// % chromium-browser --remote-debugging-port=9222
|
||||
//
|
||||
// Then run this script:
|
||||
//
|
||||
// % node demo.js
|
||||
|
||||
const CDP = require("chrome-remote-interface");
|
||||
|
||||
async function demo() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче