Bug 1393332 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Let's start with the credit card importing, and then move on to addresses.

Here's what I'd start with:

1. So the first step is to add a new value to resourceTypes here: https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/components/migration/MigrationUtils.sys.mjs#114-124 . Let's add a new `CREDITCARD` resource type to this list, with the value of `0x0100`.
2. Next add a "creditcard" mapping (lowercase) to https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/components/migration/content/migration.js#24-32. Let's set the value to `"browser-data-creditcard"`. That's going to come into play in the next step.
3. That value we just added is for the strings we're going to introduce in this step. Let's do the same as this: https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/locales/en-US/browser/migration.ftl#162-165, but use `browser-data-creditcard-checkbox` and `browser-data-creditcard-label`, and set the value for those two as `Credit cards`
4. Next, we're going to clone `GetBookmarksResource` but call it `GetCreditCardsResource`: https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/components/migration/ChromeProfileMigrator.sys.mjs#355-426
5. Make sure the returned object `type` is `MigrationUtils.resourceTypes.CREDITCARDS`. The `migrate` function in there is going to do the work that you've proven out. We're going to do the SQLite query, decrypt the data. Let's get that far, and then we'll work on inserting those credit cards into the Firefox database.
Let's start with the credit card importing, and then move on to addresses.

Here's what I'd start with:

1. So the first step is to add a new value to resourceTypes here: https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/components/migration/MigrationUtils.sys.mjs#114-124 . Let's add a new `PAYMENT_METHODS` resource type to this list, with the value of `0x0100`.
2. Next add a "payment_methods" mapping (lowercase) to https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/components/migration/content/migration.js#24-32. Let's set the value to `"browser-data-payment-methods"`. That's going to come into play in the next step.
3. That value we just added is for the strings we're going to introduce in this step. Let's do the same as this: https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/locales/en-US/browser/migration.ftl#162-165, but use `browser-data-payment-methods-checkbox` and `browser-data-payment-methods-label`, and set the value for those two as `Payment methods`
4. Next, we're going to clone `GetBookmarksResource` but call it `GetPaymentMethodsResource`: https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/browser/components/migration/ChromeProfileMigrator.sys.mjs#355-426
5. Make sure the returned object `type` is `MigrationUtils.resourceTypes.PAYMENT_METHODS`. The `migrate` function in there is going to do the work that you've proven out. We're going to do the SQLite query, decrypt the data. Let's get that far, and then we'll work on inserting those credit cards into the Firefox database.

Back to Bug 1393332 Comment 2