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 28136 f1b5416c152bc6c0b457a661f78cbed98e3b3158
parent 28135 cb0db83a425334700b93709ab7d735755e3595b0
child 28137 c7d09e547b0f2e0c978473556e23d8e8ad476ee4
push id16674
push userfrgrahl@gmx.net
push dateMon, 11 Nov 2019 20:13:28 +0000
treeherdercomm-central@99690c17bfc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;