This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update guids by personal-data-changed
fix #4349 requires brave/muon#70 Auditors: @bridiver Test Plan: 1. Prepare a fresh install brave (version > 0.12.3) 2. Lauch brave 3. open about:autofill 4. Add an address 5. The address entry should show on the page 6. Add a credit card 7. The credit card entry should show on the page 8. Verify address and credit card on http://www.roboform.com/filling-test-all-fields
- Loading branch information
Showing
9 changed files
with
112 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
const electron = require('electron') | ||
const session = electron.session | ||
const appActions = require('../js/actions/appActions') | ||
|
||
module.exports.init = () => { | ||
process.on('personal-data-changed', (profileGuids, creditCardGuids) => { | ||
setImmediate(() => { | ||
appActions.autofillDataChanged(profileGuids, creditCardGuids) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports.addAutofillAddress = (detail, guid) => { | ||
session.defaultSession.autofill.addProfile({ | ||
full_name: detail.name, | ||
company_name: detail.organization, | ||
street_address: detail.streetAddress, | ||
city: detail.city, | ||
state: detail.state, | ||
postal_code: detail.postalCode, | ||
country_code: detail.country, | ||
phone: detail.phone, | ||
email: detail.email, | ||
guid: guid | ||
}) | ||
} | ||
|
||
module.exports.removeAutofillAddress = (guid) => { | ||
session.defaultSession.autofill.removeProfile(guid) | ||
} | ||
|
||
module.exports.addAutofillCreditCard = (detail, guid) => { | ||
session.defaultSession.autofill.addCreditCard({ | ||
name: detail.name, | ||
card_number: detail.card, | ||
expiration_month: detail.month, | ||
expiration_year: detail.year, | ||
guid: guid | ||
}) | ||
} | ||
|
||
module.exports.removeAutofillCreditCard = (guid) => { | ||
session.defaultSession.autofill.removeCreditCard(guid) | ||
} | ||
|
||
module.exports.clearAutocompleteData = () => { | ||
session.defaultSession.autofill.clearAutocompleteData() | ||
} | ||
|
||
module.exports.clearAutofillData = () => { | ||
session.defaultSession.autofill.clearAutofillData() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters