Skip to content

Commit

Permalink
Bug 1438243 - Improve the UI for pages blocked by policy r=Felipe
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Kirk Steuber committed Feb 22, 2018
1 parent cd3aaed commit f923709
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 26 deletions.
10 changes: 7 additions & 3 deletions browser/base/content/aboutNetError.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 1 addition & 2 deletions browser/locales/en-US/chrome/overrides/netError.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -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">
4 changes: 4 additions & 0 deletions browser/themes/shared/aboutNetError.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions browser/themes/shared/blockedSite.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ body {

.title {
background-image: url("chrome://global/skin/icons/blocked.svg");
fill: currentColor;
-moz-context-properties: fill;
}

.title-text {
Expand Down
2 changes: 1 addition & 1 deletion docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions docshell/resources/content/netError.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion dom/browser-element/BrowserElementChildPreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion dom/locales/en-US/chrome/appstrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 1 addition & 2 deletions dom/locales/en-US/chrome/netError.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -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">
17 changes: 5 additions & 12 deletions toolkit/themes/shared/incontent-icons/blocked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f923709

Please sign in to comment.