processed * the first time. * * @param aPrefBranch Preferences branch to import from. The preferences * under this branch can specify whitelist (ALLOW_ACTION) * or blacklist (DENY_ACTION) additions using perference * names of the form: * * .whitelist.add. * * .blacklist.add. * Where can be any valid preference name. * The value is expected to be a comma separated list of * host named. eg: * * something.example.com * * foo.exmaple.com,bar.example.com * * @param aPermission Permission name to be passsed to the Permissions * Manager. */ importFromPrefs(aPrefBranch, aPermission) { if (!aPrefBranch.endsWith(".")) { aPrefBranch += "."; } // Ensure we only import this pref branch once. if (gImportedPrefBranches.has(aPrefBranch)) { return; } importPrefBranch( aPrefBranch + "whitelist.add", aPermission, Services.perms.ALLOW_ACTION ); importPrefBranch( aPrefBranch + "blacklist.add", aPermission, Services.perms.DENY_ACTION ); gImportedPrefBranches.add(aPrefBranch); }, }; // For test use only. export const PermissionsTestUtils = { clearImportedPrefBranches() { gImportedPrefBranches.clear(); }, }; PK