Bug 1523810 - Add a policy for disabling captive portal support. r=Felipe,flod
authorMichael Kaply <mozilla@kaply.com>
Wed, 30 Jan 2019 23:04:59 +0000
changeset 456171 cc64eb2ebb920c6ed9d28a09211f817697053293
parent 456170 4fe736c383665068554d179e38f87fef3935985f
child 456172 7e275859021304429a08ed48ec3700b10f4283df
push id77155
push usermozilla@kaply.com
push dateWed, 30 Jan 2019 23:05:45 +0000
treeherderautoland@cc64eb2ebb92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, flod
bugs1523810
milestone67.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 1523810 - Add a policy for disabling captive portal support. r=Felipe,flod Differential Revision: https://phabricator.services.mozilla.com/D18007
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies-schema.json
browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
browser/locales/en-US/browser/policies/policies-descriptions.ftl
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -128,16 +128,22 @@ var Policies = {
   },
 
   "Bookmarks": {
     onAllWindowsRestored(manager, param) {
       BookmarksPolicies.processBookmarks(param);
     },
   },
 
+  "CaptivePortal": {
+    onBeforeAddons(manager, param) {
+      setAndLockPref("network.captive-portal-service.enabled", param);
+    },
+  },
+
   "Certificates": {
     onBeforeAddons(manager, param) {
       if ("ImportEnterpriseRoots" in param) {
         setAndLockPref("security.enterprise_roots.enabled", param.ImportEnterpriseRoots);
       }
       if ("Install" in param) {
         (async () => {
           let dirs = [];
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -83,16 +83,20 @@
           "Folder": {
             "type": "string"
           }
         },
         "required": ["Title", "URL"]
       }
     },
 
+    "CaptivePortal": {
+      "type": "boolean"
+    },
+
     "Certificates": {
       "type": "object",
       "properties": {
         "ImportEnterpriseRoots": {
           "type": "boolean"
         },
         "Install": {
           "type": "array",
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
@@ -219,16 +219,26 @@ const POLICIES_TESTS = [
       "SSLVersionMin": "tls1.2",
       "SSLVersionMax": "tls1.3",
     },
     lockedPrefs: {
       "security.tls.version.min": 3,
       "security.tls.version.max": 4,
     },
   },
+
+  // POLICY: CaptivePortal
+  {
+    policies: {
+      "CaptivePortal": false,
+    },
+    lockedPrefs: {
+      "network.captive-portal-service.enabled": false,
+    },
+  },
 ];
 
 add_task(async function test_policy_remember_passwords() {
   for (let test of POLICIES_TESTS) {
     await setupPolicyEngineWithJson({
       "policies": test.policies,
     });
 
--- a/browser/locales/en-US/browser/policies/policies-descriptions.ftl
+++ b/browser/locales/en-US/browser/policies/policies-descriptions.ftl
@@ -18,16 +18,18 @@ policy-BlockAboutAddons = Block access t
 policy-BlockAboutConfig = Block access to the about:config page.
 
 policy-BlockAboutProfiles = Block access to the about:profiles page.
 
 policy-BlockAboutSupport = Block access to the about:support page.
 
 policy-Bookmarks = Create bookmarks in the Bookmarks toolbar, Bookmarks menu, or a specified folder inside them.
 
+policy-CaptivePortal = Enable or disable captive portal support.
+
 policy-CertificatesDescription = Add certificates or use built-in certificates.
 
 policy-Cookies = Allow or deny websites to set cookies.
 
 policy-DisableAppUpdate = Prevent the browser from updating.
 
 policy-DisableBuiltinPDFViewer = Disable PDF.js, the built-in PDF viewer in { -brand-short-name }.