Bug 1199177 - Restricted profiles: Reset add-on preferences if restriction is not enabled. r=margaret, a=sylvestre
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 16 Sep 2015 13:23:30 +0200
changeset 289320 9951ff11def92c3c27c3465ff7f12fd0cf726e5a
parent 289319 9f20432c24bcf0099b70d005830385c947a7834e
child 289321 980951a8a5e27bb74a906ce255c9a2530a965ac2
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, sylvestre
bugs1199177
milestone42.0a2
Bug 1199177 - Restricted profiles: Reset add-on preferences if restriction is not enabled. r=margaret, a=sylvestre
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -556,16 +556,20 @@ var BrowserApp = {
       this.onAppUpdated();
     }
 
     if (!ParentalControls.isAllowed(ParentalControls.INSTALL_EXTENSION)) {
       // Disable extension installs
       Services.prefs.setIntPref("extensions.enabledScopes", 1);
       Services.prefs.setIntPref("extensions.autoDisableScopes", 1);
       Services.prefs.setBoolPref("xpinstall.enabled", false);
+    } else if (ParentalControls.parentalControlsEnabled) {
+      Services.prefs.clearUserPref("extensions.enabledScopes");
+      Services.prefs.clearUserPref("extensions.autoDisableScopes");
+      Services.prefs.setBoolPref("xpinstall.enabled", true);
     }
 
     try {
       // Set the tiles click observer only if tiles reporting is enabled (that
       // is, a report URL is set in prefs).
       gTilesReportURL = Services.prefs.getCharPref("browser.tiles.reportURL");
       Services.obs.addObserver(this, "Tiles:Click", false);
     } catch (e) {