зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1875253 - Enable Address Capture for US and CA regions in Nightly r=credential-management-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D198941
This commit is contained in:
Родитель
04a2901e47
Коммит
3794750a4d
|
@ -25,7 +25,7 @@ const ADDRESS_FIELD_VALUES = {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
["extensions.formautofill.heuristics.captureOnFormRemoval", true],
|
||||
],
|
||||
|
|
|
@ -9,7 +9,7 @@ const ADDRESS_VALUES = {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
["extensions.formautofill.heuristics.captureOnPageNavigation", true],
|
||||
],
|
||||
|
|
|
@ -16,7 +16,7 @@ async function expectSavedAddresses(expectedCount) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ async function expectSavedAddresses(expectedCount) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ async function expectSavedAddresses(expectedCount) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ async function expectedSavedAddresses(expectedCount) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ async function expectSavedAddresses(expectedCount) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -53,14 +53,14 @@ const TESTCASES = [
|
|||
"#email": "test@mozilla.org",
|
||||
"#tel": "1-650-903-0800",
|
||||
},
|
||||
prefs: [["extensions.formautofill.addresses.capture.v2.enabled", false]],
|
||||
prefs: [["extensions.formautofill.addresses.capture.enabled", false]],
|
||||
},
|
||||
];
|
||||
|
||||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ async function expectSavedAddresses(expectedAddresses) {
|
|||
|
||||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.formautofill.addresses.capture.v2.enabled", true]],
|
||||
set: [["extensions.formautofill.addresses.capture.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ async function expectSavedAddresses(expectedAddresses) {
|
|||
|
||||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.formautofill.addresses.capture.v2.enabled", true]],
|
||||
set: [["extensions.formautofill.addresses.capture.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ function recordToFormSelector(record) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ const { Region } = ChromeUtils.importESModule(
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "detect"],
|
||||
["extensions.formautofill.addresses.supportedCountries", "US,CA"],
|
||||
],
|
||||
|
|
|
@ -259,7 +259,7 @@ add_setup(async function () {
|
|||
set: [
|
||||
[ENABLED_AUTOFILL_ADDRESSES_PREF, true],
|
||||
[AUTOFILL_ADDRESSES_AVAILABLE_PREF, "on"],
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
],
|
||||
});
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ function recordToFormSelector(record) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@ requestLongerTimeout(2);
|
|||
|
||||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.formautofill.addresses.capture.v2.enabled", true]],
|
||||
set: [["extensions.formautofill.addresses.capture.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ function recordToFormSelector(record) {
|
|||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.v2.enabled", true],
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
|
|
|
@ -3952,9 +3952,11 @@ pref("security.external_protocol_requires_permission", true);
|
|||
pref("extensions.formautofill.available", "detect");
|
||||
pref("extensions.formautofill.addresses.supported", "detect");
|
||||
pref("extensions.formautofill.addresses.enabled", true);
|
||||
pref("extensions.formautofill.addresses.capture.enabled", false);
|
||||
// This preference should be removed entirely once address capture v2 developing is finished
|
||||
pref("extensions.formautofill.addresses.capture.v2.enabled", false);
|
||||
#if defined(NIGHTLY_BUILD)
|
||||
pref("extensions.formautofill.addresses.capture.enabled", true);
|
||||
#else
|
||||
pref("extensions.formautofill.addresses.capture.enabled", false);
|
||||
#endif
|
||||
// Defies the required address form fields to trigger the display of the address capture doorhanger
|
||||
pref("extensions.formautofill.addresses.capture.requiredFields", "street-address,postal-code,address-level1,address-level2");
|
||||
pref("extensions.formautofill.addresses.ignoreAutocompleteOff", true);
|
||||
|
|
|
@ -18,7 +18,6 @@ const IOS_DEFAULT_PREFERENCES = {
|
|||
"extensions.formautofill.creditCards.supportedCountries": "US,CA,GB,FR,DE",
|
||||
"extensions.formautofill.addresses.enabled": false,
|
||||
"extensions.formautofill.addresses.capture.enabled": false,
|
||||
"extensions.formautofill.addresses.capture.v2.enabled": false,
|
||||
"extensions.formautofill.addresses.supportedCountries": "",
|
||||
"extensions.formautofill.creditCards.enabled": true,
|
||||
"extensions.formautofill.reauth.enabled": true,
|
||||
|
|
|
@ -18,8 +18,6 @@ const ENABLED_AUTOFILL_ADDRESSES_PREF =
|
|||
"extensions.formautofill.addresses.enabled";
|
||||
const ENABLED_AUTOFILL_ADDRESSES_CAPTURE_PREF =
|
||||
"extensions.formautofill.addresses.capture.enabled";
|
||||
const ENABLED_AUTOFILL_ADDRESSES_CAPTURE_V2_PREF =
|
||||
"extensions.formautofill.addresses.capture.v2.enabled";
|
||||
const ENABLED_AUTOFILL_ADDRESSES_CAPTURE_REQUIRED_FIELDS_PREF =
|
||||
"extensions.formautofill.addresses.capture.requiredFields";
|
||||
const ENABLED_AUTOFILL_ADDRESSES_SUPPORTED_COUNTRIES_PREF =
|
||||
|
@ -43,7 +41,6 @@ const ENABLED_AUTOFILL_CAPTURE_ON_PAGE_NAVIGATION =
|
|||
export const FormAutofill = {
|
||||
ENABLED_AUTOFILL_ADDRESSES_PREF,
|
||||
ENABLED_AUTOFILL_ADDRESSES_CAPTURE_PREF,
|
||||
ENABLED_AUTOFILL_ADDRESSES_CAPTURE_V2_PREF,
|
||||
ENABLED_AUTOFILL_CAPTURE_ON_FORM_REMOVAL,
|
||||
ENABLED_AUTOFILL_CAPTURE_ON_PAGE_NAVIGATION,
|
||||
ENABLED_AUTOFILL_CREDITCARDS_PREF,
|
||||
|
@ -211,11 +208,6 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
|||
"isAutofillAddressesCaptureEnabled",
|
||||
ENABLED_AUTOFILL_ADDRESSES_CAPTURE_PREF
|
||||
);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
FormAutofill,
|
||||
"isAutofillAddressesCaptureV2Enabled",
|
||||
ENABLED_AUTOFILL_ADDRESSES_CAPTURE_V2_PREF
|
||||
);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
FormAutofill,
|
||||
"_isAutofillCreditCardsAvailable",
|
||||
|
|
|
@ -686,10 +686,7 @@ export class FormAutofillParent extends JSWindowActorParent {
|
|||
}
|
||||
|
||||
_shouldShowSaveAddressPrompt(record) {
|
||||
if (
|
||||
!FormAutofill.isAutofillAddressesCaptureEnabled &&
|
||||
!FormAutofill.isAutofillAddressesCaptureV2Enabled
|
||||
) {
|
||||
if (!FormAutofill.isAutofillAddressesCaptureEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче