Bug 1584809 - PageInfo cookie permissions default to allow r=johannh
authorIan Neal <iann_cvs@blueyonder.co.uk>
Thu, 17 Oct 2019 07:32:13 +0000
changeset 498068 94015d1f76fc5552de98109df70b5f028daf2eab
parent 498067 debb6f82c687e67f5493ce1db5fcf7b12888d0b8
child 498069 bdbe51ab36a1b9fd0b25f80c17e8c7eb89ffe3db
push id98261
push useriann_cvs@blueyonder.co.uk
push dateThu, 17 Oct 2019 23:53:10 +0000
treeherderautoland@94015d1f76fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1584809
milestone71.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 1584809 - PageInfo cookie permissions default to allow r=johannh Differential Revision: https://phabricator.services.mozilla.com/D47846
browser/base/content/pageinfo/permissions.js
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -177,18 +177,22 @@ function onCheckboxClick(aPartId) {
   } else {
     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;
   }