summaryrefslogtreecommitdiffstats
path: root/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs')
-rw-r--r--toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs30
1 files changed, 25 insertions, 5 deletions
diff --git a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs
index 05dcf5bace..2a72f302fe 100644
--- a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs
+++ b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs
@@ -19,6 +19,7 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
CreditCard: "resource://gre/modules/CreditCard.sys.mjs",
formAutofillStorage: "resource://autofill/FormAutofillStorage.sys.mjs",
+ OSKeyStore: "resource://gre/modules/OSKeyStore.sys.mjs",
});
ChromeUtils.defineLazyGetter(lazy, "log", () =>
@@ -475,9 +476,29 @@ export class AddressSaveDoorhanger extends AutofillDoorhanger {
];
break;
case "address":
- data = ["address-level2", "address-level1", "postal-code"].map(
- field => [field, this.oldRecord[field], this.newRecord[field]]
- );
+ data = [
+ [
+ "address-level2",
+ this.oldRecord["address-level2"],
+ this.newRecord["address-level2"],
+ ],
+ [
+ "address-level1",
+ FormAutofillUtils.getAbbreviatedSubregionName(
+ this.oldRecord["address-level1"],
+ this.oldRecord.country
+ ) || this.oldRecord["address-level1"],
+ FormAutofillUtils.getAbbreviatedSubregionName(
+ this.newRecord["address-level1"],
+ this.newRecord.country
+ ) || this.newRecord["address-level1"],
+ ],
+ [
+ "postal-code",
+ this.oldRecord["postal-code"],
+ this.newRecord["postal-code"],
+ ],
+ ];
break;
case "name":
case "country":
@@ -1301,7 +1322,7 @@ export let FormAutofillPrompter = {
return;
}
- if (!(await FormAutofillUtils.ensureLoggedIn()).authenticated) {
+ if (!(await lazy.OSKeyStore.ensureLoggedIn(false)).authenticated) {
lazy.log.warn("User canceled encryption login");
return;
}
@@ -1338,7 +1359,6 @@ export let FormAutofillPrompter = {
);
const { ownerGlobal: win } = browser;
- await win.ensureCustomElements("moz-support-link");
win.MozXULElement.insertFTLIfNeeded(
"toolkit/formautofill/formAutofill.ftl"
);