Bug 1438243 - Improve the UI for pages blocked by policy r=Felipe

Improves the UI for pages blocked by the enterprise policy manager. These improvements include a new image instead of the generic "info" image and updated, approved strings for the page.

MozReview-Commit-ID: 9d6V9onHGGg

--HG--
extra : rebase_source : d702947924f24d9440455a56b7e2f876ab634464
This commit is contained in:
Kirk Steuber 2018-02-22 15:41:12 -08:00
Родитель cd3aaede6c
Коммит f923709efc
11 изменённых файлов: 27 добавлений и 26 удалений

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

@ -169,6 +169,9 @@
if (illustratedErrors.includes(err)) {
document.body.classList.add("illustrated", err);
}
if (err == "blockedByPolicy") {
document.body.classList.add("blocked");
}
gIsCertError = (err == "nssBadCert");
// Only worry about captive portals if this is a cert error.
@ -308,7 +311,7 @@
var event = new CustomEvent("AboutNetErrorLoad", {bubbles: true});
document.dispatchEvent(event);
if (err == "inadequateSecurityError" || err == "blockedByPolicyTemp") {
if (err == "inadequateSecurityError" || err == "blockedByPolicy") {
// Remove the "Try again" button from pages that don't need it.
// For HTTP/2 inadequate security or pages blocked by policy, trying
// again won't help.
@ -529,6 +532,7 @@
<span id="ept_captivePortal">&captivePortal.title;</span>
<span id="ept_dnsNotFound">&dnsNotFound.pageTitle;</span>
<span id="ept_malformedURI">&malformedURI.pageTitle;</span>
<span id="ept_blockedByPolicy">&blockedByPolicy.title;</span>
</div>
<div id="errorTitlesContainer">
<h1 id="et_generic">&generic.title;</h1>
@ -558,7 +562,7 @@
<h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
<h1 id="et_sslv3Used">&sslv3Used.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
<h1 id="et_blockedByPolicyTemp">&blockedByPolicyTemp.title;</h1>
<h1 id="et_blockedByPolicy">&blockedByPolicy.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
@ -588,7 +592,7 @@
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
<div id="ed_blockedByPolicyTemp">&blockedByPolicyTemp.longDesc;</div>
<div id="ed_blockedByPolicy"></div>
</div>
</div>

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

@ -40,4 +40,4 @@ remoteXUL=This page uses an unsupported technology that is no longer available b
## LOCALIZATION NOTE (sslv3Used) - Do not translate "%S".
sslv3Used=Firefox cannot guarantee the safety of your data on %S because it uses SSLv3, a broken security protocol.
inadequateSecurityError=The website tried to negotiate an inadequate level of security.
blockedByPolicyTemp=This page has been blocked by the enterprise policy manager.
blockedByPolicy=Your organization has blocked access to this page or website.

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

@ -200,8 +200,7 @@ certificate.">
"NS_ERROR_NET_INADEQUATE_SECURITY". -->
<!ENTITY inadequateSecurityError.longDesc "<p><span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.</p><p>Error code: NS_ERROR_NET_INADEQUATE_SECURITY</p>">
<!ENTITY blockedByPolicyTemp.title "Page Blocked">
<!ENTITY blockedByPolicyTemp.longDesc "<p>Access has been disabled by your administrator.</p>">
<!ENTITY blockedByPolicy.title "Blocked Page">
<!ENTITY prefReset.longDesc "It looks like your network security settings might be causing this. Do you want the default settings to be restored?">
<!ENTITY prefReset.label "Restore default settings">

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

@ -16,6 +16,10 @@ body.certerror .title {
background-image: url("cert-error.svg");
}
body.blocked .title {
background-image: url("chrome://global/skin/icons/blocked.svg");
}
#errorContainer {
display: none;
}

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

@ -14,6 +14,8 @@ body {
.title {
background-image: url("chrome://global/skin/icons/blocked.svg");
fill: currentColor;
-moz-context-properties: fill;
}
.title-text {

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

@ -4840,7 +4840,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
break;
case NS_ERROR_BLOCKED_BY_POLICY:
// Page blocked by policy
error = "blockedByPolicyTemp";
error = "blockedByPolicy";
break;
default:
break;

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

@ -178,7 +178,7 @@
secOverride.remove();
}
if (err == "inadequateSecurityError" || err == "blockedByPolicyTemp") {
if (err == "inadequateSecurityError" || err == "blockedByPolicy") {
// Remove the "Try again" button from pages that don't need it.
// For HTTP/2 inadequate security or pages blocked by policy, trying
// again won't help.
@ -310,7 +310,7 @@
<h1 id="et_remoteXUL">&remoteXUL.title;</h1>
<h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
<h1 id="et_blockedByPolicyTemp">&blockedByPolicyTemp.title;</h1>
<h1 id="et_blockedByPolicy">&blockedByPolicy.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
@ -338,7 +338,7 @@
<div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
<div id="ed_blockedByPolicyTemp">&blockedByPolicyTemp.longDesc;</div>
<div id="ed_blockedByPolicy"></div>
</div>
</div>

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

@ -1514,7 +1514,7 @@ BrowserElementChild.prototype = {
sendAsyncMsg('error', { type: 'corruptedContentErrorv2' });
return;
case Cr.NS_ERROR_BLOCKED_BY_POLICY :
sendAsyncMsg('error', { type: 'blockedByPolicyTemp' });
sendAsyncMsg('error', { type: 'blockedByPolicy' });
return;
default:

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

@ -38,4 +38,4 @@ remoteXUL=This page uses an unsupported technology that is no longer available b
sslv3Used=The safety of your data on %S could not be guaranteed because it uses SSLv3, a broken security protocol.
weakCryptoUsed=The owner of %S has configured their website improperly. To protect your information from being stolen, the connection to this website has not been established.
inadequateSecurityError=The website tried to negotiate an inadequate level of security.
blockedByPolicyTemp=This page has been blocked by the enterprise policy manager.
blockedByPolicy=Your organization has blocked access to this page or website.

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

@ -98,5 +98,4 @@
"NS_ERROR_NET_INADEQUATE_SECURITY". -->
<!ENTITY inadequateSecurityError.longDesc "<p><span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.</p><p>Error code: NS_ERROR_NET_INADEQUATE_SECURITY</p>">
<!ENTITY blockedByPolicyTemp.title "Page Blocked">
<!ENTITY blockedByPolicyTemp.longDesc "<p>Access has been disabled by your administrator.</p>">
<!ENTITY blockedByPolicy.title "Blocked Page">

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

@ -1,13 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 45 45">
<defs>
<circle id="stop-sign" cx="22.5" cy="22.5" r="20.5"/>
<mask id="stop-symbol">
<rect width="45" height="45" fill="#fff"/>
<line x1="10" y1="23" x2="35" y2="23" stroke="#000" stroke-width="6"/>
</mask>
</defs>
<use xlink:href="#stop-sign" mask="url(#stop-symbol)" fill="#fff"/>
</svg>
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<path fill="context-fill" fill-rule="evenodd" d="M3 9h10V7H3v2zm5-8a7 7 0 1 0 0 14A7 7 0 0 0 8 1z"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 635 B

После

Ширина:  |  Высота:  |  Размер: 380 B