Bug 1382548 - [Form Autofill] Avoid sending element references in messages. r=ralin
MozReview-Commit-ID: F6EXJl9dl8s
--- a/browser/extensions/formautofill/FormAutofillContent.jsm
+++ b/browser/extensions/formautofill/FormAutofillContent.jsm
@@ -121,19 +121,26 @@ AutofillProfileAutoCompleteSearch.protot
onSearchResult: (search, result) => {
listener.onSearchResult(this, result);
ProfileAutocomplete.setProfileAutoCompleteResult(result);
},
});
return;
}
- let collectionName = isAddressField ? ADDRESSES_COLLECTION_NAME : CREDITCARDS_COLLECTION_NAME;
+ let infoWithoutElement = Object.assign({}, info);
+ delete infoWithoutElement.elementWeakRef;
- this._getRecords({collectionName, info, searchString}).then((records) => {
+ let data = {
+ collectionName: isAddressField ? ADDRESSES_COLLECTION_NAME : CREDITCARDS_COLLECTION_NAME,
+ info: infoWithoutElement,
+ searchString,
+ };
+
+ this._getRecords(data).then((records) => {
if (this.forceStop) {
return;
}
// Sort addresses by timeLastUsed for showing the lastest used address at top.
records.sort((a, b) => b.timeLastUsed - a.timeLastUsed);
let adaptedRecords = handler.getAdaptedProfiles(records);
let result = null;