commit 41ca115985dbcb229ba8632aec258df77e9304a8
parent 2809fa98ae70d6e606535fc187a99c7e7e5e1941
Author: Sandra Qu <squiles@mozilla.com>
Date: Thu, 23 Oct 2025 20:40:29 +0000
Bug 1993247 Failing telemetry in browser_aboutCertError_cca_telemetry.js r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D267961
Diffstat:
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/toolkit/content/aboutNetError.mjs b/toolkit/content/aboutNetError.mjs
@@ -7,6 +7,7 @@
import { NetErrorCard } from "chrome://global/content/net-error-card.mjs";
import {
gIsCertError,
+ isCaptive,
gErrorCode,
gHasSts,
searchParams,
@@ -92,10 +93,6 @@ function getDescription() {
return searchParams.get("d");
}
-function isCaptive() {
- return searchParams.get("captive") == "true";
-}
-
/**
* We don't actually know what the MitM is called (since we don't
* maintain a list), so we'll try and display the common name of the
diff --git a/toolkit/content/aboutNetErrorHelpers.mjs b/toolkit/content/aboutNetErrorHelpers.mjs
@@ -29,6 +29,10 @@ export let gIsCertError = gErrorCode == "nssBadCert";
export let gHasSts = gIsCertError && getCSSClass() === "badStsCert";
const HOST_NAME = getHostName();
+export function isCaptive() {
+ return searchParams.get("captive") == "true";
+}
+
export function getCSSClass() {
return searchParams.get("s");
}
diff --git a/toolkit/content/net-error-card.mjs b/toolkit/content/net-error-card.mjs
@@ -6,6 +6,7 @@
import {
gIsCertError,
+ isCaptive,
getCSSClass,
getHostName,
getSubjectAltNames,
@@ -87,6 +88,17 @@ export class NetErrorCard extends MozLitElement {
document.dispatchEvent(
new CustomEvent("AboutNetErrorLoad", { bubbles: true })
);
+
+ // Record telemetry when the error page loads
+ if (gIsCertError && !isCaptive()) {
+ if (this.failedCertInfo) {
+ recordSecurityUITelemetry(
+ "securityUiCerterror",
+ "loadAboutcerterror",
+ this.failedCertInfo
+ );
+ }
+ }
}
init() {