commit ff3e3b050763acbb0af2da96eef47e12c9f6d930
parent 738243227c4feb1a27bb9e059757615eb2f59c3e
Author: agoloman <agoloman@mozilla.com>
Date: Tue, 7 Oct 2025 20:03:26 +0300
Revert "Bug 1990922 - Update mixed content cert error page to work for felt v1 privacy pref - r=niklas" for causing bc failures @browser.toml.
This reverts commit 2df12e30164a1b46b01e2b89ee9726cf0a81a3d5.
Diffstat:
4 files changed, 9 insertions(+), 29 deletions(-)
diff --git a/browser/base/content/test/siteIdentity/browser.toml b/browser/base/content/test/siteIdentity/browser.toml
@@ -112,9 +112,6 @@ support-files = [
["browser_mixed_content_cert_override.js"]
tags = "mcb"
-prefs = [
- "security.certerrors.felt-privacy-v1=true"
-]
support-files = ["test-mixedcontent-securityerrors.html"]
["browser_mixed_content_with_navigation.js"]
diff --git a/browser/base/content/test/siteIdentity/browser_mixed_content_cert_override.js b/browser/base/content/test/siteIdentity/browser_mixed_content_cert_override.js
@@ -23,8 +23,7 @@ function getIdentityIcon() {
.listStyleImage;
}
-async function checkIdentityPopup(icon) {
- await openIdentityPopup();
+function checkIdentityPopup(icon) {
gIdentityHandler.refreshIdentityPopup();
is(getIdentityIcon(), `url("chrome://global/skin/icons/${icon}")`);
is(getConnectionState(), "secure-cert-user-overridden");
@@ -41,9 +40,10 @@ async function checkIdentityPopup(icon) {
add_task(async function () {
await BrowserTestUtils.openNewForegroundTab(gBrowser);
+
// check that a warning is shown when loading a page with mixed content and an overridden certificate
await loadBadCertPage(MIXED_CONTENT_URL);
- await checkIdentityPopup("security-warning.svg");
+ checkIdentityPopup("security-warning.svg");
// check that a warning is shown even without mixed content
BrowserTestUtils.startLoadingURIString(
@@ -51,7 +51,7 @@ add_task(async function () {
"https://self-signed.example.com"
);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- await checkIdentityPopup("security-warning.svg");
+ checkIdentityPopup("security-warning.svg");
// remove cert exception
let certOverrideService = Cc[
diff --git a/browser/base/content/test/siteIdentity/head.js b/browser/base/content/test/siteIdentity/head.js
@@ -396,29 +396,12 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
}
async function loadBadCertPage(url) {
- const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
+ let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.startLoadingURIString(gBrowser.selectedBrowser, url);
await loaded;
- await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
- const netErrorCard =
- content.document.querySelector("net-error-card").wrappedJSObject;
- await netErrorCard.getUpdateComplete();
- await EventUtils.synthesizeMouseAtCenter(
- netErrorCard.advancedButton,
- {},
- content
- );
- await ContentTaskUtils.waitForCondition(() => {
- return (
- netErrorCard.exceptionButton && !netErrorCard.exceptionButton.disabled
- );
- }, "Waiting for exception button");
- netErrorCard.exceptionButton.scrollIntoView(true);
- await EventUtils.synthesizeMouseAtCenter(
- netErrorCard.exceptionButton,
- {},
- content
- );
+
+ await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function () {
+ content.document.getElementById("exceptionDialogButton").click();
});
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
}
diff --git a/toolkit/content/net-error-card.mjs b/toolkit/content/net-error-card.mjs
@@ -148,7 +148,7 @@ export class NetErrorCard extends MozLitElement {
break;
}
case "SSL_ERROR_BAD_CERT_DOMAIN": {
- if (this.domainMismatchNames === null) {
+ if (!this.domainMismatchNames) {
this.getDomainMismatchNames();
return null;
}