From d26da564b68481047ba17d7e29f6c0cad91b0cb0 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Mon, 2 May 2016 23:14:25 +0100 Subject: [PATCH] Bug 1269491 - Fix LoginManagerContent.jsm to get codebase principals from the nsIScriptSecurityManager. r=MattN MozReview-Commit-ID: HVXS7tfr8fv --- toolkit/components/passwordmgr/LoginManagerContent.jsm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index 3058942f4f85..3518d262288b 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -26,6 +26,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper", XPCOMUtils.defineLazyServiceGetter(this, "gContentSecurityManager", "@mozilla.org/contentsecuritymanager;1", "nsIContentSecurityManager"); +XPCOMUtils.defineLazyServiceGetter(this, "gScriptSecurityManager", + "@mozilla.org/scriptsecuritymanager;1", + "nsIScriptSecurityManager"); XPCOMUtils.defineLazyServiceGetter(this, "gNetUtil", "@mozilla.org/network/util;1", "nsINetUtil"); @@ -1135,7 +1138,8 @@ var LoginManagerContent = { // using a "javascript:" or "data:" URI from an HTTPS page. See bug 1162772 // for defining "window.isSecureContext", that may help in these cases. if (!principal.isCodebasePrincipal) { - principal = getCodebasePrincipal(document.documentURIObject); + principal = + gScriptSecurityManager.getCodebasePrincipal(document.documentURIObject); } // These checks include "file", "resource", HTTPS, and HTTP to "localhost".