Skip to content
Snippets Groups Projects
Commit 3dc73db2 authored by Mike Kaply's avatar Mike Kaply
Browse files

Bug 1677524 - Add policies for credit card and address autofill. a=RyanVM

parent 3bf45c36
No related branches found
No related tags found
No related merge requests found
......@@ -303,6 +303,18 @@ export var Policies = {
},
},
AutofillAddressEnabled: {
onBeforeAddons(manager, param) {
setAndLockPref("extensions.formautofill.addresses.enabled", param);
},
},
AutofillCreditCardEnabled: {
onBeforeAddons(manager, param) {
setAndLockPref("extensions.formautofill.creditCards.enabled", param);
},
},
AutoLaunchProtocolsFromOrigins: {
onBeforeAddons(manager, param) {
for (let info of param) {
......
......@@ -86,6 +86,14 @@
}
},
"AutofillAddressEnabled": {
"type": "boolean"
},
"AutofillCreditCardEnabled": {
"type": "boolean"
},
"AutoLaunchProtocolsFromOrigins": {
"type": ["array", "JSON"],
"items": {
......
......@@ -1021,6 +1021,19 @@ const POLICIES_TESTS = [
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features": true,
},
},
// POLICY: AutofillAddressEnabled, AutofillCreditCardEnabled
{
policies: {
AutofillAddressEnabled: false,
AutofillCreditCardEnabled: false,
},
lockedPrefs: {
"extensions.formautofill.addresses.enabled": false,
"extensions.formautofill.creditCards.enabled": false,
},
},
];
add_task(async function test_policy_simple_prefs() {
......
......@@ -211,6 +211,9 @@ class ManageRecords {
this._elements.edit.setAttribute("disabled", "disabled");
this._elements.remove.removeAttribute("disabled");
}
this._elements.add.disabled = !Services.prefs.getBoolPref(
`extensions.formautofill.${this._subStorageName}.enabled`
);
}
/**
......
......@@ -21,6 +21,10 @@ policy-AppUpdateURL = Set custom app update URL.
policy-Authentication = Configure integrated authentication for websites that support it.
policy-AutofillAddressEnabled = Enable autofill for addresses.
policy-AutofillCreditCardEnabled = Enable autofill for payment methods.
policy-AutoLaunchProtocolsFromOrigins = Define a list of external protocols that can be used from listed origins without prompting the user.
policy-BackgroundAppUpdate2 = Enable or disable the background updater.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment