Bug 1157893 - Create a toggle for developer mode r=ochameau
authorFabrice Desré <fabrice@mozilla.com>
Tue, 28 Apr 2015 10:28:36 -0700
changeset 241625 3b6bb80509fa218b37c915feb5b8cc6f22360e0e
parent 241624 6cab636900752111f8507653e916ce38a93023e1
child 241626 3281169aa40ae68c4c2012bf0e2a74dd804a9f12
push id59184
push userkwierso@gmail.com
push dateWed, 29 Apr 2015 23:54:41 +0000
treeherdermozilla-inbound@4b9b12c248dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1157893
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1157893 - Create a toggle for developer mode r=ochameau
b2g/components/ProcessGlobal.js
browser/devtools/webide/content/runtimedetails.js
--- a/b2g/components/ProcessGlobal.js
+++ b/b2g/components/ProcessGlobal.js
@@ -99,16 +99,19 @@ ProcessGlobal.prototype = {
     lines.forEach((line) => {
       log(line);
       let params = line.split(" ");
       if (params[0] == "wipe") {
         this.wipeDir(params[1]);
       } else if (params[0] == "root") {
         log("unrestrict devtools");
         Services.prefs.setBoolPref("devtools.debugger.forbid-certified-apps", false);
+        Services.prefs.setBoolPref("dom.apps.developer_mode", true);
+        // TODO: Remove once bug 1125916 is fixed.
+        Services.prefs.setBoolPref("network.disable.ipc.security", true);
         let lock = settings.createLock();
         lock.set("developer.menu.enabled", true, null);
       }
     });
   },
 
   cleanupAfterFactoryReset: function() {
     log("cleanupAfterWipe start");
--- a/browser/devtools/webide/content/runtimedetails.js
+++ b/browser/devtools/webide/content/runtimedetails.js
@@ -130,20 +130,23 @@ function CheckLockState() {
     }
 
   }
 
 }
 
 function EnableCertApps() {
   let 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 && " +
     "start b2g"
   );
 }
 
 function RootADB() {
   let device = AppManager.selectedRuntime.device;
   device.summonRoot().then(CheckLockState, (e) => console.error(e));
 }