Bug 1575080 - Changing the identity icon and the string inside the identity panel for net error pages. r=fluent-reviewers,johannh

Differential Revision: https://phabricator.services.mozilla.com/D112384
This commit is contained in:
Anshul Sahai 2021-05-03 07:51:14 +00:00
Родитель f986046726
Коммит 7b08dcedd7
5 изменённых файлов: 57 добавлений и 6 удалений

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

@ -1014,8 +1014,10 @@ var gIdentityHandler = {
connection = "cert-error-page";
} else if (this._isAboutHttpsOnlyErrorPage) {
connection = "https-only-error-page";
} else if (this._isAboutNetErrorPage || this._isAboutBlockedPage) {
} else if (this._isAboutBlockedPage) {
connection = "not-secure";
} else if (this._isAboutNetErrorPage) {
connection = "net-error-page";
} else if (this._isPotentiallyTrustworthy) {
connection = "file";
}

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

@ -499,6 +499,45 @@ add_task(async function test_about_net_error_uri_from_navigation_tab() {
await noCertErrorFromNavigationTest(false);
});
add_task(async function netErrorPageTest() {
const TLS10_PAGE = "https://tls1.example.com/";
Services.prefs.setIntPref("security.tls.version.min", 3);
Services.prefs.setIntPref("security.tls.version.max", 4);
let browser;
let pageLoaded;
await BrowserTestUtils.openNewForegroundTab(
gBrowser,
() => {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, TLS10_PAGE);
browser = gBrowser.selectedBrowser;
pageLoaded = BrowserTestUtils.waitForErrorPage(browser);
},
false
);
info("Loading and waiting for the net error");
await pageLoaded;
await SpecialPowers.spawn(browser, [], function() {
const doc = content.document;
ok(
doc.documentURI.startsWith("about:neterror"),
"Should be showing error page"
);
});
is(
getConnectionState(),
"net-error-page",
"Connection should be the net error page."
);
BrowserTestUtils.removeTab(gBrowser.selectedTab);
await SpecialPowers.popPrefEnv();
});
async function aboutBlockedTest(secureCheck) {
let url = "http://www.itisatrap.org/firefox/its-an-attack.html";
let oldTab = await loadNewTab("about:robots");

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

@ -35,6 +35,8 @@
when-connection="not-secure secure-cert-user-overridden secure-custom-root cert-error-page https-only-error-page" data-l10n-id="identity-connection-not-secure"></description>
<description class="identity-popup-connection-secure"
when-connection="secure secure-ev" data-l10n-id="identity-connection-secure"></description>
<description class="identity-popup-connection-failure"
when-connection="net-error-page" data-l10n-id="identity-connection-failure"></description>
<description when-connection="chrome" data-l10n-id="identity-connection-internal"></description>
<description when-connection="file" data-l10n-id="identity-connection-file"></description>
<description when-connection="extension" data-l10n-id="identity-extension-page"></description>
@ -85,7 +87,7 @@
</vbox>
<button id="identity-popup-security-expander"
class="identity-popup-expander"
when-connection="not-secure secure secure-ev secure-cert-user-overridden cert-error-page https-only-error-page"
when-connection="not-secure secure secure-ev secure-cert-user-overridden cert-error-page net-error-page https-only-error-page"
oncommand="gIdentityHandler.showSecuritySubView();"/>
</hbox>
@ -105,9 +107,9 @@
descriptionheightworkaround="true">
<vbox class="identity-popup-security-content">
<vbox class="identity-popup-security-connection">
<description class="identity-popup-connection-not-secure security-view"
when-connection="not-secure secure-cert-user-overridden cert-error-page https-only-error-page" data-l10n-id="identity-connection-not-secure-security-view"></description>
<description class="identity-popup-connection-secure security-view"
<description class="identity-popup-connection-not-secure"
when-connection="not-secure secure-cert-user-overridden cert-error-page net-error-page https-only-error-page" data-l10n-id="identity-connection-not-secure-security-view"></description>
<description class="identity-popup-connection-secure"
when-connection="secure secure-ev" data-l10n-id="identity-connection-verified"></description>
</vbox>
</vbox>
@ -135,7 +137,7 @@
oncommand="gIdentityHandler.removeCertException()"/>
<!-- Connection is Not Secure -->
<description when-connection="not-secure cert-error-page https-only-error-page"
<description when-connection="not-secure cert-error-page net-error-page https-only-error-page"
data-l10n-id="identity-description-insecure"></description>
<!-- Weak Cipher -->

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

@ -300,6 +300,7 @@ identity-header-security-with-host =
.title = Connection security for { $host }
identity-connection-not-secure = Connection not secure
identity-connection-secure = Connection secure
identity-connection-failure = Connection failure
identity-connection-internal = This is a secure { -brand-short-name } page.
identity-connection-file = This page is stored on your computer.
identity-extension-page = This page is loaded from an extension.

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

@ -77,6 +77,7 @@
#identity-popup[connection=file] [when-connection~=file],
#identity-popup[connection=extension] [when-connection~=extension],
#identity-popup[connection=cert-error-page] [when-connection~=cert-error-page],
#identity-popup[connection=net-error-page] [when-connection~=net-error-page],
#identity-popup[connection=https-only-error-page] [when-connection~=https-only-error-page],
/* Show weak cipher messages when needed. */
#identity-popup[ciphers=weak] [when-ciphers~=weak],
@ -466,6 +467,12 @@
-moz-context-properties: fill;
}
#identity-popup[connection=net-error-page] .identity-popup-security-connection {
background-image: url(chrome://global/skin/icons/info.svg);
fill: unset;
-moz-context-properties: fill;
}
#identity-popup[mixedcontent~=active-loaded][isbroken] .identity-popup-security-connection {
background-image: url(chrome://browser/skin/controlcenter/mcb-disabled.svg);
-moz-context-properties: fill;