Bug 1428922 - Implement popups policy. r=mystor draft
authorFelipe Gomes <felipc@gmail.com>
Fri, 12 Jan 2018 19:54:46 -0200
changeset 719901 b30a49459b8d1ac76045057ba205c68ffb6e0785
parent 719900 cc60a9dc0a9230a2346fb8036093ab97a77d3b8c
child 719902 7793154b0e6bcbfd0da971291f5c12c1a4eac863
push id95389
push userfelipc@gmail.com
push dateFri, 12 Jan 2018 21:55:40 +0000
reviewersmystor
bugs1428922
milestone59.0a1
Bug 1428922 - Implement popups policy. r=mystor MozReview-Commit-ID: IoBa82aAnJN
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies.json
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -64,16 +64,22 @@ this.Policies = {
     }
   },
 
   "flash_plugin": {
     onBeforeUIStartup(manager, param) {
       PermissionPolicies.addAllowDenyPermissions("plugin:flash", param.allow, param.block);
     }
   },
+
+  "popups": {
+    onBeforeUIStartup(manager, param) {
+      PermissionPolicies.addAllowDenyPermissions("popup", param.allow, param.block);
+    }
+  },
 };
 
 function validateAndParseParamRecursive(param, properties) {
   if (properties.enum) {
     if (properties.enum.includes(param)) {
       return [true, param];
     }
     return [false, null];
--- a/browser/components/enterprisepolicies/schemas/policies.json
+++ b/browser/components/enterprisepolicies/schemas/policies.json
@@ -44,11 +44,33 @@
 
         "block": {
           "type": "array",
           "items": {
             "type": "origin"
           }
         }
       }
+    },
+
+    "popups": {
+      "description": "Allow or deny popup usage.",
+      "first_available": "60.0",
+
+      "type": "object",
+      "properties": {
+        "allow": {
+          "type": "array",
+          "items": {
+            "type": "origin"
+          }
+        },
+
+        "block": {
+          "type": "array",
+          "items": {
+            "type": "origin"
+          }
+        }
+      }
     }
   }
 }