Skip to content

Commit a94d5c5

Browse files
committed
Bug 1874701 - Convert aboutNetError to an html page. r=Gijs,valentin
While I'm looking at this / bug 1866884, this it probably makes sense, wdyt? Differential Revision: https://phabricator.services.mozilla.com/D198571
1 parent ec149cc commit a94d5c5

File tree

6 files changed

+22
-34
lines changed

6 files changed

+22
-34
lines changed

browser/components/about/AboutRedirector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static const RedirEntry kRedirMap[] = {
5353
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
5454
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
5555
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
56-
{"certerror", "chrome://global/content/aboutNetError.xhtml",
56+
{"certerror", "chrome://global/content/aboutNetError.html",
5757
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
5858
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
5959
nsIAboutModule::HIDE_FROM_ABOUTABOUT},

docshell/base/nsAboutRedirector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static const RedirEntry kRedirMap[] = {
135135
{"webauthn", "chrome://global/content/aboutWebauthn.html",
136136
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
137137
#endif
138-
{"neterror", "chrome://global/content/aboutNetError.xhtml",
138+
{"neterror", "chrome://global/content/aboutNetError.html",
139139
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
140140
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
141141
nsIAboutModule::HIDE_FROM_ABOUTABOUT},

modules/libjar/nsJARChannel.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -892,14 +892,7 @@ static void RecordZeroLengthEvent(bool aIsSync, const nsCString& aSpec,
892892
// entire string, or 80 characters of it, to make sure we don't miss any
893893
// events.
894894
uint32_t from = findFilenameStart(aSpec);
895-
nsAutoCString fileName(Substring(aSpec, from));
896-
897-
// Bug 1702937: Filter aboutNetError.xhtml.
898-
// Note that aboutNetError.xhtml is causing ~90% of the XHTML error events. We
899-
// should investigate this in the future.
900-
if (StringEndsWith(fileName, "aboutNetError.xhtml"_ns)) {
901-
return;
902-
}
895+
const auto fileName = Substring(aSpec, from);
903896

904897
nsAutoCString errorCString;
905898
mozilla::GetErrorName(aStatus, errorCString);
@@ -1031,7 +1024,8 @@ static void RecordZeroLengthEvent(bool aIsSync, const nsCString& aSpec,
10311024
res.SetCapacity(4);
10321025
res.AppendElement(
10331026
Telemetry::EventExtraEntry{"sync"_ns, aIsSync ? "true"_ns : "false"_ns});
1034-
res.AppendElement(Telemetry::EventExtraEntry{"file_name"_ns, fileName});
1027+
res.AppendElement(
1028+
Telemetry::EventExtraEntry{"file_name"_ns, nsCString(fileName)});
10351029
res.AppendElement(Telemetry::EventExtraEntry{"status"_ns, errorCString});
10361030
res.AppendElement(Telemetry::EventExtraEntry{
10371031
"cancelled"_ns, aCanceled ? "true"_ns : "false"_ns});

toolkit/components/places/tests/favicons/test_setAndFetchFaviconForPage_failures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ add_task(async function () {
108108

109109
info("Test error icon");
110110
// This error icon must stay in sync with FAVICON_ERRORPAGE_URL in
111-
// nsIFaviconService.idl and aboutNetError.xhtml.
111+
// nsIFaviconService.idl and aboutNetError.html.
112112
let faviconErrorPageURI = Services.io.newURI(
113113
"chrome://global/skin/icons/info.svg"
114114
);

toolkit/content/aboutNetError.xhtml renamed to toolkit/content/aboutNetError.html

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
31
<!DOCTYPE html>
4-
52
<!-- This Source Code Form is subject to the terms of the Mozilla Public
63
- License, v. 2.0. If a copy of the MPL was not distributed with this
74
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
8-
9-
<html xmlns="http://www.w3.org/1999/xhtml" data-l10n-sync="true">
5+
<html data-l10n-sync="true">
106
<head>
11-
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
12-
<meta name="color-scheme" content="light dark" />
7+
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'">
8+
<meta name="color-scheme" content="light dark">
139
<title data-l10n-id="neterror-page-title"></title>
14-
<link rel="stylesheet" href="chrome://global/skin/aboutNetError.css" type="text/css" media="all" />
15-
<link rel="icon" id="favicon"/>
16-
<link rel="localization" href="branding/brand.ftl"/>
17-
<link rel="localization" href="toolkit/neterror/certError.ftl" />
18-
<link rel="localization" href="toolkit/neterror/netError.ftl"/>
10+
<link rel="stylesheet" href="chrome://global/skin/aboutNetError.css" type="text/css" media="all">
11+
<link rel="icon" id="favicon">
12+
<link rel="localization" href="branding/brand.ftl">
13+
<link rel="localization" href="toolkit/neterror/certError.ftl">
14+
<link rel="localization" href="toolkit/neterror/netError.ftl">
1915
</head>
20-
2116
<body>
22-
<!-- PAGE CONTAINER (for styling purposes only) -->
2317
<div class="container">
2418
<div id="text-container">
2519
<!-- Error Title -->
@@ -40,7 +34,7 @@ <h1 class="title-text"></h1>
4034
<!-- Long Description -->
4135
<div id="errorLongDesc"></div>
4236

43-
<p id="trrOnlyContainer" hidden="">
37+
<div id="trrOnlyContainer" hidden="">
4438
<p id="trrOnlyMessage"></p>
4539
<div class="trr-message-container">
4640
<span id="trrOnlyDescription"></span>
@@ -49,9 +43,9 @@ <h1 class="title-text"></h1>
4943
</p>
5044
</div>
5145
<p data-l10n-id="neterror-dns-not-found-trr-third-party-warning2"> </p>
52-
</p>
46+
</div>
5347

54-
<p id="nativeFallbackContainer" hidden="">
48+
<div id="nativeFallbackContainer" hidden="">
5549
<p id="nativeFallbackMessage"></p>
5650
<div class="trr-message-container">
5751
<span id="nativeFallbackDescription"></span>
@@ -60,7 +54,7 @@ <h1 class="title-text"></h1>
6054
</p>
6155
</div>
6256
<p data-l10n-id="neterror-dns-not-found-trr-third-party-warning2"> </p>
63-
</p>
57+
</div>
6458

6559
<p id="tlsVersionNotice" hidden=""></p>
6660

@@ -109,7 +103,7 @@ <h1 class="title-text"></h1>
109103

110104
<div id="blockingErrorReporting" class="advanced-panel" hidden="">
111105
<p class="toggle-container-with-text">
112-
<input type="checkbox" id="automaticallyReportBlockingInFuture" role="checkbox"/>
106+
<input type="checkbox" id="automaticallyReportBlockingInFuture" role="checkbox">
113107
<label for="automaticallyReportBlockingInFuture" data-l10n-id="neterror-error-reporting-automatic"></label>
114108
</p>
115109
</div>
@@ -121,7 +115,7 @@ <h1 class="title-text"></h1>
121115
</div>
122116
</div>
123117
</div>
118+
<script src="chrome://global/content/neterror/aboutNetErrorCodes.js"></script>
119+
<script type="module" src="chrome://global/content/aboutNetError.mjs"></script>
124120
</body>
125-
<script src="chrome://global/content/neterror/aboutNetErrorCodes.js"></script>
126-
<script type="module" src="chrome://global/content/aboutNetError.mjs"></script>
127121
</html>

toolkit/content/jar.mn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toolkit.jar:
88
content/global/aboutLogging.js
99
content/global/aboutLogging.html
1010
content/global/aboutNetError.mjs
11-
content/global/aboutNetError.xhtml
11+
content/global/aboutNetError.html
1212
content/global/aboutNetworking.js
1313
content/global/aboutNetworking.html
1414
#ifndef ANDROID

0 commit comments

Comments
 (0)