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 295069 9951ff11def92c3c27c3465ff7f12fd0cf726e5a
parent 295068 9f20432c24bcf0099b70d005830385c947a7834e
child 295070 980951a8a5e27bb74a906ce255c9a2530a965ac2
push id5628
push usermozilla@noorenberghe.ca
push dateMon, 21 Sep 2015 23:09:25 +0000
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) {