Bug 1591791 - Port |Bug 1584809 - PageInfo cookie permissions default to allow| to SeaMonkey. r=frg DONTBUILD
authorIan Neal <iann_cvs@blueyonder.co.uk>
Mon, 11 Nov 2019 20:39:32 +0100
changeset 37473 f1b5416c152bc6c0b457a661f78cbed98e3b3158
parent 37472 cb0db83a425334700b93709ab7d735755e3595b0
child 37474 c7d09e547b0f2e0c978473556e23d8e8ad476ee4
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersfrg
bugs1591791, 1584809
Bug 1591791 - Port |Bug 1584809 - PageInfo cookie permissions default to allow| to SeaMonkey. r=frg DONTBUILD
suite/browser/pageinfo/permissions.js
--- a/suite/browser/pageinfo/permissions.js
+++ b/suite/browser/pageinfo/permissions.js
@@ -188,18 +188,22 @@ function onCheckboxClick(aPartId)
     onRadioClick(aPartId);
     command.removeAttribute("disabled");
   }
 }
 
 function onRadioClick(aPartId)
 {
   var radioGroup = document.getElementById(aPartId + "RadioGroup");
-  var id = radioGroup.selectedItem ? radioGroup.selectedItem.id : "#1";
-  var permission = parseInt(id.split("#")[1]);
+  let permission;
+  if (radioGroup.selectedItem) {
+    permission = parseInt(radioGroup.selectedItem.id.split("#")[1]);
+  } else {
+    permission = SitePermissions.getDefault(aPartId);
+  }
   SitePermissions.setForPrincipal(gPermPrincipal, aPartId, permission);
 }
 
 function setRadioState(aPartId, aValue)
 {
   var radio = document.getElementById(aPartId + "#" + aValue);
   if (radio) {
     radio.radioGroup.selectedItem = radio;