diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 543aae19074..ea25acc7f94 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -2313,7 +2313,8 @@ let BrowserOnClick = { switch (msg.name) { case "Browser:CertExceptionError": this.onAboutCertError(msg.target, msg.json.elementId, - msg.json.isTopFrame, msg.json.location); + msg.json.isTopFrame, msg.json.location, + msg.objects.failedChannel); break; case "Browser:SiteBlockedError": this.onAboutBlocked(msg.json.elementId, msg.json.isMalware, @@ -2326,19 +2327,16 @@ let BrowserOnClick = { } }, - onAboutCertError: function (browser, elementId, isTopFrame, location) { + onAboutCertError: function (browser, elementId, isTopFrame, location, failedChannel) { let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); switch (elementId) { case "exceptionDialogButton": - let docshell = aOwnerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShell); - let securityInfo = docshell.failedChannel.securityInfo; - let sslStatus = securityInfo.QueryInterface(Ci.nsISSLStatusProvider).SSLStatus; if (isTopFrame) { secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_CLICK_ADD_EXCEPTION); } + let sslStatus = failedChannel.securityInfo.QueryInterface(Ci.nsISSLStatusProvider) + .SSLStatus; let params = { exceptionAdded : false, sslStatus : sslStatus }; diff --git a/browser/base/content/content.js b/browser/base/content/content.js index e729ba87514..d4034c6831a 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -307,10 +307,15 @@ let ClickEventHandler = { }, onAboutCertError: function (targetElement, ownerDoc) { + let docshell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShell); sendAsyncMessage("Browser:CertExceptionError", { location: ownerDoc.location.href, elementId: targetElement.getAttribute("id"), - isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView) + isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView), + }, { + failedChannel: docshell.failedChannel }); },