Bug 1734217 - Merge all about:neterror front-end handling under toolkit. r=mkmelin,smaug,nalexander,flod,Gijs

Following a suggestion from :mkmelin, this seems like an optimal solution: the overriding/duplication in m-c is removed, and all users get a more powerful default choice that they're still able to override with their own, should they so wish.

For clarity and to match other `about:` pages, the shared code is placed under `toolkit/content/`, and all content under `docshell/resources/` is removed.

Differential Revision: https://phabricator.services.mozilla.com/D156478
This commit is contained in:
Eemeli Aro 2022-10-07 18:40:27 +00:00
Родитель ed0c600d94
Коммит 45a8fe66c1
55 изменённых файлов: 109 добавлений и 769 удалений

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

@ -68,8 +68,6 @@ FINAL_TARGET_FILES.actors += [
"LightweightThemeChild.jsm",
"LinkHandlerChild.jsm",
"LinkHandlerParent.jsm",
"NetErrorChild.jsm",
"NetErrorParent.jsm",
"PageInfoChild.sys.mjs",
"PageStyleChild.jsm",
"PageStyleParent.jsm",

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

@ -1,16 +0,0 @@
/* 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/. */
"use strict";
module.exports = {
overrides: [
{
files: "aboutNetError.js",
parserOptions: {
sourceType: "module",
},
},
],
};

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

@ -121,9 +121,6 @@ with Files("test/webrtc/**"):
with Files("test/zoom/**"):
BUG_COMPONENT = ("Firefox", "General")
with Files("aboutNetError.xhtml"):
BUG_COMPONENT = ("Firefox", "Security")
with Files("test/caps/**"):
BUG_COMPONENT = ("Firefox", "Security")

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

@ -467,8 +467,8 @@ add_task(async function checkSandboxedIframe() {
await SpecialPowers.spawn(bc, [], async function() {
let doc = content.document;
// aboutNetError.js is using async localization to format several messages
// and in result the translation may be applied later.
// aboutNetError.mjs is using async localization to format several
// messages and in result the translation may be applied later.
// We want to return the textContent of the element only after
// the translation completes, so let's wait for it here.
await ContentTaskUtils.waitForCondition(() => {

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

@ -139,8 +139,8 @@ add_task(async function checkBadStsCert() {
let advancedButton = doc.getElementById("advancedButton");
advancedButton.click();
// aboutNetError.js is using async localization to format several messages
// and in result the translation may be applied later.
// aboutNetError.mjs is using async localization to format several
// messages and in result the translation may be applied later.
// We want to return the textContent of the element only after
// the translation completes, so let's wait for it here.
let elements = [doc.getElementById("badCertTechnicalInfo")];

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

@ -7,7 +7,7 @@ const BAD_CERT_PAGE = "https://expired.example.com";
const DUMMY_SUPPORT_BASE_PATH = "/1/firefox/fxVersion/OSVersion/language/";
const DUMMY_SUPPORT_URL = BAD_CERT_PAGE + DUMMY_SUPPORT_BASE_PATH;
const OFFLINE_SUPPORT_PAGE =
"chrome://browser/content/certerror/supportpages/time-errors.html";
"chrome://global/content/neterror/supportpages/time-errors.html";
add_task(async function testOfflineSupportPage() {
// Cache the original value of app.support.baseURL pref to reset later

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

@ -95,8 +95,8 @@ async function setupPage(htmlPageName, blockedPage) {
await SpecialPowers.spawn(iframe, [], async function() {
let doc = content.document;
// aboutNetError.js is using async localization to format several messages
// and in result the translation may be applied later.
// aboutNetError.mjs is using async localization to format several
// messages and in result the translation may be applied later.
// We want to return the textContent of the element only after
// the translation completes, so let's wait for it here.
let elements = [

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

@ -53,7 +53,7 @@ var gExceptionPaths = [
// Paths from this folder are constructed in NetErrorParent.jsm based on
// the type of cert or net error the user is encountering.
"chrome://browser/content/certerror/supportpages/",
"chrome://global/content/neterror/supportpages/",
// Points to theme preview images, which are defined in browser/ but only used
// in toolkit/mozapps/extensions/content/aboutaddons.js.

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

@ -46,16 +46,6 @@ let gExceptionsList = [
key: "PatternAttributeCompileFailure",
type: "single-quote",
},
{
file: "netError.dtd",
key: "inadequateSecurityError.longDesc",
type: "single-quote",
},
{
file: "netErrorApp.dtd",
key: "securityOverride.warningContent",
type: "single-quote",
},
];
/**

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

@ -17,7 +17,6 @@ const kESModuleList = new Set([
/browser\/monitor-card.js$/,
/browser\/proxy-card.js$/,
/browser\/vpn-card.js$/,
/browser\/content\/browser\/certerror\/aboutNetError\.js$/,
/toolkit\/content\/global\/certviewer\/components\/.*\.js$/,
/toolkit\/content\/global\/certviewer\/.*\.js$/,
/chrome\/pdfjs\/content\/web\/.*\.js$/,

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

@ -25,11 +25,6 @@ browser.jar:
content/browser/logos/vpn-dark.svg (content/logos/vpn-dark.svg)
content/browser/logos/vpn-light.svg (content/logos/vpn-light.svg)
content/browser/logos/fxa-logo.svg (content/logos/fxa-logo.svg)
content/browser/certerror/aboutNetErrorCodes.js (content/certerror/aboutNetErrorCodes.js)
content/browser/certerror/aboutNetError.xhtml (content/certerror/aboutNetError.xhtml)
content/browser/certerror/aboutNetError.js (content/certerror/aboutNetError.js)
content/browser/certerror/supportpages/connection-not-secure.html (content/certerror/supportpages/connection-not-secure.html)
content/browser/certerror/supportpages/time-errors.html (content/certerror/supportpages/time-errors.html)
content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
content/browser/aboutFrameCrashed.html (content/aboutFrameCrashed.html)
content/browser/aboutTabCrashed.css (content/aboutTabCrashed.css)
@ -106,7 +101,5 @@ browser.jar:
content/browser/spotlight.js (content/spotlight.js)
* content/browser/default-bookmarks.html (content/default-bookmarks.html)
% override chrome://global/content/netError.xhtml chrome://browser/content/certerror/aboutNetError.xhtml
# L10n resources and overrides.
% override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties

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

@ -89,9 +89,3 @@ if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["MOZ_DEFAULT_BROWSER_AGENT"]:
DEFINES["MOZ_DEFAULT_BROWSER_AGENT"] = True
JAR_MANIFESTS += ["jar.mn"]
GeneratedFile(
"content/certerror/aboutNetErrorCodes.js",
script="content/certerror/gen_aboutneterror_codes.py",
inputs=["/browser/locales/en-US/browser/nsserrors.ftl"],
)

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

@ -592,22 +592,6 @@ let JSWINDOWACTORS = {
messageManagerGroups: ["browsers"],
},
NetError: {
parent: {
moduleURI: "resource:///actors/NetErrorParent.jsm",
},
child: {
moduleURI: "resource:///actors/NetErrorChild.jsm",
events: {
DOMDocElementInserted: {},
click: {},
},
},
matches: ["about:certerror?*", "about:neterror?*"],
allFrames: true,
},
PageInfo: {
child: {
esModuleURI: "resource:///actors/PageInfoChild.sys.mjs",

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

@ -49,7 +49,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"certerror", "chrome://browser/content/certerror/aboutNetError.xhtml",
{"certerror", "chrome://global/content/aboutNetError.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT},

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

@ -2,7 +2,7 @@
* 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/. */
@import url("chrome://browser/skin/error-pages.css");
@import url("chrome://global/skin/error-pages.css");
#header {
background: none;

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

@ -2,7 +2,7 @@
* 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/. */
@import url("chrome://browser/skin/error-pages.css");
@import url("chrome://global/skin/error-pages.css");
@media not (prefers-contrast) {
:root {

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

@ -8,7 +8,6 @@
# to the location of the actual manifest.
skin/classic/browser/aboutFrameCrashed.css (../shared/aboutFrameCrashed.css)
skin/classic/browser/aboutNetError.css (../shared/aboutNetError.css)
skin/classic/browser/aboutRestartRequired.css (../shared/aboutRestartRequired.css)
skin/classic/browser/aboutSessionRestore.css (../shared/aboutSessionRestore.css)
skin/classic/browser/aboutTabCrashed.css (../shared/aboutTabCrashed.css)
@ -19,10 +18,8 @@
skin/classic/browser/browser-shared.css (../shared/browser-shared.css)
skin/classic/browser/ctrlTab.css (../shared/ctrlTab.css)
skin/classic/browser/light-dark-overrides.css (../shared/light-dark-overrides.css)
skin/classic/browser/error-pages.css (../shared/error-pages.css)
skin/classic/browser/menupanel.css (../shared/menupanel.css)
skin/classic/browser/notification-icons.css (../shared/notification-icons.css)
skin/classic/browser/offlineSupportPages.css (../shared/offlineSupportPages.css)
skin/classic/browser/searchbar.css (../shared/searchbar.css)
skin/classic/browser/setDesktopBackground.css (../shared/setDesktopBackground.css)
skin/classic/browser/sidebar.css (../shared/sidebar.css)
@ -242,7 +239,6 @@
skin/classic/browser/translation-16@2x.png (../shared/translation/translation-16@2x.png)
skin/classic/browser/update-badge.svg (../shared/update-badge.svg)
skin/classic/browser/profiler-popup-backdrop.png (../shared/profiler-popup-backdrop.png)
skin/classic/browser/wifi.svg (../shared/incontent-icons/wifi.svg)
skin/classic/browser/tab-crashed.svg (../shared/incontent-icons/tab-crashed.svg)
skin/classic/browser/panic-panel/header.png (../shared/panic-panel/header.png)
skin/classic/browser/panic-panel/header@2x.png (../shared/panic-panel/header@2x.png)

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

@ -435,10 +435,6 @@ Example chrome manifest
-
- chrome://global/content/license.html
- chrome://browser/content/license.html
* - override
-
- chrome://global/content/netError.xhtml
- chrome://browser/content/certerror/aboutNetError.xhtml
* - resource
- payments
- browser/res/payments/

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

@ -114,7 +114,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::IS_SECURE_CHROME_UI},
{"mozilla", "chrome://global/content/mozilla.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT},
{"neterror", "chrome://global/content/netError.xhtml",
{"neterror", "chrome://global/content/aboutNetError.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT},

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

@ -4047,8 +4047,6 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
errorPageUrl.AppendLiteral("&captive=true");
}
// netError.xhtml's getDescription only handles the "d" parameter at the
// end of the URL, so append it last.
errorPageUrl.AppendLiteral("&d=");
errorPageUrl.AppendASCII(escapedDescription.get());

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

@ -14,7 +14,6 @@ DIRS += [
"base",
"shistory",
"build",
"resources/content",
]
XPCSHELL_TESTS_MANIFESTS += [

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

@ -1,7 +0,0 @@
# 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/.
toolkit.jar:
content/global/netError.xhtml
content/global/netError.js

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

@ -1,7 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
JAR_MANIFESTS += ["jar.mn"]

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

@ -1,279 +0,0 @@
/* 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/. */
// Error url MUST be formatted like this:
// moz-neterror:page?e=error&u=url&d=desc
//
// or optionally, to specify an alternate CSS class to allow for
// custom styling and favicon:
//
// moz-neterror:page?e=error&u=url&s=classname&d=desc
// Note that this file uses document.documentURI to get
// the URL (with the format from above). This is because
// document.location.href gets the current URI off the docshell,
// which is the URL displayed in the location bar, i.e.
// the URI that the user attempted to load.
function getErrorCode() {
var url = document.documentURI;
var error = url.search(/e\=/);
var duffUrl = url.search(/\&u\=/);
return decodeURIComponent(url.slice(error + 2, duffUrl));
}
function getCSSClass() {
var url = document.documentURI;
var matches = url.match(/s\=([^&]+)\&/);
// s is optional, if no match just return nothing
if (!matches || matches.length < 2) {
return "";
}
// parenthetical match is the second entry
return decodeURIComponent(matches[1]);
}
function getDescription() {
var url = document.documentURI;
var desc = url.search(/d\=/);
// desc == -1 if not found; if so, return an empty string
// instead of what would turn out to be portions of the URI
if (desc == -1) {
return "";
}
return decodeURIComponent(url.slice(desc + 2));
}
function retryThis(buttonEl) {
// Note: The application may wish to handle switching off "offline mode"
// before this event handler runs, but using a capturing event handler.
// Session history has the URL of the page that failed
// to load, not the one of the error page. So, just call
// reload(), which will also repost POST data correctly.
try {
location.reload();
} catch (e) {
// We probably tried to reload a URI that caused an exception to
// occur; e.g. a nonexistent file.
}
buttonEl.disabled = true;
}
function initPage() {
var err = getErrorCode();
// if it's an unknown error or there's no title or description
// defined, get the generic message
var errTitle = document.getElementById("et_" + err);
var errDesc = document.getElementById("ed_" + err);
if (!errTitle || !errDesc) {
errTitle = document.getElementById("et_generic");
errDesc = document.getElementById("ed_generic");
}
var title = document.getElementById("errorTitleText");
if (title) {
title.parentNode.replaceChild(errTitle, title);
// change id to the replaced child's id so styling works
errTitle.id = "errorTitleText";
}
var sd = document.getElementById("errorShortDescText");
if (sd) {
sd.textContent = getDescription();
}
var ld = document.getElementById("errorLongDesc");
if (ld) {
ld.parentNode.replaceChild(errDesc, ld);
// change id to the replaced child's id so styling works
errDesc.id = "errorLongDesc";
}
// remove undisplayed errors to avoid bug 39098
var errContainer = document.getElementById("errorContainer");
errContainer.remove();
var className = getCSSClass();
if (className && className != "expertBadCert") {
// Associate a CSS class with the root of the page, if one was passed in,
// to allow custom styling.
// Not "expertBadCert" though, don't want to deal with the favicon
document.documentElement.className = className;
// Also, if they specified a CSS class, they must supply their own
// favicon. In order to trigger the browser to repaint though, we
// need to remove/add the link element.
var favicon = document.getElementById("favicon");
var faviconParent = favicon.parentNode;
faviconParent.removeChild(favicon);
favicon.setAttribute(
"href",
"chrome://global/skin/icons/" + className + "_favicon.png"
);
faviconParent.appendChild(favicon);
}
if (className == "expertBadCert") {
showSecuritySection();
}
if (err == "cspBlocked" || err == "xfoBlocked") {
// Remove the "Try again" button for XFO and CSP violations, since it's
// almost certainly useless. (Bug 553180)
document.getElementById("errorTryAgain").style.display = "none";
}
if (err == "nssBadCert") {
// Remove the "Try again" button for security exceptions, since it's
// almost certainly useless.
document.getElementById("errorTryAgain").style.display = "none";
document
.getElementById("errorPageContainer")
.setAttribute("class", "certerror");
addDomainErrorLink();
} else {
// Remove the override block for non-certificate errors. CSS-hiding
// isn't good enough here, because of bug 39098
var secOverride = document.getElementById("securityOverrideDiv");
secOverride.remove();
}
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.
document.getElementById("errorTryAgain").style.display = "none";
var container = document.getElementById("errorLongDesc");
for (var span of container.querySelectorAll("span.hostname")) {
span.textContent = document.location.hostname;
}
}
if (document.getElementById("errorTryAgain").style.display != "none") {
addAutofocus("errorTryAgain");
}
}
function showSecuritySection() {
// Swap link out, content in
document.getElementById("securityOverrideContent").style.display = "";
document.getElementById("securityOverrideLink").style.display = "none";
}
/* In the case of SSL error pages about domain mismatch, see if
* we can hyperlink the user to the correct site. We don't want
* to do this generically since it allows MitM attacks to redirect
* users to a site under attacker control, but in certain cases
* it is safe (and helpful!) to do so. Bug 402210 */
function addDomainErrorLink() {
// Rather than textContent, we need to treat description as HTML
var sd = document.getElementById("errorShortDescText");
if (sd) {
var desc = getDescription();
// sanitize description text - see bug 441169
// First, find the index of the <a> tag we care about, being careful not to
// use an over-greedy regex
var re = /<a id="cert_domain_link" title="([^"]+)">/;
var result = re.exec(desc);
if (!result) {
return;
}
// Remove sd's existing children
sd.textContent = "";
// Everything up to the link should be text content
sd.appendChild(document.createTextNode(desc.slice(0, result.index)));
// Now create the link itself
var anchorEl = document.createElement("a");
anchorEl.setAttribute("id", "cert_domain_link");
anchorEl.setAttribute("title", result[1]);
anchorEl.appendChild(document.createTextNode(result[1]));
sd.appendChild(anchorEl);
// Finally, append text for anything after the closing </a>
sd.appendChild(
document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length))
);
}
var link = document.getElementById("cert_domain_link");
if (!link) {
return;
}
var okHost = link.getAttribute("title");
var thisHost = document.location.hostname;
var proto = document.location.protocol;
// If okHost is a wildcard domain ("*.example.com") let's
// use "www" instead. "*.example.com" isn't going to
// get anyone anywhere useful. bug 432491
okHost = okHost.replace(/^\*\./, "www.");
/* case #1:
* example.com uses an invalid security certificate.
*
* The certificate is only valid for www.example.com
*
* Make sure to include the "." ahead of thisHost so that
* a MitM attack on paypal.com doesn't hyperlink to "notpaypal.com"
*
* We'd normally just use a RegExp here except that we lack a
* library function to escape them properly (bug 248062), and
* domain names are famous for having '.' characters in them,
* which would allow spurious and possibly hostile matches.
*/
if (endsWith(okHost, "." + thisHost)) {
link.href = proto + okHost;
}
/* case #2:
* browser.garage.maemo.org uses an invalid security certificate.
*
* The certificate is only valid for garage.maemo.org
*/
if (endsWith(thisHost, "." + okHost)) {
link.href = proto + okHost;
}
}
function endsWith(haystack, needle) {
return haystack.slice(-needle.length) == needle;
}
/* Only do autofocus if we're the toplevel frame; otherwise we
* don't want to call attention to ourselves! The key part is
* that autofocus happens on insertion into the tree, so we
* can remove the button, add @autofocus, and reinsert the
* button. */
function addAutofocus(buttonId) {
if (window.top == window) {
let button = document.getElementById(buttonId);
let nextSibling = button.nextSibling;
let parent = button.parentNode;
button.remove();
button.setAttribute("autofocus", "true");
parent.insertBefore(button, nextSibling);
}
}
let errorTryAgain = document.getElementById("errorTryAgain");
errorTryAgain.addEventListener("click", function() {
retryThis(this);
});
// Note: It is important to run the script this way, instead of using
// an onload handler. This is because error pages are loaded as
// LOAD_BACKGROUND, which means that onload handlers will not be executed.
initPage();

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

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorAppDTD
SYSTEM "chrome://global/locale/netErrorApp.dtd">
%netErrorAppDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://global/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<!-- 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/. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
<title>&loadError.label;</title>
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
<!-- If the location of the favicon is changed here, the FAVICON_ERRORPAGE_URL symbol in
toolkit/components/places/src/nsFaviconService.h should be updated. -->
<link rel="icon" id="favicon" href="chrome://global/skin/icons/info.svg"/>
</head>
<body dir="&locale.dir;">
<!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
<div id="errorContainer">
<div id="errorTitlesContainer">
<h1 id="et_generic">&generic.title;</h1>
<h1 id="et_dnsNotFound">&dnsNotFound.title;</h1>
<h1 id="et_fileNotFound">&fileNotFound.title;</h1>
<h1 id="et_fileAccessDenied">&fileAccessDenied.title;</h1>
<h1 id="et_malformedURI">&malformedURI.title;</h1>
<h1 id="et_unknownProtocolFound">&unknownProtocolFound.title;</h1>
<h1 id="et_connectionFailure">&connectionFailure.title;</h1>
<h1 id="et_netTimeout">&netTimeout.title;</h1>
<h1 id="et_redirectLoop">&redirectLoop.title;</h1>
<h1 id="et_unknownSocketType">&unknownSocketType.title;</h1>
<h1 id="et_netReset">&netReset.title;</h1>
<h1 id="et_notCached">&notCached.title;</h1>
<h1 id="et_netOffline">&netOffline.title;</h1>
<h1 id="et_netInterrupt">&netInterrupt.title;</h1>
<h1 id="et_deniedPortAccess">&deniedPortAccess.title;</h1>
<h1 id="et_proxyResolveFailure">&proxyResolveFailure.title;</h1>
<h1 id="et_proxyConnectFailure">&proxyConnectFailure.title;</h1>
<h1 id="et_contentEncodingError">&contentEncodingError.title;</h1>
<h1 id="et_unsafeContentType">&unsafeContentType.title;</h1>
<h1 id="et_nssFailure2">&nssFailure2.title;</h1>
<h1 id="et_nssBadCert">&nssBadCert.title;</h1>
<h1 id="et_cspBlocked">&cspBlocked.title;</h1>
<h1 id="et_xfoBlocked">&xfoBlocked.title;</h1>
<h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
<h1 id="et_blockedByPolicy">&blockedByPolicy.title;</h1>
<h1 id="et_networkProtocolError">&networkProtocolError.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
<div id="ed_dnsNotFound">&dnsNotFound.longDesc;</div>
<div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
<div id="ed_fileAccessDenied">&fileAccessDenied.longDesc;</div>
<div id="ed_malformedURI">&malformedURI.longDesc;</div>
<div id="ed_unknownProtocolFound">&unknownProtocolFound.longDesc;</div>
<div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
<div id="ed_netTimeout">&netTimeout.longDesc;</div>
<div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
<div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
<div id="ed_netReset">&netReset.longDesc;</div>
<div id="ed_notCached">&notCached.longDesc;</div>
<div id="ed_netOffline">&netOffline.longDesc2;</div>
<div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
<div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
<div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc;</div>
<div id="ed_proxyConnectFailure">&proxyConnectFailure.longDesc;</div>
<div id="ed_contentEncodingError">&contentEncodingError.longDesc;</div>
<div id="ed_unsafeContentType">&unsafeContentType.longDesc;</div>
<div id="ed_nssFailure2">&nssFailure2.longDesc2;</div>
<div id="ed_nssBadCert">&nssBadCert.longDesc2;</div>
<div id="ed_cspBlocked">&cspBlocked.longDesc;</div>
<div id="ed_xfoBlocked">&xfoBlocked.longDesc;</div>
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
<div id="ed_blockedByPolicy"></div>
<div id="ed_networkProtocolError">&networkProtocolError.longDesc;</div>
</div>
</div>
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer">
<!-- Error Title -->
<div id="errorTitle">
<h1 id="errorTitleText" />
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
</div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc" />
<!-- Override section - For ssl errors only. Removed on init for other
error types. -->
<div id="securityOverrideDiv">
<a id="securityOverrideLink" href="javascript:showSecuritySection();" >&securityOverride.linkText;</a>
<div id="securityOverrideContent">&securityOverride.warningContent;</div>
</div>
</div>
<!-- Retry Button -->
<button id="errorTryAgain" autocomplete="off">&retry.label;</button>
</div>
<script src="chrome://global/content/netError.js"/>
</body>
</html>

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

@ -1,104 +0,0 @@
<!-- 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/. -->
<!ENTITY loadError.label "Page Load Error">
<!ENTITY retry.label "Try Again">
<!-- Specific error messages -->
<!ENTITY connectionFailure.title "Failed to Connect">
<!ENTITY connectionFailure.longDesc "<p>Though the site seems valid, the browser was unable to establish a connection.</p><ul><li>Could the site be temporarily unavailable? Try again later.</li><li>Are you unable to browse other sites? Check the computers network connection.</li><li>Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing.</li></ul>">
<!ENTITY deniedPortAccess.title "Port Restricted for Security Reasons">
<!ENTITY deniedPortAccess.longDesc "<p>The requested address specified a port (e.g. <q>mozilla.org:80</q> for port 80 on mozilla.org) normally used for purposes <em>other</em> than Web browsing. The browser has canceled the request for your protection and security.</p>">
<!ENTITY dnsNotFound.title "Address Not Found">
<!ENTITY dnsNotFound.longDesc "<p>The browser could not find the host server for the provided address.</p><ul><li>Did you make a mistake when typing the domain? (e.g. <q><strong>ww</strong>.mozilla.org</q> instead of <q><strong>www</strong>.mozilla.org</q>)</li><li>Are you certain this domain address exists? Its registration may have expired.</li><li>Are you unable to browse other sites? Check your network connection and DNS server settings.</li><li>Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing.</li></ul>">
<!ENTITY fileNotFound.title "File Not Found">
<!ENTITY fileNotFound.longDesc "<ul><li>Could the item have been renamed, removed, or relocated?</li><li>Is there a spelling, capitalization, or other typographical error in the address?</li><li>Do you have sufficient access permissions to the requested item?</li></ul>">
<!ENTITY fileAccessDenied.title "Access to the file was denied">
<!ENTITY fileAccessDenied.longDesc "<ul><li>It may have been removed, moved, or file permissions may be preventing access.</li></ul>">
<!ENTITY generic.title "Cannot Complete Request">
<!ENTITY generic.longDesc "<p>Additional information about this problem or error is currently unavailable.</p>">
<!ENTITY malformedURI.title "Invalid Address">
<!ENTITY malformedURI.longDesc "<p>The provided address is not in a recognized format. Please check the location bar for mistakes and try again.</p>">
<!ENTITY netInterrupt.title "Data Transfer Interrupted">
<!ENTITY netInterrupt.longDesc "<p>The browser connected successfully, but the connection was interrupted while transferring information. Please try again.</p><ul><li>Are you unable to browse other sites? Check the computers network connection.</li><li>Still having trouble? Consult your network administrator or Internet provider for assistance.</li></ul>">
<!ENTITY notCached.title "Document Expired">
<!ENTITY notCached.longDesc "<p>The requested document is not available in the browsers cache.</p><ul><li>As a security precaution, the browser does not automatically re-request sensitive documents.</li><li>Click Try Again to re-request the document from the website.</li></ul>">
<!ENTITY netOffline.title "Offline Mode">
<!ENTITY netOffline.longDesc2 "<p>The browser is operating in its offline mode and cannot connect to the requested item.</p><ul><li>Is the computer connected to an active network?</li><li>Press &quot;Try Again&quot; to switch to online mode and reload the page.</li></ul>">
<!ENTITY contentEncodingError.title "Content Encoding Error">
<!ENTITY contentEncodingError.longDesc "<p>The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY unsafeContentType.title "Unsafe File Type">
<!ENTITY unsafeContentType.longDesc "
<ul>
<li>Please contact the website owners to inform them of this problem.</li>
</ul>
">
<!ENTITY netReset.title "Connection Interrupted">
<!ENTITY netReset.longDesc "<p>The network link was interrupted while negotiating a connection. Please try again.</p>">
<!ENTITY netTimeout.title "Network Timeout">
<!ENTITY netTimeout.longDesc "<p>The requested site did not respond to a connection request and the browser has stopped waiting for a reply.</p><ul><li>Could the server be experiencing high demand or a temporary outage? Try again later.</li><li>Are you unable to browse other sites? Check the computers network connection.</li><li>Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing.</li><li>Still having trouble? Consult your network administrator or Internet provider for assistance.</li></ul>">
<!ENTITY unknownProtocolFound.title "Unknown Protocol">
<!ENTITY unknownProtocolFound.longDesc "<p>The address specifies a protocol (e.g. <q>wxyz://</q>) the browser does not recognize, so the browser cannot properly connect to the site.</p><ul><li>Are you trying to access multimedia or other non-text services? Check the site for extra requirements.</li><li>Some protocols may require third-party software or plugins before the browser can recognize them.</li></ul>">
<!ENTITY proxyConnectFailure.title "Proxy Server Refused Connection">
<!ENTITY proxyConnectFailure.longDesc "<p>The browser is configured to use a proxy server, but the proxy refused a connection.</p><ul><li>Is the browsers proxy configuration correct? Check the settings and try again.</li><li>Does the proxy service allow connections from this network?</li><li>Still having trouble? Consult your network administrator or Internet provider for assistance.</li></ul>">
<!ENTITY proxyResolveFailure.title "Proxy Server Not Found">
<!ENTITY proxyResolveFailure.longDesc "<p>The browser is configured to use a proxy server, but the proxy could not be found.</p><ul><li>Is the browsers proxy configuration correct? Check the settings and try again.</li><li>Is the computer connected to an active network?</li><li>Still having trouble? Consult your network administrator or Internet provider for assistance.</li></ul>">
<!ENTITY redirectLoop.title "Redirect Loop">
<!ENTITY redirectLoop.longDesc "<p>The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.</p><ul><li>Have you disabled or blocked cookies required by this site?</li><li><em>NOTE</em>: If accepting the sites cookies does not resolve the problem, it is likely a server configuration issue and not your computer.</li></ul>">
<!ENTITY unknownSocketType.title "Incorrect Response">
<!ENTITY unknownSocketType.longDesc "<p>The site responded to the network request in an unexpected way and the browser cannot continue.</p>">
<!ENTITY nssFailure2.title "Secure Connection Failed">
<!ENTITY nssFailure2.longDesc2 "<p>The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY nssBadCert.title "Secure Connection Failed">
<!ENTITY nssBadCert.longDesc2 "<ul>
<li>This could be a problem with the servers configuration, or it could be someone trying to impersonate the server.</li>
<li>If you have connected to this server successfully in the past, the error may be temporary, and you can try again later.</li>
</ul>
">
<!ENTITY securityOverride.linkText "Or you can add an exception…">
<!ENTITY securityOverride.warningContent "
<p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
<p>If you still wish to add an exception for this site, you can do so in your advanced encryption settings.</p>
">
<!ENTITY cspBlocked.title "Blocked by Content Security Policy">
<!ENTITY cspBlocked.longDesc "<p>The browser prevented this page from loading in this way because the page has a content security policy that disallows it.</p>">
<!ENTITY xfoBlocked.title "Blocked by X-Frame-Options Policy">
<!ENTITY xfoBlocked.longDesc "<p>The browser prevented this page from loading in this context because the page has an X-Frame-Options policy that disallows it.</p>">
<!ENTITY corruptedContentErrorv2.title "Corrupted Content Error">
<!ENTITY corruptedContentErrorv2.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY inadequateSecurityError.title "Your connection is not secure">
<!-- LOCALIZATION NOTE (inadequateSecurityError.longDesc) - Do not translate
"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 blockedByPolicy.title "Blocked Page">
<!ENTITY networkProtocolError.title "Network Protocol Error">
<!ENTITY networkProtocolError.longDesc "<p>The page you are trying to view cannot be shown because an error in the network protocol was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">

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

@ -1,23 +0,0 @@
<!-- 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/. -->
<!-- This file exists to allow applications to override one or more messages
from netError.dtd; Applications which want to do this should override
this file with their own version of netErrorApp.dtd -->
<!-- An example (from Firefox):
<!ENTITY securityOverride.linkText "Or you can add an exception…">
<!ENTITY securityOverride.getMeOutOfHereButton "Get me out of here!">
<!ENTITY securityOverride.exceptionButtonLabel "Add Exception…">
<!ENTITY securityOverride.warningContent "
<p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
<p>If you still wish to add an exception for this site, you can do so in your advanced encryption settings.</p>
<button id='getMeOutOfHereButton'>&securityOverride.getMeOutOfHereButton;</button>
<button id='exceptionDialogButton'>&securityOverride.exceptionButtonLabel;</button>
">
-->

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

@ -11,8 +11,6 @@
locale/@AB_CD@/global/xul.properties (%chrome/layout/xul.properties)
locale/@AB_CD@/global/printing.properties (%chrome/layout/printing.properties)
locale/@AB_CD@/global/layout_errors.properties (%chrome/layout/layout_errors.properties)
locale/@AB_CD@/global/netError.dtd (%chrome/netError.dtd)
locale/@AB_CD@/global/netErrorApp.dtd (%chrome/netErrorApp.dtd)
locale/@AB_CD@/global/global.dtd (%chrome/global.dtd)
locale/@AB_CD@/global/appstrings.properties (%chrome/appstrings.properties)
locale/@AB_CD@/global/global-strres.properties (%chrome/global-strres.properties)

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

@ -72,7 +72,7 @@ def migrate(ctx):
"""Bug 1734217 - Migrate aboutNetError.xhtml from DTD to Fluent, part {index}"""
source = "browser/chrome/overrides/netError.dtd"
target = "browser/browser/netError.ftl"
target = "toolkit/toolkit/neterror/netError.ftl"
ctx.add_transforms(
target,
target,
@ -176,7 +176,7 @@ neterror-dns-not-found-hint-try-again = { COPY_PATTERN(prev, "dns-not-found-hint
neterror-dns-not-found-hint-check-network = { COPY_PATTERN(prev, "dns-not-found-hint-check-network") }
neterror-dns-not-found-hint-firewall = { COPY_PATTERN(prev, "dns-not-found-hint-firewall") }
""",
prev=target,
prev="browser/browser/netError.ftl",
)
+ [
# file-not-found-long-desc = { COPY(source, "fileNotFound.longDesc") }

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

@ -314,7 +314,7 @@ class TestUrlFinder(unittest.TestCase):
],
},
{
"chrome://global/content/netError.xhtml": "chrome://browser/content/certerror/aboutNetError.xhtml", # NOQA: E501
"chrome://global/content/license.html": "chrome://browser/content/license.html",
},
{
"dist/bin/components/MainProcessSingleton.js": ["path1", None],
@ -330,8 +330,8 @@ class TestUrlFinder(unittest.TestCase):
"browser/components/newtab/lib/*",
None,
],
"dist/bin/browser/chrome/browser/content/browser/certerror/aboutNetError.xhtml": [
"browser/base/content/certerror/aboutNetError.xhtml",
"dist/bin/browser/chrome/browser/content/browser/license.html": [
"browser/base/content/license.html",
None,
],
"dist/bin/modules/AppConstants.jsm": [
@ -402,8 +402,8 @@ class TestUrlFinder(unittest.TestCase):
),
# Path which is in url overrides
(
"chrome://global/content/netError.xhtml",
("browser/base/content/certerror/aboutNetError.xhtml", None),
"chrome://global/content/license.html",
("browser/base/content/license.html", None),
),
# Path which ends with > eval
(

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

@ -9,14 +9,6 @@ const { RemotePageChild } = ChromeUtils.import(
"resource://gre/actors/RemotePageChild.jsm"
);
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"UrlbarUtils",
"resource:///modules/UrlbarUtils.jsm"
);
class NetErrorChild extends RemotePageChild {
actorCreated() {
super.actorCreated();
@ -84,8 +76,12 @@ class NetErrorChild extends RemotePageChild {
}
RPMCheckAlternateHostAvailable() {
let host = this.contentWindow.location.host;
if (!lazy.UrlbarUtils.looksLikeSingleWordHost(host)) {
const host = this.contentWindow.location.host.trim();
// Adapted from UrlbarUtils::looksLikeSingleWordHost
// https://searchfox.org/mozilla-central/rev/a26af613a476fafe6c3eba05a81bef63dff3c9f1/browser/components/urlbar/UrlbarUtils.sys.mjs#893
const REGEXP_SINGLE_WORD = /^[^\s@:/?#]+(:\d+)?$/;
if (!REGEXP_SINGLE_WORD.test(host)) {
return;
}

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

@ -5,10 +5,13 @@
var EXPORTED_SYMBOLS = ["NetErrorParent"];
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const { PrivateBrowsingUtils } = ChromeUtils.import(
"resource://gre/modules/PrivateBrowsingUtils.jsm"
);
const { HomePage } = ChromeUtils.import("resource:///modules/HomePage.jsm");
const { TelemetryController } = ChromeUtils.import(
"resource://gre/modules/TelemetryController.jsm"
@ -26,6 +29,12 @@ ChromeUtils.defineESModuleGetters(lazy, {
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"HomePage",
"resource:///modules/HomePage.jsm"
);
class CaptivePortalObserver {
constructor(actor) {
this.actor = actor;
@ -118,10 +127,15 @@ class NetErrorParent extends JSWindowActorParent {
* infected, so we can get them somewhere safe.
*/
getDefaultHomePage(win) {
if (PrivateBrowsingUtils.isWindowPrivate(win)) {
return win.BROWSER_NEW_TAB_URL;
let url;
if (
!PrivateBrowsingUtils.isWindowPrivate(win) &&
AppConstants.MOZ_BUILD_APP == "browser"
) {
url = lazy.HomePage.getDefault();
}
let url = HomePage.getDefault();
url ||= win.BROWSER_NEW_TAB_URL || "about:blank";
// If url is a pipe-delimited set of pages, just take the first one.
if (url.includes("|")) {
url = url.split("|")[0];
@ -237,7 +251,7 @@ class NetErrorParent extends JSWindowActorParent {
return;
}
let offlinePagePath = `chrome://browser/content/certerror/supportpages/${supportPageSlug}.html`;
let offlinePagePath = `chrome://global/content/neterror/supportpages/${supportPageSlug}.html`;
let triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
this.browser.loadURI(offlinePagePath, { triggeringPrincipal });
}
@ -299,14 +313,19 @@ class NetErrorParent extends JSWindowActorParent {
case "Browser:CertExceptionError":
switch (message.data.elementId) {
case "viewCertificate": {
let window = this.browser.ownerGlobal;
let certs = message.data.failedCertChain.map(certBase64 =>
encodeURIComponent(certBase64)
);
let certsStringURL = certs.map(elem => `cert=${elem}`);
certsStringURL = certsStringURL.join("&");
let url = `about:certificate?${certsStringURL}`;
window.switchToTabHavingURI(url, true, {});
let window = this.browser.ownerGlobal;
if (AppConstants.MOZ_BUILD_APP === "browser") {
window.switchToTabHavingURI(url, true, {});
} else {
window.open(url, "_blank");
}
break;
}
}

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

@ -61,6 +61,8 @@ FINAL_TARGET_FILES.actors += [
"InlineSpellCheckerChild.jsm",
"InlineSpellCheckerParent.jsm",
"KeyPressEventModelCheckerChild.jsm",
"NetErrorChild.jsm",
"NetErrorParent.jsm",
"PictureInPictureChild.sys.mjs",
"PopupBlockingChild.jsm",
"PopupBlockingParent.jsm",

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

@ -109,7 +109,7 @@ add_task(async function() {
info("Test error icon");
// This error icon must stay in sync with FAVICON_ERRORPAGE_URL in
// nsIFaviconService.idl, aboutCertError.xhtml and netError.xhtml.
// nsIFaviconService.idl and aboutNetError.xhtml.
let faviconErrorPageURI = Services.io.newURI(
"chrome://global/skin/icons/info.svg"
);

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

@ -3,6 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/remote-page */
/* eslint-disable import/no-unassigned-import */
import "chrome://global/content/certviewer/pvutils_bundle.jsm";
import "chrome://global/content/certviewer/asn1js_bundle.jsm";

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

@ -11,12 +11,12 @@
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
<meta name="color-scheme" content="light dark" />
<title data-l10n-id="neterror-page-title"></title>
<link rel="stylesheet" href="chrome://browser/skin/aboutNetError.css" type="text/css" media="all" />
<link rel="stylesheet" href="chrome://global/skin/aboutNetError.css" type="text/css" media="all" />
<link rel="icon" id="favicon"/>
<link rel="localization" href="browser/aboutCertError.ftl" />
<link rel="localization" href="browser/nsserrors.ftl" />
<link rel="localization" href="branding/brand.ftl"/>
<link rel="localization" href="browser/netError.ftl"/>
<link rel="localization" href="toolkit/neterror/certError.ftl" />
<link rel="localization" href="toolkit/neterror/netError.ftl"/>
<link rel="localization" href="toolkit/neterror/nsserrors.ftl" />
</head>
<body>
@ -111,6 +111,6 @@
</div>
</div>
</body>
<script src="chrome://browser/content/certerror/aboutNetErrorCodes.js"></script>
<script type="module" src="chrome://browser/content/certerror/aboutNetError.js"></script>
<script src="chrome://global/content/neterror/aboutNetErrorCodes.js"></script>
<script type="module" src="chrome://global/content/aboutNetError.mjs"></script>
</html>

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

@ -6,11 +6,8 @@ toolkit.jar:
content/global/autocomplete.css
content/global/aboutAbout.js
content/global/aboutAbout.html
#ifdef MOZILLA_OFFICIAL
content/global/aboutRights.xhtml
#else
content/global/aboutRights.xhtml (aboutRights-unbranded.xhtml)
#endif
content/global/aboutNetError.mjs
content/global/aboutNetError.xhtml
content/global/aboutNetworking.js
content/global/aboutNetworking.html
#ifndef ANDROID
@ -18,6 +15,11 @@ toolkit.jar:
content/global/aboutProfiles.xhtml
#endif
content/global/aboutRights.js
#ifdef MOZILLA_OFFICIAL
content/global/aboutRights.xhtml
#else
content/global/aboutRights.xhtml (aboutRights-unbranded.xhtml)
#endif
content/global/aboutServiceWorkers.js
content/global/aboutServiceWorkers.xhtml
content/global/aboutwebrtc/aboutWebrtc.css (aboutwebrtc/aboutWebrtc.css)
@ -108,6 +110,9 @@ toolkit.jar:
content/global/elements/videocontrols.js (widgets/videocontrols.js)
content/global/elements/tree.js (widgets/tree.js)
content/global/elements/wizard.js (widgets/wizard.js)
content/global/neterror/aboutNetErrorCodes.js (neterror/aboutNetErrorCodes.js)
content/global/neterror/supportpages/connection-not-secure.html (neterror/supportpages/connection-not-secure.html)
content/global/neterror/supportpages/time-errors.html (neterror/supportpages/time-errors.html)
#ifdef XP_MACOSX
content/global/macWindowMenu.js
#endif

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

@ -214,6 +214,9 @@ with Files("about*"):
with Files("aboutGlean.*"):
BUG_COMPONENT = ("Toolkit", "Telemetry")
with Files("aboutNetError*"):
BUG_COMPONENT = ("Firefox", "Security")
with Files("aboutNetworking*"):
BUG_COMPONENT = ("Core", "Networking")

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

@ -7,7 +7,7 @@
<meta http-equiv="Content-Security-Policy" content="connect-src https:; default-src chrome:; object-src 'none'">
<meta name="referrer" content="no-referrer">
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="chrome://browser/skin/offlineSupportPages.css">
<link rel="stylesheet" type="text/css" href="chrome://global/skin/offlineSupportPages.css">
<link rel="icon" type="image/png" id="favicon" href="chrome://branding/content/icon32.png"/>
<title>Secure connection failed and Firefox did not connect</title>
</head>

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

@ -7,7 +7,7 @@
<meta http-equiv="Content-Security-Policy" content="connect-src https:; default-src chrome:; object-src 'none'">
<meta name="referrer" content="no-referrer">
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="chrome://browser/skin/offlineSupportPages.css">
<link rel="stylesheet" type="text/css" href="chrome://global/skin/offlineSupportPages.css">
<link rel="icon" type="image/png" id="favicon" href="chrome://branding/content/icon32.png"/>
<title>How to troubleshoot time related errors on secure websites</title>
</head>

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

@ -332,6 +332,22 @@ let JSWINDOWACTORS = {
},
},
NetError: {
parent: {
moduleURI: "resource://gre/actors/NetErrorParent.jsm",
},
child: {
moduleURI: "resource://gre/actors/NetErrorChild.jsm",
events: {
DOMDocElementInserted: {},
click: {},
},
},
matches: ["about:certerror?*", "about:neterror?*"],
allFrames: true,
},
PictureInPictureLauncher: {
parent: {
esModuleURI: "resource://gre/modules/PictureInPicture.sys.mjs",

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

@ -83,3 +83,9 @@ with Files("mozapps/preferences/**"):
with Files("l10n-registry.manifest"):
BUG_COMPONENT = ("Core", "Localization")
GeneratedFile(
"content/neterror/aboutNetErrorCodes.js",
script="content/neterror/gen_aboutneterror_codes.py",
inputs=["/toolkit/locales/en-US/toolkit/neterror/nsserrors.ftl"],
)

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

@ -2,7 +2,7 @@
* 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/. */
@import url("chrome://browser/skin/error-pages.css");
@import url("chrome://global/skin/error-pages.css");
body {
--warning-color: #ffa436;
@ -25,7 +25,7 @@ body.certerror {
}
body.captiveportal .title {
background-image: url("wifi.svg");
background-image: url("chrome://global/skin/in-content/wifi.svg");
}
body.certerror .title {

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

@ -14,6 +14,7 @@
skin/classic/global/aboutCacheEntry.css (../../shared/aboutCacheEntry.css)
skin/classic/global/aboutHttpsOnlyError.css (../../shared/aboutHttpsOnlyError.css)
skin/classic/global/aboutMemory.css (../../shared/aboutMemory.css)
skin/classic/global/aboutNetError.css (../../shared/aboutNetError.css)
skin/classic/global/aboutNetworking.css (../../shared/aboutNetworking.css)
skin/classic/global/aboutReader.css (../../shared/aboutReader.css)
skin/classic/global/aboutReaderPocket.css (../../shared/aboutReaderPocket.css)
@ -27,12 +28,14 @@
skin/classic/global/close-icon.css (../../shared/close-icon.css)
skin/classic/global/commonDialog.css (../../shared/commonDialog.css)
skin/classic/global/datetimeinputpickers.css (../../shared/datetimeinputpickers.css)
skin/classic/global/error-pages.css (../../shared/error-pages.css)
skin/classic/global/findbar.css (../../shared/findbar.css)
skin/classic/global/global-shared.css (../../shared/global-shared.css)
skin/classic/global/menu-scrolling.css (../../shared/menu-scrolling.css)
skin/classic/global/menulist-shared.css (../../shared/menulist-shared.css)
skin/classic/global/notification.css (../../shared/notification.css)
skin/classic/global/numberinput.css (../../shared/numberinput.css)
skin/classic/global/offlineSupportPages.css (../../shared/offlineSupportPages.css)
skin/classic/global/popupnotification.css (../../shared/popupnotification.css)
skin/classic/global/tree.css (../../shared/tree.css)
skin/classic/global/dirListing/dirListing.css (../../shared/dirListing/dirListing.css)
@ -46,6 +49,7 @@
skin/classic/global/in-content/common-shared.css (../../shared/in-content/common-shared.css)
skin/classic/global/in-content/info-pages.css (../../shared/in-content/info-pages.css)
skin/classic/global/in-content/toggle-button.css (../../shared/in-content/toggle-button.css)
skin/classic/global/in-content/wifi.svg (../../shared/in-content/wifi.svg)
skin/classic/global/icons/arrow-left.svg (../../shared/icons/arrow-left.svg)
skin/classic/global/icons/arrow-right.svg (../../shared/icons/arrow-right.svg)
skin/classic/global/icons/autoscroll.svg (../../shared/icons/autoscroll.svg)

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

До

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

После

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

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

@ -13,7 +13,6 @@
toolkit.jar:
% skin global classic/1.0 %skin/classic/global/
skin/classic/global/netError.css (../../shared/netError.css)
# images and CSS we need for widgets like video controls
skin/classic/global/icons/resizer.svg (../../shared/icons/resizer.svg)

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

@ -1,88 +0,0 @@
/* 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/. */
/*
* This defines the look-and-feel styling of the error pages.
* (see: netError.xhtml)
*
* Original styling by William Price <bugzilla@mob.rice.edu>
* Updated by: Steven Garrity <steven@silverorange.com>
* Henrik Skupin <mozilla@hskupin.info>
*/
html {
background: -moz-Dialog;
}
body {
margin: 0;
padding: 0 1em;
color: FieldText;
font: message-box;
}
h1 {
margin: 0 0 .6em;
border-bottom: 1px solid ThreeDLightShadow;
font-size: 160%;
}
ul,
ol {
margin: 0;
margin-inline-start: 1.5em;
padding: 0;
}
ul > li,
ol > li {
margin-bottom: .5em;
}
ul {
list-style: square;
}
#errorPageContainer {
position: relative;
min-width: 13em;
max-width: 52em;
margin: 4em auto;
border: 1px solid ThreeDShadow;
border-radius: 10px;
padding: 3em;
}
#errorShortDesc > p {
overflow: auto;
border-bottom: 1px solid ThreeDLightShadow;
padding-bottom: 1em;
font-size: 130%;
white-space: pre-wrap;
}
#errorLongDesc {
padding-inline-end: 3em;
font-size: 110%;
}
#errorTryAgain {
margin-top: 2em;
}
#errorContainer {
display: none;
}
#securityOverrideDiv {
padding-top: 10px;
}
#securityOverrideContent {
background-color: InfoBackground;
color: InfoText;
padding: 10px;
border-radius: 10px;
display: none;
}

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

@ -167,8 +167,6 @@
"mobile/android/actors/MediaControlDelegateChild.jsm",
"resource:///actors/MediaControlDelegateParent.jsm":
"mobile/android/actors/MediaControlDelegateParent.jsm",
"resource:///actors/NetErrorChild.jsm": "browser/actors/NetErrorChild.jsm",
"resource:///actors/NetErrorParent.jsm": "browser/actors/NetErrorParent.jsm",
"resource:///actors/PageDataChild.jsm":
"browser/components/pagedata/PageDataChild.jsm",
"resource:///actors/PageDataParent.jsm":
@ -857,6 +855,9 @@
"toolkit/actors/KeyPressEventModelCheckerChild.jsm",
"resource://gre/actors/LayoutDebugChild.jsm":
"layout/tools/layout-debug/LayoutDebugChild.jsm",
"resource://gre/actors/NetErrorChild.jsm": "toolkit/actors/NetErrorChild.jsm",
"resource://gre/actors/NetErrorParent.jsm":
"toolkit/actors/NetErrorParent.jsm",
"resource://gre/actors/PictureInPictureChild.jsm":
"toolkit/actors/PictureInPictureChild.jsm",
"resource://gre/actors/PopupBlockingChild.jsm":

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

@ -48,7 +48,7 @@ ID01:
- bottomLinks-privacy
- aboutDialog-version
- aboutDialog-version-nightly
# aboutCertError.ftl: These IDs are generated programmatically
# certError.ftl: These IDs are generated programmatically
# from certificate error codes.
- connectionFailure-title
- deniedPortAccess-title
@ -141,7 +141,7 @@ CO01:
# browser/branding/official/locales/en-US/brand.ftl
# browser/locales/en-US/browser/branding/brandings.ftl
- trademarkInfo
# browser/locales/en-US/browser/aboutCertError.ftl
# toolkit/locales/en-US/toolkit/neterror/certError.ftl
- cert-error-mitm-mozilla
- cert-error-mitm-connection
# browser/locales/en-US/browser/appExtensionFields.ftl