From d546c8341cffc2655f714bd6b846e703848f2b33 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Mon, 17 May 2021 20:20:15 +0000 Subject: [PATCH] Bug 1710839 - [remote] Remove remote.enabled preference. r=remote-protocol-reviewers,Gijs,jdescottes Differential Revision: https://phabricator.services.mozilla.com/D115239 --- modules/libpref/init/all.js | 4 ---- remote/cdp/test/browser/browser.ini | 2 -- remote/cdp/test/browser/component/browser.ini | 2 -- remote/cdp/test/browser/component/browser_agent.js | 12 ------------ remote/cdp/test/browser/dom/browser.ini | 2 -- remote/cdp/test/browser/emulation/browser.ini | 2 -- remote/cdp/test/browser/input/browser.ini | 2 -- remote/cdp/test/browser/io/browser.ini | 2 -- remote/cdp/test/browser/log/browser.ini | 2 -- remote/cdp/test/browser/network/browser.ini | 2 -- remote/cdp/test/browser/page/browser.ini | 2 -- remote/cdp/test/browser/runtime/browser.ini | 2 -- remote/cdp/test/browser/security/browser.ini | 2 -- remote/cdp/test/browser/target/browser.ini | 2 -- remote/components/RemoteAgent.jsm | 7 ------- remote/components/nsIRemoteAgent.idl | 2 -- remote/doc/Prefs.md | 8 -------- remote/doc/Security.md | 11 ++--------- remote/doc/Usage.md | 2 +- remote/test/puppeteer/src/node/Launcher.ts | 4 ++-- toolkit/modules/Troubleshoot.jsm | 1 - 21 files changed, 5 insertions(+), 70 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 3eb39dc409fc..268c49152d32 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4484,10 +4484,6 @@ pref("marionette.port", 2828); pref("marionette.prefs.recommended", true); #if defined(ENABLE_REMOTE_AGENT) - // Indicates whether the remote agent is enabled. - // If it is false, the remote agent will not be loaded. - pref("remote.enabled", true); - // Limits remote agent to listen on loopback devices, // e.g. 127.0.0.1, localhost, and ::1. pref("remote.force-local", true); diff --git a/remote/cdp/test/browser/browser.ini b/remote/cdp/test/browser/browser.ini index e272d064b2dd..01875303c7f2 100644 --- a/remote/cdp/test/browser/browser.ini +++ b/remote/cdp/test/browser/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = chrome-remote-interface.js head.js diff --git a/remote/cdp/test/browser/component/browser.ini b/remote/cdp/test/browser/component/browser.ini index 43c02046492f..bc060fe90f73 100644 --- a/remote/cdp/test/browser/component/browser.ini +++ b/remote/cdp/test/browser/component/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/component/browser_agent.js b/remote/cdp/test/browser/component/browser_agent.js index 468cb4291332..612adb040aa2 100644 --- a/remote/cdp/test/browser/component/browser_agent.js +++ b/remote/cdp/test/browser/component/browser_agent.js @@ -22,7 +22,6 @@ function add_agent_task(originalTask) { await RemoteAgent.close(); await originalTask(); } finally { - Preferences.reset("remote.enabled"); Preferences.reset("remote.force-local"); } }; @@ -74,17 +73,6 @@ add_agent_task(async function listen() { ); }); -add_agent_task(async function listenWhenDisabled() { - Preferences.set("remote.enabled", false); - try { - await RemoteAgent.listen(URL); - fail("listen() did not return exception"); - } catch (e) { - is(e.result, Cr.NS_ERROR_NOT_AVAILABLE); - is(e.message, "Disabled by preference"); - } -}); - // TODO(ato): https://bugzil.la/1590829 add_agent_task(async function listenTakesString() { await RemoteAgent.listen("http://localhost:0"); diff --git a/remote/cdp/test/browser/dom/browser.ini b/remote/cdp/test/browser/dom/browser.ini index d2e5401b39f3..2cc6c11f7d7f 100644 --- a/remote/cdp/test/browser/dom/browser.ini +++ b/remote/cdp/test/browser/dom/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/emulation/browser.ini b/remote/cdp/test/browser/emulation/browser.ini index 1f9123b69c6f..c97ae2ade59b 100644 --- a/remote/cdp/test/browser/emulation/browser.ini +++ b/remote/cdp/test/browser/emulation/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/input/browser.ini b/remote/cdp/test/browser/input/browser.ini index 865e5a7c15f2..1399c5aae5cc 100644 --- a/remote/cdp/test/browser/input/browser.ini +++ b/remote/cdp/test/browser/input/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/io/browser.ini b/remote/cdp/test/browser/io/browser.ini index 8c42a538b640..e9e0bc65446c 100644 --- a/remote/cdp/test/browser/io/browser.ini +++ b/remote/cdp/test/browser/io/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/log/browser.ini b/remote/cdp/test/browser/log/browser.ini index bea7aaba6a90..c8d95fbf1ffc 100644 --- a/remote/cdp/test/browser/log/browser.ini +++ b/remote/cdp/test/browser/log/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/network/browser.ini b/remote/cdp/test/browser/network/browser.ini index abe20e36aae9..ef2f63c68c84 100644 --- a/remote/cdp/test/browser/network/browser.ini +++ b/remote/cdp/test/browser/network/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/page/browser.ini b/remote/cdp/test/browser/page/browser.ini index 972cb41d5617..946e6278142d 100644 --- a/remote/cdp/test/browser/page/browser.ini +++ b/remote/cdp/test/browser/page/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/runtime/browser.ini b/remote/cdp/test/browser/runtime/browser.ini index 9b981e8796ea..7ec608553390 100644 --- a/remote/cdp/test/browser/runtime/browser.ini +++ b/remote/cdp/test/browser/runtime/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/security/browser.ini b/remote/cdp/test/browser/security/browser.ini index 611984ce56c8..52c17660cc22 100644 --- a/remote/cdp/test/browser/security/browser.ini +++ b/remote/cdp/test/browser/security/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/cdp/test/browser/target/browser.ini b/remote/cdp/test/browser/target/browser.ini index 564272d00b43..605ed3c1613d 100644 --- a/remote/cdp/test/browser/target/browser.ini +++ b/remote/cdp/test/browser/target/browser.ini @@ -1,8 +1,6 @@ [DEFAULT] tags = remote subsuite = remote -prefs = - remote.enabled=true support-files = !/remote/cdp/test/browser/chrome-remote-interface.js !/remote/cdp/test/browser/head.js diff --git a/remote/components/RemoteAgent.jsm b/remote/components/RemoteAgent.jsm index 7d1c4501b9a0..fd43324c3534 100644 --- a/remote/components/RemoteAgent.jsm +++ b/remote/components/RemoteAgent.jsm @@ -23,7 +23,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get()); -const ENABLED = "remote.enabled"; const FORCE_LOCAL = "remote.force-local"; const LOOPBACKS = ["localhost", "127.0.0.1", "[::1]"]; @@ -46,12 +45,6 @@ class RemoteAgentClass { } listen(url) { - if (!Preferences.get(ENABLED, false)) { - throw Components.Exception( - "Disabled by preference", - Cr.NS_ERROR_NOT_AVAILABLE - ); - } if (Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) { throw Components.Exception( "May only be instantiated in parent process", diff --git a/remote/components/nsIRemoteAgent.idl b/remote/components/nsIRemoteAgent.idl index a71275dce43e..935d46663b60 100644 --- a/remote/components/nsIRemoteAgent.idl +++ b/remote/components/nsIRemoteAgent.idl @@ -42,8 +42,6 @@ interface nsIRemoteAgent : nsISupports * A "remote-listening" system observer notification with the URL * of the main target's WebSocket will be emitted once listening. * - * @throws NS_ERROR_NOT_AVAILABLE - * When disabled by the remote.enabled preference. * @throws NS_ERROR_LAUNCHED_CHILD_PROCESS * When called from a child process. * @throws NS_ERROR_ILLEGAL_VALUE diff --git a/remote/doc/Prefs.md b/remote/doc/Prefs.md index 44b29b37e287..47db9b197989 100644 --- a/remote/doc/Prefs.md +++ b/remote/doc/Prefs.md @@ -7,14 +7,6 @@ There are a couple of preferences associated with the remote agent: Configurable preferences ------------------------ -### `remote.enabled` - -Indicates whether the remote agent is enabled. When the remote -agent is enabled, it exposes a [`--remote-debugging-port` flag] for Firefox. -When set to false, the remote agent will not be loaded on startup. - -[`--remote-debugging` flag]: Usage.html - ### `remote.force-local` Limits the remote agent to be allowed to listen on loopback devices, diff --git a/remote/doc/Security.md b/remote/doc/Security.md index 6f95ac946342..79b210419e18 100644 --- a/remote/doc/Security.md +++ b/remote/doc/Security.md @@ -25,12 +25,6 @@ flag. Connections are by default restricted to loopback devices (such as localhost and 127.0.0.1), but this can be overridden with the `remote.force-local` preference. -The feature as a whole is guarded behind the `remote.enabled` -preference. This preference serves as a way to gate the remote -agent component through release channels, and potentially for -remotely disabling the remote agent through Normandy if the need -should arise. - Since the remote agent is not an in-document web feature, the security concerns we have for this feature are essentially different to other web platform features. The primary concern is that the @@ -91,9 +85,8 @@ 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` is true on the Firefox Nightly -release channel. The [security review] was completed in November -2019. +The remote agent is available on all release channels. +The [security review] was completed in November 2019. [security review]: https://bugzilla.mozilla.org/show_bug.cgi?id=1542229 diff --git a/remote/doc/Usage.md b/remote/doc/Usage.md index f93f4cd858d8..d9741244475a 100644 --- a/remote/doc/Usage.md +++ b/remote/doc/Usage.md @@ -14,7 +14,7 @@ three different programs/components running simultaneously: * and the __target__, which is the web document being debugging. -The remote agent ships in [Firefox Nightly] only. +Since Firefox 86 the remote agent ships in all Firefox releases by default. To check if your Firefox binary has the remote agent enabled, you can look in its help message for this: diff --git a/remote/test/puppeteer/src/node/Launcher.ts b/remote/test/puppeteer/src/node/Launcher.ts index 92d16d9cd25f..c99393fe3773 100644 --- a/remote/test/puppeteer/src/node/Launcher.ts +++ b/remote/test/puppeteer/src/node/Launcher.ts @@ -530,8 +530,8 @@ class FirefoxLauncher implements ProductLauncher { 'privacy.trackingprotection.enabled': false, - // Enable Remote Agent - // https://bugzilla.mozilla.org/show_bug.cgi?id=1544393 + // Can be removed once Firefox 89 is no longer supported + // https://bugzilla.mozilla.org/show_bug.cgi?id=1710839 'remote.enabled': true, // Don't do network connections for mitm priming diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index 8be0f9650a37..3a96aa466b0d 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -88,7 +88,6 @@ const PREFS_WHITELIST = [ "plugin.", "plugins.", "privacy.", - "remote.enabled", "security.", "services.sync.declinedEngines", "services.sync.lastPing",