зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1140242 - Convert nsILoginInfo to vanilla JS objects before trying to send them in messages. r=dolske
This commit is contained in:
Родитель
f433070461
Коммит
255d73a291
|
@ -206,8 +206,13 @@ var LoginManagerParent = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var logins = Services.logins.findLogins({}, formOrigin, actionOrigin, null);
|
var logins = Services.logins.findLogins({}, formOrigin, actionOrigin, null);
|
||||||
target.sendAsyncMessage("RemoteLogins:loginsFound",
|
// Convert the array of nsILoginInfo to vanilla JS objects since nsILoginInfo
|
||||||
{ requestId: requestId, logins: logins });
|
// doesn't support structured cloning.
|
||||||
|
var jsLogins = JSON.parse(JSON.stringify(logins));
|
||||||
|
target.sendAsyncMessage("RemoteLogins:loginsFound", {
|
||||||
|
requestId: requestId,
|
||||||
|
logins: jsLogins,
|
||||||
|
});
|
||||||
|
|
||||||
const PWMGR_FORM_ACTION_EFFECT = Services.telemetry.getHistogramById("PWMGR_FORM_ACTION_EFFECT");
|
const PWMGR_FORM_ACTION_EFFECT = Services.telemetry.getHistogramById("PWMGR_FORM_ACTION_EFFECT");
|
||||||
if (logins.length == 0) {
|
if (logins.length == 0) {
|
||||||
|
@ -261,9 +266,13 @@ var LoginManagerParent = {
|
||||||
AutoCompleteE10S.showPopupWithResults(target.ownerDocument.defaultView, rect, result);
|
AutoCompleteE10S.showPopupWithResults(target.ownerDocument.defaultView, rect, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
target.messageManager.sendAsyncMessage("RemoteLogins:loginsAutoCompleted",
|
// Convert the array of nsILoginInfo to vanilla JS objects since nsILoginInfo
|
||||||
{ requestId: requestId,
|
// doesn't support structured cloning.
|
||||||
logins: matchingLogins });
|
var jsLogins = JSON.parse(JSON.stringify(matchingLogins));
|
||||||
|
target.messageManager.sendAsyncMessage("RemoteLogins:loginsAutoCompleted", {
|
||||||
|
requestId: requestId,
|
||||||
|
logins: jsLogins,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onFormSubmit: function(hostname, formSubmitURL,
|
onFormSubmit: function(hostname, formSubmitURL,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче