diff --git a/devtools/client/locales/en-US/webide.dtd b/devtools/client/locales/en-US/webide.dtd index 106823b5f5bb..7bdf151b6ad8 100644 --- a/devtools/client/locales/en-US/webide.dtd +++ b/devtools/client/locales/en-US/webide.dtd @@ -118,12 +118,6 @@ - - - - - - diff --git a/devtools/client/webide/content/runtimedetails.js b/devtools/client/webide/content/runtimedetails.js index 93082b2f2c87..5f7af1de68cd 100644 --- a/devtools/client/webide/content/runtimedetails.js +++ b/devtools/client/webide/content/runtimedetails.js @@ -3,24 +3,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const {require} = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {}); -const Services = require("Services"); const {AppManager} = require("devtools/client/webide/modules/app-manager"); const {Connection} = require("devtools/shared/client/connection-manager"); -const {RuntimeTypes} = require("devtools/client/webide/modules/runtime-types"); -const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties"); - -const UNRESTRICTED_HELP_URL = "https://developer.mozilla.org/docs/Tools/WebIDE/Running_and_debugging_apps#Unrestricted_app_debugging_%28including_certified_apps_main_process_etc.%29"; window.addEventListener("load", function() { document.querySelector("#close").onclick = CloseUI; - document.querySelector("#devtools-check button").onclick = EnableCertApps; - document.querySelector("#adb-check button").onclick = RootADB; - document.querySelector("#unrestricted-privileges").onclick = function() { - window.parent.UI.openInBrowser(UNRESTRICTED_HELP_URL); - }; AppManager.on("app-manager-update", OnAppManagerUpdate); BuildUI(); - CheckLockState(); }, {capture: true, once: true}); window.addEventListener("unload", function() { @@ -34,7 +23,6 @@ function CloseUI() { function OnAppManagerUpdate(what) { if (what == "connection" || what == "runtime-global-actors") { BuildUI(); - CheckLockState(); } } @@ -67,79 +55,3 @@ function BuildUI() { CloseUI(); } } - -function CheckLockState() { - const adbCheckResult = document.querySelector("#adb-check > .yesno"); - const devtoolsCheckResult = document.querySelector("#devtools-check > .yesno"); - const flipCertPerfButton = document.querySelector("#devtools-check button"); - const flipCertPerfAction = document.querySelector("#devtools-check > .action"); - const adbRootAction = document.querySelector("#adb-check > .action"); - - const sYes = Strings.GetStringFromName("runtimedetails_checkyes"); - const sNo = Strings.GetStringFromName("runtimedetails_checkno"); - const sNotUSB = Strings.GetStringFromName("runtimedetails_notUSBDevice"); - - flipCertPerfButton.setAttribute("disabled", "true"); - flipCertPerfAction.setAttribute("hidden", "true"); - adbRootAction.setAttribute("hidden", "true"); - - adbCheckResult.textContent = ""; - devtoolsCheckResult.textContent = ""; - - if (AppManager.connection && - AppManager.connection.status == Connection.Status.CONNECTED) { - // ADB check - if (AppManager.selectedRuntime.type === RuntimeTypes.USB) { - const device = AppManager.selectedRuntime.device; - if (device && device.summonRoot) { - device.isRoot().then(isRoot => { - if (isRoot) { - adbCheckResult.textContent = sYes; - flipCertPerfButton.removeAttribute("disabled"); - } else { - adbCheckResult.textContent = sNo; - adbRootAction.removeAttribute("hidden"); - } - }, console.error); - } - } else { - adbCheckResult.textContent = sNotUSB; - } - - // forbid-certified-apps check - try { - const prefFront = AppManager.preferenceFront; - prefFront.getBoolPref("devtools.debugger.forbid-certified-apps").then(isForbidden => { - if (isForbidden) { - devtoolsCheckResult.textContent = sNo; - flipCertPerfAction.removeAttribute("hidden"); - } else { - devtoolsCheckResult.textContent = sYes; - } - }, console.error); - } catch (e) { - // Exception. pref actor is only accessible if forbird-certified-apps is false - devtoolsCheckResult.textContent = sNo; - flipCertPerfAction.removeAttribute("hidden"); - } - } -} - -function EnableCertApps() { - const device = AppManager.selectedRuntime.device; - // TODO: Remove `network.disable.ipc.security` once bug 1125916 is fixed. - device.shell( - "stop b2g && " + - "cd /data/b2g/mozilla/*.default/ && " + - "echo 'user_pref(\"devtools.debugger.forbid-certified-apps\", false);' >> prefs.js && " + - "echo 'user_pref(\"dom.apps.developer_mode\", true);' >> prefs.js && " + - "echo 'user_pref(\"network.disable.ipc.security\", true);' >> prefs.js && " + - "echo 'user_pref(\"dom.webcomponents.shadowdom.enabled\", true);' >> prefs.js && " + - "start b2g" - ); -} - -function RootADB() { - const device = AppManager.selectedRuntime.device; - device.summonRoot().then(CheckLockState, console.error); -} diff --git a/devtools/client/webide/content/runtimedetails.xhtml b/devtools/client/webide/content/runtimedetails.xhtml index 41ee15f8b884..fecc59f9ef6f 100644 --- a/devtools/client/webide/content/runtimedetails.xhtml +++ b/devtools/client/webide/content/runtimedetails.xhtml @@ -24,23 +24,6 @@

