Bug 1550171 - Don't apply Password Manager to about: pages. r=MattN

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jared Wein 2019-07-15 21:14:12 +00:00
Родитель 6d4b358fc8
Коммит d046711c81
2 изменённых файлов: 8 добавлений и 4 удалений

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

@ -40,9 +40,10 @@ addMessageListener("PasswordManager:fillGeneratedPassword", function(message) {
});
function shouldIgnoreLoginManagerEvent(event) {
let nodePrincipal = event.target.nodePrincipal;
// If we have a null principal then prevent any more password manager code from running and
// incorrectly using the document `location`.
return event.target.nodePrincipal.isNullPrincipal;
// incorrectly using the document `location`. Also skip password manager for about: pages.
return nodePrincipal.isNullPrincipal || nodePrincipal.URI.schemeIs("about");
}
addEventListener("DOMFormBeforeSubmit", function(event) {

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

@ -212,9 +212,12 @@ BrowserCLH.prototype = {
}
function shouldIgnoreLoginManagerEvent(event) {
let nodePrincipal = event.target.nodePrincipal;
// If we have a null principal then prevent any more password manager code from running and
// incorrectly using the document `location`.
return event.target.nodePrincipal.isNullPrincipal;
// incorrectly using the document `location`. Also skip password manager for about: pages.
return (
nodePrincipal.isNullPrincipal || nodePrincipal.URI.schemeIs("about")
);
}
let options = {