Skip to content

Commit 45a99bf

Browse files
committed
Bug 1455888 - Added a check to Policies.jsm addAllowDenyPermissions to throw an error when the user tries to add built-in sites to the permission manager r=Felipe
MozReview-Commit-ID: JIRr6BtK3x8 --HG-- extra : rebase_source : bd6420a0e2f07408d7ca21b62268b0888e2ca9ab
1 parent 0f04c80 commit 45a99bf

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

browser/components/enterprisepolicies/Policies.jsm

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,15 @@ function addAllowDenyPermissions(permissionName, allowList, blockList) {
779779
blockList = blockList || [];
780780

781781
for (let origin of allowList) {
782-
Services.perms.add(origin,
783-
permissionName,
784-
Ci.nsIPermissionManager.ALLOW_ACTION,
785-
Ci.nsIPermissionManager.EXPIRE_POLICY);
782+
try {
783+
Services.perms.add(origin,
784+
permissionName,
785+
Ci.nsIPermissionManager.ALLOW_ACTION,
786+
Ci.nsIPermissionManager.EXPIRE_POLICY);
787+
} catch (ex) {
788+
log.error(`Added by default for ${permissionName} permission in the permission
789+
manager - ${origin.spec}`);
790+
}
786791
}
787792

788793
for (let origin of blockList) {

0 commit comments

Comments
 (0)