Bug 1604472 - Use documentPrincipal.origin when looking up generated passwords onFormSubmit. r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D57721

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sam Foster 2019-12-19 17:26:34 +00:00
Родитель 62cfa9f435
Коммит 4a35d16a80
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1595,9 +1595,11 @@ this.LoginManagerChild = class LoginManagerChild extends JSWindowActorChild {
}
let autoFilledLogin = docState.fillsByRootElement.get(form.rootElement);
let browsingContextId = win.getWindowGlobalChild().browsingContext.id;
let detail = {
origin,
browsingContextId,
formActionOrigin,
autoFilledLoginGuid: autoFilledLogin && autoFilledLogin.guid,
usernameField: mockUsername,

Просмотреть файл

@ -571,6 +571,7 @@ class LoginManagerParent extends JSWindowActorParent {
browser,
{
origin,
browsingContextId,
formActionOrigin,
autoFilledLoginGuid,
usernameField,
@ -603,6 +604,11 @@ class LoginManagerParent extends JSWindowActorParent {
return;
}
let browsingContext = BrowsingContext.get(browsingContextId);
let framePrincipalOrigin =
browsingContext.currentWindowGlobal.documentPrincipal.origin;
log("onFormSubmit, got framePrincipalOrigin: ", framePrincipalOrigin);
let formLogin = new LoginInfo(
origin,
formActionOrigin,
@ -635,7 +641,9 @@ class LoginManagerParent extends JSWindowActorParent {
formActionOrigin,
});
let generatedPW = gGeneratedPasswordsByPrincipalOrigin.get(origin);
let generatedPW = gGeneratedPasswordsByPrincipalOrigin.get(
framePrincipalOrigin
);
let autoSavedStorageGUID = "";
if (generatedPW && generatedPW.storageGUID) {
autoSavedStorageGUID = generatedPW.storageGUID;