&runtimedetails_title;

-
-

- &runtimedetails_adbIsRoot; -

- - &runtimedetails_ADBRootWarning; -
-

-

- &runtimedetails_unrestrictedPrivileges; -

- - &runtimedetails_privilegesWarning; -
-

-
-
diff --git a/devtools/client/webide/themes/runtimedetails.css b/devtools/client/webide/themes/runtimedetails.css index 91ced5bff9f9..cac9c1917358 100644 --- a/devtools/client/webide/themes/runtimedetails.css +++ b/devtools/client/webide/themes/runtimedetails.css @@ -5,21 +5,3 @@ html, body { background: white; } - -#devicePrivileges { - font-family: monospace; - padding-left: 6px; -} - -#devtools-check > a { - color: #4C9ED9; - cursor: pointer; -} - -.action { - display: inline; -} - -.action[hidden] { - display: none; -} diff --git a/devtools/server/tests/mochitest/test_preference.html b/devtools/server/tests/mochitest/test_preference.html index a4089efeec21..8681fa01757f 100644 --- a/devtools/server/tests/mochitest/test_preference.html +++ b/devtools/server/tests/mochitest/test_preference.html @@ -102,7 +102,6 @@ function runTests() { window.onload = function() { SpecialPowers.pushPrefEnv({ "set": [ - ["devtools.debugger.forbid-certified-apps", false], ["test.all.bool", true], ["test.all.int", 0x4321], ["test.all.string", "allizom"], diff --git a/devtools/server/tests/unit/test_actor-registry-actor.js b/devtools/server/tests/unit/test_actor-registry-actor.js index c1160a8b08bd..e893cb230103 100644 --- a/devtools/server/tests/unit/test_actor-registry-actor.js +++ b/devtools/server/tests/unit/test_actor-registry-actor.js @@ -10,11 +10,8 @@ var gClient; var gRegistryFront; var gActorFront; -var gOldPref; function run_test() { - gOldPref = Services.prefs.getBoolPref("devtools.debugger.forbid-certified-apps"); - Services.prefs.setBoolPref("devtools.debugger.forbid-certified-apps", false); initTestDebuggerServer(); DebuggerServer.registerAllActors(); gClient = new DebuggerClient(DebuggerServer.connectPipe()); @@ -71,7 +68,6 @@ function testActorIsUnregistered() { gClient.listTabs().then(({ helloActor }) => { Assert.ok(!helloActor); - Services.prefs.setBoolPref("devtools.debugger.forbid-certified-apps", gOldPref); finishClient(gClient); }); } diff --git a/devtools/shared/preferences/devtools-shared.js b/devtools/shared/preferences/devtools-shared.js index 7e75b07a17ca..7c47f98fa223 100644 --- a/devtools/shared/preferences/devtools-shared.js +++ b/devtools/shared/preferences/devtools-shared.js @@ -37,8 +37,6 @@ pref("devtools.debugger.remote-port", 6000); pref("devtools.debugger.remote-websocket", false); // Force debugger server binding on the loopback interface pref("devtools.debugger.force-local", true); -// Block tools from seeing / interacting with certified apps -pref("devtools.debugger.forbid-certified-apps", true); // Limit for intercepted response bodies (1 MB) // Possible values: