Bug 1591791 - Port |Bug 1584809 - PageInfo cookie permissions default to allow| to SeaMonkey. r=frg a=frg DONTBUILD CLOSED TREE
authorIan Neal <iann_cvs@blueyonder.co.uk>
Thu, 14 Nov 2019 21:02:01 +0100
changeset 32359 a6b7aab7e3f5adcd66189fb3ac37e3740b5abbe5
parent 32358 9e2e265534e73619d6bbc5233edbd7a2bf7d9907
child 32360 f029948637f26d8bb35a2f92ccf60e017a137334
push id229
push userfrgrahl@gmx.net
push dateThu, 14 Nov 2019 20:02:28 +0000
treeherdercomm-esr60@b05f05a590f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1591791, 1584809
Bug 1591791 - Port |Bug 1584809 - PageInfo cookie permissions default to allow| to SeaMonkey. r=frg a=frg DONTBUILD CLOSED TREE
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;