Commits:
-
267147ef
by Henry Wilkes at 2024-04-17T18:28:11+00:00
fixup! Bug 30237: Add v3 onion services client authentication prompt
Bug 41622: Follow net error style from mozilla.
We drop our additions to the page and work with the existing files from
mozilla.
-
79f14f9e
by Henry Wilkes at 2024-04-17T18:28:11+00:00
fixup! Tor Browser strings
Bug 41622: Move net error page strings to Fluent.
-
57dffc45
by Henry Wilkes at 2024-04-17T18:28:11+00:00
fixup! Bug 23247: Communicating security expectations for .onion
Bug 41622: Add context-stroke to onion-warning.svg.
-
357c3281
by Henry Wilkes at 2024-04-17T18:28:11+00:00
fixup! Bug 2176: Rebrand Firefox to TorBrowser
Bug 41622: Add context-stroke to onion-warning.svg.
Also drop the unnecessary clip path.
-
7f240934
by Henry Wilkes at 2024-04-17T18:28:11+00:00
fixup! Add TorStrings module for localization
Bug 41622: Move the onion net error strings to Fluent.
-
9967ae76
by Henry Wilkes at 2024-04-17T18:28:11+00:00
fixup! Tor Browser localization migration scripts.
Bug 41622: Migrate onion net error strings to Fluent.
20 changed files:
Changes:
browser/components/onionservices/content/netError/browser.svg
deleted
1
|
|
-<svg fill="none" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg">
|
2
|
|
- <path fill="context-fill" fill-opacity="context-fill-opacity" d="m49 6h-37.5c-1.98912 0-3.89678.79018-5.3033 2.1967s-2.1967 3.3142-2.1967 5.3033v33.75c0 1.9891.79018 3.8968 2.1967 5.3033s3.31418 2.1967 5.3033 2.1967h37.5c1.9891 0 3.8968-.7902 5.3033-2.1967s2.1967-3.3142 2.1967-5.3033v-33.75c0-1.9891-.7902-3.89678-2.1967-5.3033s-3.3142-2.1967-5.3033-2.1967zm-38.0625 4.6875h38.625l2.25 2.25v8.0625h-43.125v-8.0625zm38.625 39.375h-38.625l-2.25-2.25v-22.125h43.125v22.125z"/>
|
3
|
|
-</svg> |
browser/components/onionservices/content/netError/network.svg
deleted
1
|
|
-<svg fill="none" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg">
|
2
|
|
- <path fill="context-fill" fill-opacity="context-fill-opacity" d="m30 1.875c-7.4592 0-14.6129 2.96316-19.8874 8.2376-5.27444 5.2745-8.2376 12.4282-8.2376 19.8874s2.96316 14.6129 8.2376 19.8874c5.2745 5.2744 12.4282 8.2376 19.8874 8.2376s14.6129-2.9632 19.8874-8.2376c5.2744-5.2745 8.2376-12.4282 8.2376-19.8874s-2.9632-14.6129-8.2376-19.8874c-5.2745-5.27444-12.4282-8.2376-19.8874-8.2376zm9.1762 6.5625c3.8504 1.6533 7.1876 4.3079 9.6646 7.6877 2.477 3.3799 4.0034 7.3615 4.4205 11.531h-8.3588c-.4617-6.9829-2.9858-13.6716-7.2525-19.2187zm-7.6837 0c5.0739 5.1814 8.1562 11.9874 8.7037 19.2187h-20.3924c.5475-7.2313 3.6298-14.0373 8.7037-19.2187zm-10.6725 0h1.53c-4.2651 5.548-6.789 12.2362-7.2525 19.2187h-8.35875c.41632-4.1692 1.942-8.1508 4.41835-11.5306 2.4764-3.3799 5.813-6.0346 9.6629-7.6881zm0 43.125c-3.8504-1.6528-7.1874-4.3074-9.6639-7.6874-2.47642-3.38-4.0018-7.3619-4.41735-11.5313h8.35875c.4617 6.9829 2.9858 13.6716 7.2525 19.2187zm7.6875 0c-5.0739-5.1814-8.1562-11.9874-8.7037-19.2187h20.3887c-.5475 7.2313-3.6298 14.0373-8.7037 19.2187zm10.6725 0h-1.5338c4.2683-5.5462 6.7926-12.2354 7.2525-19.2187h8.3588c-.4156 4.1689-1.9406 8.1504-4.4163 11.5302-2.4757 3.3799-5.8118 6.0348-9.6612 7.6885z"/>
|
3
|
|
-</svg> |
browser/components/onionservices/content/netError/onionNetError.css
deleted
1
|
|
-/* Copyright (c) 2020, The Tor Project, Inc. */
|
2
|
|
-
|
3
|
|
-#onionErrorDiagramContainer {
|
4
|
|
- margin: 0px auto 40px 0px;
|
5
|
|
- /* 3 icons 64px wide each seperated by a 64px gap */
|
6
|
|
- width: 384px;
|
7
|
|
- display: grid;
|
8
|
|
- grid-row-gap: 15px;
|
9
|
|
- grid-column-gap: 64px;
|
10
|
|
- grid-template-columns: 1fr 1fr 1fr;
|
11
|
|
-}
|
12
|
|
-
|
13
|
|
-#onionErrorDiagramContainer > div {
|
14
|
|
- margin: auto;
|
15
|
|
- position: relative; /* needed to allow overlay of the ok or error icon */
|
16
|
|
-}
|
17
|
|
-
|
18
|
|
-.onionErrorImage {
|
19
|
|
- width: 64px;
|
20
|
|
- height: 64px;
|
21
|
|
- background-size: 64px 64px;
|
22
|
|
- background-position: center;
|
23
|
|
- background-repeat: no-repeat;
|
24
|
|
- -moz-context-properties: fill;
|
25
|
|
- fill: var(--in-content-icon-color);
|
26
|
|
- opacity: 50%;
|
27
|
|
-}
|
28
|
|
-
|
29
|
|
-.onionErrorImage[status] {
|
30
|
|
- opacity: 100%;
|
31
|
|
-}
|
32
|
|
-
|
33
|
|
-#onionErrorBrowserImage {
|
34
|
|
- background-image: url("browser.svg");
|
35
|
|
-}
|
36
|
|
-
|
37
|
|
-#onionErrorNetworkImage {
|
38
|
|
- background-image: url("network.svg");
|
39
|
|
-}
|
40
|
|
-
|
41
|
|
-#onionErrorOnionSiteImage {
|
42
|
|
- background-image: url("onionsite.svg");
|
43
|
|
-}
|
44
|
|
-
|
45
|
|
-/* rules to support overlay of the ok or error icon */
|
46
|
|
-.onionErrorImage[status]::after {
|
47
|
|
- content: " ";
|
48
|
|
- position: absolute;
|
49
|
|
- left: -8px;
|
50
|
|
- top: calc((64px - 24px) / 2);
|
51
|
|
- width: 24px;
|
52
|
|
- height: 24px;
|
53
|
|
- -moz-context-properties: fill;
|
54
|
|
- fill: var(--in-content-page-background);
|
55
|
|
-
|
56
|
|
- background-repeat: no-repeat;
|
57
|
|
- background-position: center;
|
58
|
|
- border: 3px solid var(--in-content-page-background);
|
59
|
|
- border-radius: 50%;
|
60
|
|
-}
|
61
|
|
-
|
62
|
|
-.onionErrorImage[status="ok"]::after {
|
63
|
|
- background-color: var(--in-content-icon-color);
|
64
|
|
- background-image: url("chrome://global/skin/icons/check.svg");
|
65
|
|
-}
|
66
|
|
-
|
67
|
|
-.onionErrorImage[status="error"]::after {
|
68
|
|
- background-color: var(--warning-color);
|
69
|
|
- background-image: url("chrome://global/skin/icons/close.svg");
|
70
|
|
-} |
browser/components/onionservices/content/netError/onionNetError.js
deleted
1
|
|
-// Copyright (c) 2020, The Tor Project, Inc.
|
2
|
|
-
|
3
|
|
-"use strict";
|
4
|
|
-
|
5
|
|
-/* eslint-env mozilla/remote-page */
|
6
|
|
-
|
7
|
|
-var OnionServicesAboutNetError = {
|
8
|
|
- _selector: {
|
9
|
|
- textContainer: "div#text-container",
|
10
|
|
- header: ".title-text",
|
11
|
|
- longDesc: "#errorLongDesc",
|
12
|
|
- learnMoreContainer: "#learnMoreContainer",
|
13
|
|
- learnMoreLink: "#learnMoreLink",
|
14
|
|
- tryAgainButtonContainer: "#netErrorButtonContainer",
|
15
|
|
- },
|
16
|
|
- _status: {
|
17
|
|
- ok: "ok",
|
18
|
|
- error: "error",
|
19
|
|
- },
|
20
|
|
-
|
21
|
|
- _diagramInfoMap: undefined,
|
22
|
|
-
|
23
|
|
- // Public functions (called from outside this file).
|
24
|
|
- //
|
25
|
|
- // This initPage() function may need to be updated if the structure of
|
26
|
|
- // browser/base/content/aboutNetError.xhtml changes. Specifically, it
|
27
|
|
- // references the following elements:
|
28
|
|
- // query string parameter e
|
29
|
|
- // class title-text
|
30
|
|
- // id errorLongDesc
|
31
|
|
- // id learnMoreContainer
|
32
|
|
- // id learnMoreLink
|
33
|
|
- // id errorLongContent
|
34
|
|
- initPage(aDoc) {
|
35
|
|
- const searchParams = new URLSearchParams(aDoc.documentURI.split("?")[1]);
|
36
|
|
- const err = searchParams.get("e");
|
37
|
|
-
|
38
|
|
- const errPrefix = "onionServices.";
|
39
|
|
- const errName = err.substring(errPrefix.length);
|
40
|
|
-
|
41
|
|
- this._strings = RPMGetTorStrings();
|
42
|
|
-
|
43
|
|
- const stringsObj = this._strings[errName];
|
44
|
|
- if (!stringsObj) {
|
45
|
|
- return;
|
46
|
|
- }
|
47
|
|
-
|
48
|
|
- this._insertStylesheet(aDoc);
|
49
|
|
-
|
50
|
|
- const pageTitle = stringsObj.pageTitle;
|
51
|
|
- const header = stringsObj.header;
|
52
|
|
- const longDescription = stringsObj.longDescription; // optional
|
53
|
|
- const learnMoreURL = stringsObj.learnMoreURL;
|
54
|
|
-
|
55
|
|
- if (pageTitle) {
|
56
|
|
- aDoc.title = pageTitle;
|
57
|
|
- }
|
58
|
|
-
|
59
|
|
- if (header) {
|
60
|
|
- const headerElem = aDoc.querySelector(this._selector.header);
|
61
|
|
- if (headerElem) {
|
62
|
|
- headerElem.textContent = header;
|
63
|
|
- }
|
64
|
|
- }
|
65
|
|
-
|
66
|
|
- const ld = aDoc.querySelector(this._selector.longDesc);
|
67
|
|
- if (ld) {
|
68
|
|
- if (longDescription) {
|
69
|
|
- const hexErr = this._hexErrorFromName(errName);
|
70
|
|
- ld.textContent = longDescription.replace("%S", hexErr);
|
71
|
|
- } else {
|
72
|
|
- // This onion service error does not have a long description. Since
|
73
|
|
- // it is set to a generic error string by the code in
|
74
|
|
- // browser/base/content/aboutNetError.js, hide it here.
|
75
|
|
- ld.style.display = "none";
|
76
|
|
- }
|
77
|
|
- }
|
78
|
|
-
|
79
|
|
- if (learnMoreURL) {
|
80
|
|
- const lmContainer = aDoc.querySelector(this._selector.learnMoreContainer);
|
81
|
|
- if (lmContainer) {
|
82
|
|
- lmContainer.style.display = "block";
|
83
|
|
- }
|
84
|
|
- const lmLink = lmContainer.querySelector(this._selector.learnMoreLink);
|
85
|
|
- if (lmLink) {
|
86
|
|
- lmLink.setAttribute("href", learnMoreURL);
|
87
|
|
- }
|
88
|
|
- }
|
89
|
|
-
|
90
|
|
- // Remove the "Try Again" button if the user made a typo in the .onion
|
91
|
|
- // address since it is not useful in that case.
|
92
|
|
- if (errName === "badAddress") {
|
93
|
|
- const tryAgainButton = aDoc.querySelector(
|
94
|
|
- this._selector.tryAgainButtonContainer
|
95
|
|
- );
|
96
|
|
- if (tryAgainButton) {
|
97
|
|
- tryAgainButton.style.display = "none";
|
98
|
|
- }
|
99
|
|
- }
|
100
|
|
-
|
101
|
|
- this._insertDiagram(aDoc, errName);
|
102
|
|
- }, // initPage()
|
103
|
|
-
|
104
|
|
- _insertStylesheet(aDoc) {
|
105
|
|
- const url =
|
106
|
|
- "chrome://browser/content/onionservices/netError/onionNetError.css";
|
107
|
|
- let linkElem = aDoc.createElement("link");
|
108
|
|
- linkElem.rel = "stylesheet";
|
109
|
|
- linkElem.href = url;
|
110
|
|
- linkElem.type = "text/css";
|
111
|
|
- aDoc.head.appendChild(linkElem);
|
112
|
|
- },
|
113
|
|
-
|
114
|
|
- _insertDiagram(aDoc, aErrorName) {
|
115
|
|
- // The onion error diagram consists of a grid of div elements.
|
116
|
|
- // The first row contains three images (Browser, Network, Onionsite) and
|
117
|
|
- // the second row contains labels for the images that are in the first row.
|
118
|
|
- // The _diagramInfoMap describes for each type of onion service error
|
119
|
|
- // whether a small ok or error status icon is overlaid on top of the main
|
120
|
|
- // Browser/Network/Onionsite images.
|
121
|
|
- if (!this._diagramInfoMap) {
|
122
|
|
- this._diagramInfoMap = new Map();
|
123
|
|
- this._diagramInfoMap.set("descNotFound", {
|
124
|
|
- browser: this._status.ok,
|
125
|
|
- network: this._status.ok,
|
126
|
|
- onionSite: this._status.error,
|
127
|
|
- });
|
128
|
|
- this._diagramInfoMap.set("descInvalid", {
|
129
|
|
- browser: this._status.ok,
|
130
|
|
- network: this._status.error,
|
131
|
|
- });
|
132
|
|
- this._diagramInfoMap.set("introFailed", {
|
133
|
|
- browser: this._status.ok,
|
134
|
|
- network: this._status.error,
|
135
|
|
- });
|
136
|
|
- this._diagramInfoMap.set("rendezvousFailed", {
|
137
|
|
- browser: this._status.ok,
|
138
|
|
- network: this._status.error,
|
139
|
|
- });
|
140
|
|
- this._diagramInfoMap.set("clientAuthMissing", {
|
141
|
|
- browser: this._status.error,
|
142
|
|
- });
|
143
|
|
- this._diagramInfoMap.set("clientAuthIncorrect", {
|
144
|
|
- browser: this._status.error,
|
145
|
|
- });
|
146
|
|
- this._diagramInfoMap.set("badAddress", {
|
147
|
|
- browser: this._status.error,
|
148
|
|
- });
|
149
|
|
- this._diagramInfoMap.set("introTimedOut", {
|
150
|
|
- browser: this._status.ok,
|
151
|
|
- network: this._status.error,
|
152
|
|
- });
|
153
|
|
- }
|
154
|
|
-
|
155
|
|
- const diagramInfo = this._diagramInfoMap.get(aErrorName);
|
156
|
|
-
|
157
|
|
- const container = this._createDiv(aDoc, "onionErrorDiagramContainer");
|
158
|
|
- const imageClass = "onionErrorImage";
|
159
|
|
-
|
160
|
|
- const browserImage = this._createDiv(
|
161
|
|
- aDoc,
|
162
|
|
- "onionErrorBrowserImage",
|
163
|
|
- imageClass,
|
164
|
|
- container
|
165
|
|
- );
|
166
|
|
- if (diagramInfo && diagramInfo.browser) {
|
167
|
|
- browserImage.setAttribute("status", diagramInfo.browser);
|
168
|
|
- }
|
169
|
|
-
|
170
|
|
- const networkImage = this._createDiv(
|
171
|
|
- aDoc,
|
172
|
|
- "onionErrorNetworkImage",
|
173
|
|
- imageClass,
|
174
|
|
- container
|
175
|
|
- );
|
176
|
|
- if (diagramInfo && diagramInfo.network) {
|
177
|
|
- networkImage.setAttribute("status", diagramInfo.network);
|
178
|
|
- }
|
179
|
|
-
|
180
|
|
- const onionSiteImage = this._createDiv(
|
181
|
|
- aDoc,
|
182
|
|
- "onionErrorOnionSiteImage",
|
183
|
|
- imageClass,
|
184
|
|
- container
|
185
|
|
- );
|
186
|
|
- if (diagramInfo && diagramInfo.onionSite) {
|
187
|
|
- onionSiteImage.setAttribute("status", diagramInfo.onionSite);
|
188
|
|
- }
|
189
|
|
-
|
190
|
|
- let labelDiv = this._createDiv(aDoc, undefined, undefined, container);
|
191
|
|
- labelDiv.textContent = this._strings.errorPage.browser;
|
192
|
|
- labelDiv = this._createDiv(aDoc, undefined, undefined, container);
|
193
|
|
- labelDiv.textContent = this._strings.errorPage.network;
|
194
|
|
- labelDiv = this._createDiv(aDoc, undefined, undefined, container);
|
195
|
|
- labelDiv.textContent = this._strings.errorPage.onionSite;
|
196
|
|
-
|
197
|
|
- const textContainer = aDoc.querySelector(this._selector.textContainer);
|
198
|
|
- textContainer?.insertBefore(container, textContainer.firstChild);
|
199
|
|
- }, // _insertDiagram()
|
200
|
|
-
|
201
|
|
- _createDiv(aDoc, aID, aClass, aParentElem) {
|
202
|
|
- const div = aDoc.createElement("div");
|
203
|
|
- if (aID) {
|
204
|
|
- div.id = aID;
|
205
|
|
- }
|
206
|
|
- if (aClass) {
|
207
|
|
- div.setAttribute("class", aClass);
|
208
|
|
- }
|
209
|
|
- if (aParentElem) {
|
210
|
|
- aParentElem.appendChild(div);
|
211
|
|
- }
|
212
|
|
-
|
213
|
|
- return div;
|
214
|
|
- },
|
215
|
|
-
|
216
|
|
- _hexErrorFromName(aErrorName) {
|
217
|
|
- // We do not have access to the original Tor SOCKS error code here, so
|
218
|
|
- // perform a reverse mapping from the error name.
|
219
|
|
- switch (aErrorName) {
|
220
|
|
- case "descNotFound":
|
221
|
|
- return "0xF0";
|
222
|
|
- case "descInvalid":
|
223
|
|
- return "0xF1";
|
224
|
|
- case "introFailed":
|
225
|
|
- return "0xF2";
|
226
|
|
- case "rendezvousFailed":
|
227
|
|
- return "0xF3";
|
228
|
|
- case "clientAuthMissing":
|
229
|
|
- return "0xF4";
|
230
|
|
- case "clientAuthIncorrect":
|
231
|
|
- return "0xF5";
|
232
|
|
- case "badAddress":
|
233
|
|
- return "0xF6";
|
234
|
|
- case "introTimedOut":
|
235
|
|
- return "0xF7";
|
236
|
|
- }
|
237
|
|
-
|
238
|
|
- return "";
|
239
|
|
- },
|
240
|
|
-}; |
browser/components/onionservices/content/netError/onionsite.svg
deleted
1
|
|
-<svg fill="none" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg">
|
2
|
|
- <g fill="context-fill" fill-opacity="context-fill-opacity">
|
3
|
|
- <path clip-rule="evenodd" d="m11.25 6h37.5c1.9891 0 3.8968.79018 5.3033 2.1967s2.1967 3.3142 2.1967 5.3033v33.75c0 1.9891-.7902 3.8968-2.1967 5.3033s-3.3142 2.1967-5.3033 2.1967h-37.5c-1.98912 0-3.89678-.7902-5.3033-2.1967s-2.1967-3.3142-2.1967-5.3033v-33.75c0-1.9891.79018-3.89678 2.1967-5.3033s3.31418-2.1967 5.3033-2.1967zm-.5625 4.6875h38.625l2.25 2.25v34.875l-2.25 2.25h-38.625l-2.25-2.25v-34.875z" fill-rule="evenodd"/>
|
4
|
|
- <path d="m15.9606 22c-.52 0-1.0187-.2107-1.3863-.5858-.3677-.3751-.5743-.8838-.5743-1.4142s.2066-1.0391.5743-1.4142c.3676-.3751.8663-.5858 1.3863-.5858h14.0788c.52 0 1.0187.2107 1.3863.5858.3677.3751.5743.8838.5743 1.4142s-.2066 1.0391-.5743 1.4142c-.3676.3751-.8663.5858-1.3863.5858z"/>
|
5
|
|
- <path d="m44.0709 32h-28.1418c-.5116 0-1.0023-.2107-1.3641-.5858s-.565-.8838-.565-1.4142.2032-1.0391.565-1.4142.8525-.5858 1.3641-.5858h28.1418c.5116 0 1.0023.2107 1.3641.5858s.565.8838.565 1.4142-.2032 1.0391-.565 1.4142-.8525.5858-1.3641.5858z"/>
|
6
|
|
- <path d="m44.0709 42h-28.1418c-.5116 0-1.0023-.2107-1.3641-.5858s-.565-.8838-.565-1.4142.2032-1.0391.565-1.4142.8525-.5858 1.3641-.5858h28.1418c.5116 0 1.0023.2107 1.3641.5858s.565.8838.565 1.4142-.2032 1.0391-.565 1.4142-.8525.5858-1.3641.5858z"/>
|
7
|
|
- </g>
|
8
|
|
-</svg> |
browser/components/onionservices/jar.mn
... |
... |
@@ -2,7 +2,6 @@ browser.jar: |
2
|
2
|
content/browser/onionservices/authPreferences.css (content/authPreferences.css)
|
3
|
3
|
content/browser/onionservices/authPreferences.js (content/authPreferences.js)
|
4
|
4
|
content/browser/onionservices/authPrompt.js (content/authPrompt.js)
|
5
|
|
- content/browser/onionservices/netError/ (content/netError/*)
|
6
|
5
|
content/browser/onionservices/onionservices.css (content/onionservices.css)
|
7
|
6
|
content/browser/onionservices/savedKeysDialog.js (content/savedKeysDialog.js)
|
8
|
7
|
content/browser/onionservices/savedKeysDialog.xhtml (content/savedKeysDialog.xhtml)
|
browser/locales/en-US/browser/tor-browser.ftl
... |
... |
@@ -607,3 +607,26 @@ rulesets-details-scope-input = |
607
|
607
|
.placeholder = Regular _expression_ for the scope of the rules
|
608
|
608
|
# "Regular _expression_" refers to the computing term for a special pattern used for matching: https://en.wikipedia.org/wiki/Regular_expression.
|
609
|
609
|
rulesets-details-scope-input-invalid = The scope could not be parsed as a regular _expression_
|
|
610
|
+
|
|
611
|
+## Onionsite error page.
|
|
612
|
+## "Onionsite" is an abbreviation of "onion website": a website whose domain URL ends in ".onion", which is reachable through the Tor network.
|
|
613
|
+
|
|
614
|
+onion-neterror-page-title = Problem loading onionsite
|
|
615
|
+onion-neterror-authorization-title = Authentication required
|
|
616
|
+onion-neterror-not-found-header = Onionsite not found
|
|
617
|
+onion-neterror-not-found-description = The most likely cause is that the onionsite is offline. Contact the onionsite administrator.
|
|
618
|
+onion-neterror-unreachable-header = Onionsite cannot be reached
|
|
619
|
+onion-neterror-unreachable-description = The onionsite is unreachable due an internal error.
|
|
620
|
+onion-neterror-disconnected-header = Onionsite has disconnected
|
|
621
|
+onion-neterror-disconnected-description = The most likely cause is that the onionsite is offline. Contact the onionsite administrator.
|
|
622
|
+onion-neterror-connection-failed-header = Unable to connect to onionsite
|
|
623
|
+onion-neterror-connection-failed-description = The onionsite is busy or the Tor network is overloaded. Try again later.
|
|
624
|
+onion-neterror-missing-authentication-header = Onionsite requires authentication
|
|
625
|
+onion-neterror-missing-authentication-description = Access to the onionsite requires a key but none was provided.
|
|
626
|
+onion-neterror-incorrect-authentication-header = Onionsite authentication failed
|
|
627
|
+onion-neterror-incorrect-authetication-description = The provided key is incorrect or has been revoked. Contact the onionsite administrator.
|
|
628
|
+onion-neterror-invalid-address-header = Invalid onionsite address
|
|
629
|
+onion-neterror-invalid-address-description = The provided onionsite address is invalid. Please check that you entered it correctly.
|
|
630
|
+# "Circuit" refers to a Tor network circuit.
|
|
631
|
+onion-neterror-timed-out-header = Onionsite circuit creation timed out
|
|
632
|
+onion-neterror-timed-out-description = Failed to connect to the onionsite, possibly due to a poor network connection. |
browser/themes/shared/identity-block/identity-block.css
... |
... |
@@ -204,6 +204,10 @@ |
204
|
204
|
#identity-box[pageproxystate="valid"].onionCertUserOverridden #identity-icon {
|
205
|
205
|
list-style-image: url(chrome://browser/skin/onion-warning.svg);
|
206
|
206
|
visibility: visible;
|
|
207
|
+ /* onion-warning includes another context-stroke color. Here we want it to
|
|
208
|
+ * match the context-fill color, which should be currentColor. */
|
|
209
|
+ -moz-context-properties: fill, fill-opacity, stroke;
|
|
210
|
+ stroke: currentColor;
|
207
|
211
|
}
|
208
|
212
|
|
209
|
213
|
#identity-box[pageproxystate="valid"].onionMixedActiveContent #identity-icon {
|
browser/themes/shared/identity-block/onion-slash.svg
1
|
1
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
|
-<g clip-path="url(#clip0_1827_6565)">
|
3
|
2
|
<path d="M6.62435 8.54824C6.23983 8.91273 6 9.42836 6 10C6 11.1046 6.89543 12 8 12C8.57164 12 9.08727 11.7602 9.45176 11.3757L8.74414 10.668C8.56107 10.8718 8.29551 11 8 11C7.44772 11 7 10.5523 7 10C7 9.70449 7.12818 9.43893 7.33197 9.25586L6.62435 8.54824Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
4
|
3
|
<path d="M9.99442 10.1505C9.99812 10.1008 10 10.0506 10 10C10 8.89543 9.10457 8 8 8C7.94936 8 7.89915 8.00188 7.84946 8.00558L9.99442 10.1505Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
5
|
4
|
<path d="M5.20988 7.13377C4.46354 7.86041 4 8.87607 4 10C4 12.2091 5.79086 14 8 14C9.12393 14 10.1396 13.5365 10.8662 12.7901L10.159 12.0829C9.61343 12.6483 8.84778 13 8 13C6.34315 13 5 11.6569 5 10C5 9.15222 5.35166 8.38657 5.91707 7.84097L5.20988 7.13377Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
... |
... |
@@ -7,10 +6,4 @@ |
7
|
6
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 10C14 8.223 13.2275 6.62643 12 5.52779V4C12 1.79086 10.2091 0 8 0C5.79086 0 4 1.79086 4 4V4.15613L5.50811 5.66423C6.2417 5.2417 7.09263 5 8 5C10.7614 5 13 7.23858 13 10C13 10.9074 12.7583 11.7583 12.3358 12.4919L13.0637 13.2199C13.6565 12.2896 14 11.1849 14 10ZM8 4C7.00883 4 6.0738 4.24033 5.25 4.66591V4C5.25 2.48122 6.48122 1.25 8 1.25C9.51878 1.25 10.75 2.48122 10.75 4V4.66591C9.9262 4.24033 8.99117 4 8 4Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
8
|
7
|
<path d="M12.2805 14.2044C11.1919 15.3126 9.67621 16 8 16C4.68629 16 2 13.3137 2 10C2 8.32379 2.68736 6.80812 3.79558 5.71948L4.50272 6.42662C3.57545 7.33427 3 8.59993 3 10C3 12.7614 5.23858 15 8 15C9.40007 15 10.6657 14.4246 11.5734 13.4973L12.2805 14.2044Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
9
|
8
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.25801 3.93806C1.50209 3.69398 1.89782 3.69398 2.14189 3.93806L13.1419 14.9381C13.386 15.1821 13.386 15.5779 13.1419 15.8219C12.8978 16.066 12.5021 16.066 12.258 15.8219L1.25801 4.82194C1.01393 4.57787 1.01393 4.18214 1.25801 3.93806Z" fill="#F90D3F"/>
|
10
|
|
-</g>
|
11
|
|
-<defs>
|
12
|
|
-<clipPath id="clip0_1827_6565">
|
13
|
|
-<rect width="16" height="16" fill="white"/>
|
14
|
|
-</clipPath>
|
15
|
|
-</defs>
|
16
|
9
|
</svg> |
browser/themes/shared/identity-block/onion-warning.svg
1
|
1
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
|
-<g clip-path="url(#clip0_1827_6566)">
|
3
|
2
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.92788 10.5342L7.42044 11.408C7.05803 11.7736 6.55546 12 6 12C4.89543 12 4 11.1046 4 10C4 8.89543 4.89543 8 6 8C7.10457 8 8 8.89543 8 10C8 10.185 7.97488 10.3641 7.92788 10.5342ZM7 10C7 10.5523 6.55228 11 6 11C5.44772 11 5 10.5523 5 10C5 9.44772 5.44772 9 6 9C6.55228 9 7 9.44772 7 10Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
4
|
3
|
<path d="M6.52221 12.9547C6.35262 12.9845 6.17812 13 6 13C4.34315 13 3 11.6569 3 10C3 8.34315 4.34315 7 6 7C7.30202 7 8.41032 7.82945 8.8253 8.98878L9.35089 8.08372C9.37772 8.03755 9.40587 7.99285 9.43523 7.94962C8.73673 6.78186 7.45967 6 6 6C3.79086 6 2 7.79086 2 10C2 12.1857 3.75302 13.9619 5.92975 13.9994C5.96208 13.9274 5.99884 13.8558 6.0402 13.7847L6.52221 12.9547Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
5
|
4
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1978 7.00088C10.8782 6.44807 10.4728 5.95098 10 5.52779V4C10 1.79086 8.20914 0 6 0C3.79086 0 2 1.79086 2 4V5.52779C0.772501 6.62643 0 8.223 0 10C0 13.3137 2.68629 16 6 16C6.03024 16 6.06043 15.9998 6.09057 15.9993C5.89561 15.7007 5.77424 15.3557 5.749 14.9938C3.10419 14.8631 1 12.6773 1 10C1 7.23858 3.23858 5 6 5C7.75288 5 9.29509 5.90201 10.1878 7.26719C10.5002 7.0977 10.8482 7.00893 11.1978 7.00088ZM6 4C5.00883 4 4.0738 4.24033 3.25 4.66591V4C3.25 2.48122 4.48122 1.25 6 1.25C7.51878 1.25 8.75 2.48122 8.75 4V4.66591C7.9262 4.24033 6.99117 4 6 4Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
6
|
|
-<path d="M15.5956 14.2875L12.2846 8.58591C11.8306 7.8047 10.6696 7.8047 10.2156 8.58591L6.90465 14.2875C6.45865 15.0529 7.03065 16 7.93865 16H14.5616C15.4686 16 16.0406 15.0529 15.5956 14.2875ZM11.8746 12.4189C11.8746 12.5826 11.8088 12.7396 11.6916 12.8553C11.5744 12.9711 11.4154 13.0361 11.2496 13.0361C11.0839 13.0361 10.9249 12.9711 10.8077 12.8553C10.6905 12.7396 10.6246 12.5826 10.6246 12.4189V10.6935C10.6246 10.5298 10.6905 10.3728 10.8077 10.257C10.9249 10.1413 11.0839 10.0762 11.2496 10.0762C11.4154 10.0762 11.5744 10.1413 11.6916 10.257C11.8088 10.3728 11.8746 10.5298 11.8746 10.6935V12.4189ZM11.2496 15.0124C11.0839 15.0124 10.9249 14.9473 10.8077 14.8316C10.6905 14.7158 10.6246 14.5588 10.6246 14.3951C10.6246 14.2314 10.6905 14.0744 10.8077 13.9586C10.9249 13.8429 11.0839 13.7778 11.2496 13.7778C11.4154 13.7778 11.5744 13.8429 11.6916 13.9586C11.8088 14.0744 11.8746 14.2314 11.8746 14.3951C11.8746 14.5588 11.8088 14.7158 11.6916 14.8316C11.5744 14.9473 11.4154 15.0124 11.2496 15.0124Z" fill-opacity="context-fill-opacity" fill="context-fill"/>
|
7
|
|
-</g>
|
8
|
|
-<defs>
|
9
|
|
-<clipPath id="clip0_1827_6566">
|
10
|
|
-<rect width="16" height="16" fill="white"/>
|
11
|
|
-</clipPath>
|
12
|
|
-</defs>
|
|
5
|
+<path d="M15.5956 14.2875L12.2846 8.58591C11.8306 7.8047 10.6696 7.8047 10.2156 8.58591L6.90465 14.2875C6.45865 15.0529 7.03065 16 7.93865 16H14.5616C15.4686 16 16.0406 15.0529 15.5956 14.2875ZM11.8746 12.4189C11.8746 12.5826 11.8088 12.7396 11.6916 12.8553C11.5744 12.9711 11.4154 13.0361 11.2496 13.0361C11.0839 13.0361 10.9249 12.9711 10.8077 12.8553C10.6905 12.7396 10.6246 12.5826 10.6246 12.4189V10.6935C10.6246 10.5298 10.6905 10.3728 10.8077 10.257C10.9249 10.1413 11.0839 10.0762 11.2496 10.0762C11.4154 10.0762 11.5744 10.1413 11.6916 10.257C11.8088 10.3728 11.8746 10.5298 11.8746 10.6935V12.4189ZM11.2496 15.0124C11.0839 15.0124 10.9249 14.9473 10.8077 14.8316C10.6905 14.7158 10.6246 14.5588 10.6246 14.3951C10.6246 14.2314 10.6905 14.0744 10.8077 13.9586C10.9249 13.8429 11.0839 13.7778 11.2496 13.7778C11.4154 13.7778 11.5744 13.8429 11.6916 13.9586C11.8088 14.0744 11.8746 14.2314 11.8746 14.3951C11.8746 14.5588 11.8088 14.7158 11.6916 14.8316C11.5744 14.9473 11.4154 15.0124 11.2496 15.0124Z" fill-opacity="context-fill-opacity" fill="context-stroke"/>
|
13
|
6
|
</svg> |
docshell/base/nsDocShell.cpp
... |
... |
@@ -3695,6 +3695,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, |
3695
|
3695
|
} else {
|
3696
|
3696
|
// Errors requiring simple formatting
|
3697
|
3697
|
bool isOnionAuthError = false;
|
|
3698
|
+ bool isOnionError = false;
|
3698
|
3699
|
switch (aError) {
|
3699
|
3700
|
case NS_ERROR_MALFORMED_URI:
|
3700
|
3701
|
// URI is malformed
|
... |
... |
@@ -3778,29 +3779,37 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, |
3778
|
3779
|
break;
|
3779
|
3780
|
case NS_ERROR_TOR_ONION_SVC_NOT_FOUND:
|
3780
|
3781
|
error = "onionServices.descNotFound";
|
|
3782
|
+ isOnionError = true;
|
3781
|
3783
|
break;
|
3782
|
3784
|
case NS_ERROR_TOR_ONION_SVC_IS_INVALID:
|
3783
|
3785
|
error = "onionServices.descInvalid";
|
|
3786
|
+ isOnionError = true;
|
3784
|
3787
|
break;
|
3785
|
3788
|
case NS_ERROR_TOR_ONION_SVC_INTRO_FAILED:
|
3786
|
3789
|
error = "onionServices.introFailed";
|
|
3790
|
+ isOnionError = true;
|
3787
|
3791
|
break;
|
3788
|
3792
|
case NS_ERROR_TOR_ONION_SVC_REND_FAILED:
|
3789
|
3793
|
error = "onionServices.rendezvousFailed";
|
|
3794
|
+ isOnionError = true;
|
3790
|
3795
|
break;
|
3791
|
3796
|
case NS_ERROR_TOR_ONION_SVC_MISSING_CLIENT_AUTH:
|
3792
|
3797
|
error = "onionServices.clientAuthMissing";
|
|
3798
|
+ isOnionError = true;
|
3793
|
3799
|
isOnionAuthError = true;
|
3794
|
3800
|
break;
|
3795
|
3801
|
case NS_ERROR_TOR_ONION_SVC_BAD_CLIENT_AUTH:
|
3796
|
3802
|
error = "onionServices.clientAuthIncorrect";
|
|
3803
|
+ isOnionError = true;
|
3797
|
3804
|
isOnionAuthError = true;
|
3798
|
3805
|
break;
|
3799
|
3806
|
case NS_ERROR_TOR_ONION_SVC_BAD_ADDRESS:
|
3800
|
3807
|
error = "onionServices.badAddress";
|
|
3808
|
+ isOnionError = true;
|
3801
|
3809
|
break;
|
3802
|
3810
|
case NS_ERROR_TOR_ONION_SVC_INTRO_TIMEDOUT:
|
3803
|
3811
|
error = "onionServices.introTimedOut";
|
|
3812
|
+ isOnionError = true;
|
3804
|
3813
|
break;
|
3805
|
3814
|
default:
|
3806
|
3815
|
break;
|
... |
... |
@@ -3816,6 +3825,13 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, |
3816
|
3825
|
// will mess with the failed channel information persistence!
|
3817
|
3826
|
cssClass.AssignLiteral("onionAuthPrompt");
|
3818
|
3827
|
}
|
|
3828
|
+ if (isOnionError) {
|
|
3829
|
+ // DisplayLoadError requires a non-empty messageStr to proceed and call
|
|
3830
|
+ // LoadErrorPage. We use a blank space.
|
|
3831
|
+ if (messageStr.IsEmpty()) {
|
|
3832
|
+ messageStr.AssignLiteral(u" ");
|
|
3833
|
+ }
|
|
3834
|
+ }
|
3819
|
3835
|
}
|
3820
|
3836
|
|
3821
|
3837
|
nsresult delegateErrorCode = aError;
|
... |
... |
@@ -3902,20 +3918,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, |
3902
|
3918
|
nsAutoString str;
|
3903
|
3919
|
rv =
|
3904
|
3920
|
stringBundle->FormatStringFromName(errorDescriptionID, formatStrs, str);
|
3905
|
|
- if (NS_FAILED(rv)) {
|
3906
|
|
- // As a fallback, check torbutton.properties for the error string.
|
3907
|
|
- const char bundleURL[] = "chrome://torbutton/locale/torbutton.properties";
|
3908
|
|
- nsCOMPtr<nsIStringBundleService> stringBundleService =
|
3909
|
|
- components::StringBundle::Service();
|
3910
|
|
- if (stringBundleService) {
|
3911
|
|
- nsCOMPtr<nsIStringBundle> tbStringBundle;
|
3912
|
|
- if (NS_SUCCEEDED(stringBundleService->CreateBundle(
|
3913
|
|
- bundleURL, getter_AddRefs(tbStringBundle)))) {
|
3914
|
|
- rv = tbStringBundle->FormatStringFromName(errorDescriptionID,
|
3915
|
|
- formatStrs, str);
|
3916
|
|
- }
|
3917
|
|
- }
|
3918
|
|
- }
|
3919
|
3921
|
NS_ENSURE_SUCCESS(rv, rv);
|
3920
|
3922
|
messageStr.Assign(str);
|
3921
|
3923
|
}
|
toolkit/actors/NetErrorChild.sys.mjs
... |
... |
@@ -7,7 +7,6 @@ const lazy = {}; |
7
|
7
|
|
8
|
8
|
ChromeUtils.defineESModuleGetters(lazy, {
|
9
|
9
|
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
10
|
|
- TorStrings: "resource://gre/modules/TorStrings.sys.mjs",
|
11
|
10
|
});
|
12
|
11
|
|
13
|
12
|
import { RemotePageChild } from "resource://gre/actors/RemotePageChild.sys.mjs";
|
... |
... |
@@ -34,7 +33,6 @@ export class NetErrorChild extends RemotePageChild { |
34
|
33
|
"RPMIsSiteSpecificTRRError",
|
35
|
34
|
"RPMSetTRRDisabledLoadFlags",
|
36
|
35
|
"RPMGetCurrentTRRMode",
|
37
|
|
- "RPMGetTorStrings",
|
38
|
36
|
];
|
39
|
37
|
this.exportFunctions(exportableFunctions);
|
40
|
38
|
}
|
... |
... |
@@ -246,8 +244,4 @@ export class NetErrorChild extends RemotePageChild { |
246
|
244
|
this.contentWindow.docShell.browsingContext.defaultLoadFlags |=
|
247
|
245
|
Ci.nsIRequest.LOAD_TRR_DISABLED_MODE;
|
248
|
246
|
}
|
249
|
|
-
|
250
|
|
- RPMGetTorStrings() {
|
251
|
|
- return Cu.cloneInto(lazy.TorStrings.onionServices, this.contentWindow);
|
252
|
|
- }
|
253
|
247
|
} |
toolkit/content/aboutNetError.mjs
... |
... |
@@ -4,7 +4,6 @@ |
4
|
4
|
|
5
|
5
|
/* eslint-env mozilla/remote-page */
|
6
|
6
|
/* eslint-disable import/no-unassigned-import */
|
7
|
|
-/* import-globals-from ../../browser/components/onionservices/content/netError/onionNetError.js */
|
8
|
7
|
|
9
|
8
|
import {
|
10
|
9
|
parse,
|
... |
... |
@@ -291,6 +290,92 @@ function recordTRREventTelemetry( |
291
|
290
|
}
|
292
|
291
|
}
|
293
|
292
|
|
|
293
|
+/**
|
|
294
|
+ * Initialize the onion error page.
|
|
295
|
+ *
|
|
296
|
+ * @return {boolean} Whether the page was initialized as an onion error page.
|
|
297
|
+ */
|
|
298
|
+function initOnionError() {
|
|
299
|
+ const docTitle = document.querySelector("title");
|
|
300
|
+
|
|
301
|
+ if (getCSSClass() === "onionAuthPrompt") {
|
|
302
|
+ // Only showing the authorization prompt. The page will be blank.
|
|
303
|
+ document.l10n.setAttributes(docTitle, "onion-neterror-authorization-title");
|
|
304
|
+ return true;
|
|
305
|
+ }
|
|
306
|
+
|
|
307
|
+ const onionErrors = {
|
|
308
|
+ // Tor SOCKS error 0xF0:
|
|
309
|
+ "onionServices.descNotFound": {
|
|
310
|
+ headerId: "onion-neterror-not-found-header",
|
|
311
|
+ descriptionId: "onion-neterror-not-found-description",
|
|
312
|
+ },
|
|
313
|
+ // Tor SOCKS error 0xF1:
|
|
314
|
+ "onionServices.descInvalid": {
|
|
315
|
+ headerId: "onion-neterror-unreachable-header",
|
|
316
|
+ descriptionId: "onion-neterror-unreachable-description",
|
|
317
|
+ },
|
|
318
|
+ // Tor SOCKS error 0xF2:
|
|
319
|
+ "onionServices.introFailed": {
|
|
320
|
+ headerId: "onion-neterror-disconnected-header",
|
|
321
|
+ descriptionId: "onion-neterror-disconnected-description",
|
|
322
|
+ },
|
|
323
|
+ // Tor SOCKS error 0xF3:
|
|
324
|
+ "onionServices.rendezvousFailed": {
|
|
325
|
+ headerId: "onion-neterror-connection-failed-header",
|
|
326
|
+ descriptionId: "onion-neterror-connection-failed-description",
|
|
327
|
+ },
|
|
328
|
+ // Tor SOCKS error 0xF4:
|
|
329
|
+ "onionServices.clientAuthMissing": {
|
|
330
|
+ headerId: "onion-neterror-missing-authentication-header",
|
|
331
|
+ descriptionId: "onion-neterror-missing-authentication-description",
|
|
332
|
+ },
|
|
333
|
+ // Tor SOCKS error 0xF5:
|
|
334
|
+ "onionServices.clientAuthIncorrect": {
|
|
335
|
+ headerId: "onion-neterror-incorrect-authentication-header",
|
|
336
|
+ descriptionId: "onion-neterror-incorrect-authetication-description",
|
|
337
|
+ },
|
|
338
|
+ // Tor SOCKS error 0xF6:
|
|
339
|
+ "onionServices.badAddress": {
|
|
340
|
+ headerId: "onion-neterror-invalid-address-header",
|
|
341
|
+ descriptionId: "onion-neterror-invalid-address-description",
|
|
342
|
+ },
|
|
343
|
+ // Tor SOCKS error 0xF7:
|
|
344
|
+ "onionServices.introTimedOut": {
|
|
345
|
+ headerId: "onion-neterror-timed-out-header",
|
|
346
|
+ descriptionId: "onion-neterror-timed-out-description",
|
|
347
|
+ },
|
|
348
|
+ };
|
|
349
|
+
|
|
350
|
+ if (!Object.hasOwn(onionErrors, gErrorCode)) {
|
|
351
|
+ return false;
|
|
352
|
+ }
|
|
353
|
+
|
|
354
|
+ document.body.classList.add("onion-error");
|
|
355
|
+
|
|
356
|
+ document.l10n.setAttributes(docTitle, "onion-neterror-page-title");
|
|
357
|
+ document.l10n.setAttributes(
|
|
358
|
+ document.querySelector(".title-text"),
|
|
359
|
+ onionErrors[gErrorCode].headerId
|
|
360
|
+ );
|
|
361
|
+ document.l10n.setAttributes(
|
|
362
|
+ document.getElementById("errorShortDesc"),
|
|
363
|
+ onionErrors[gErrorCode].descriptionId
|
|
364
|
+ );
|
|
365
|
+
|
|
366
|
+ const tryAgain = document.getElementById("netErrorButtonContainer");
|
|
367
|
+ tryAgain.hidden = false;
|
|
368
|
+
|
|
369
|
+ const learnMore = document.getElementById("learnMoreContainer");
|
|
370
|
+ learnMore.hidden = false;
|
|
371
|
+ const learnMoreLink = document.getElementById("learnMoreLink");
|
|
372
|
+ learnMoreLink.href = "about:manual#onion-services";
|
|
373
|
+
|
|
374
|
+ setFocus("#netErrorButtonContainer > .try-again");
|
|
375
|
+
|
|
376
|
+ return true;
|
|
377
|
+}
|
|
378
|
+
|
294
|
379
|
async function initPage() {
|
295
|
380
|
// We show an offline support page in case of a system-wide error,
|
296
|
381
|
// when a user cannot connect to the internet and access the SUMO website.
|
... |
... |
@@ -314,7 +399,6 @@ async function initPage() { |
314
|
399
|
}
|
315
|
400
|
|
316
|
401
|
const isTRROnlyFailure = gErrorCode == "dnsNotFound" && RPMIsTRROnlyFailure();
|
317
|
|
- const isOnionError = gErrorCode.startsWith("onionServices.");
|
318
|
402
|
|
319
|
403
|
let isNativeFallbackWarning = false;
|
320
|
404
|
if (RPMGetBoolPref("network.trr.display_fallback_warning")) {
|
... |
... |
@@ -361,8 +445,7 @@ async function initPage() { |
361
|
445
|
|
362
|
446
|
document.body.classList.add("neterror");
|
363
|
447
|
|
364
|
|
- if (isOnionError) {
|
365
|
|
- OnionServicesAboutNetError.initPage(document);
|
|
448
|
+ if (initOnionError()) {
|
366
|
449
|
return;
|
367
|
450
|
}
|
368
|
451
|
|
toolkit/content/aboutNetError.xhtml
... |
... |
@@ -16,6 +16,7 @@ |
16
|
16
|
<link rel="localization" href="">"branding/brand.ftl"/>
|
17
|
17
|
<link rel="localization" href="">"toolkit/neterror/certError.ftl" />
|
18
|
18
|
<link rel="localization" href="">"toolkit/neterror/netError.ftl"/>
|
|
19
|
+ <link rel="localization" href="">"browser/tor-browser.ftl"/>
|
19
|
20
|
</head>
|
20
|
21
|
|
21
|
22
|
<body>
|
... |
... |
@@ -123,6 +124,5 @@ |
123
|
124
|
</div>
|
124
|
125
|
</body>
|
125
|
126
|
<script src="">"chrome://global/content/neterror/aboutNetErrorCodes.js"></script>
|
126
|
|
- <script src="">"chrome://browser/content/onionservices/netError/onionNetError.js"></script>
|
127
|
127
|
<script type="module" src="">"chrome://global/content/aboutNetError.mjs"></script>
|
128
|
128
|
</html> |
toolkit/modules/RemotePageAccessManager.sys.mjs
... |
... |
@@ -119,7 +119,6 @@ export let RemotePageAccessManager = { |
119
|
119
|
RPMSetTRRDisabledLoadFlags: ["*"],
|
120
|
120
|
RPMSendQuery: ["Browser:AddTRRExcludedDomain", "ShouldShowTorConnect"],
|
121
|
121
|
RPMGetIntPref: ["network.trr.mode"],
|
122
|
|
- RPMGetTorStrings: ["*"],
|
123
|
122
|
},
|
124
|
123
|
"about:newtab": {
|
125
|
124
|
RPMSendAsyncMessage: ["ActivityStream:ContentToMain"],
|
toolkit/modules/TorStrings.sys.mjs
... |
... |
@@ -231,124 +231,8 @@ const Loader = { |
231
|
231
|
);
|
232
|
232
|
const getString = tsb.getString.bind(tsb);
|
233
|
233
|
|
234
|
|
- const kProblemLoadingSiteFallback = "Problem Loading Onionsite";
|
235
|
|
- const kLongDescFallback = "Details: %S";
|
236
|
|
-
|
237
|
234
|
const retval = {
|
238
|
235
|
learnMore: getString("learnMore", "Learn more"),
|
239
|
|
- errorPage: {
|
240
|
|
- browser: getString("errorPage.browser", "Browser"),
|
241
|
|
- network: getString("errorPage.network", "Network"),
|
242
|
|
- onionSite: getString("errorPage.onionSite", "Onionsite"),
|
243
|
|
- },
|
244
|
|
- descNotFound: {
|
245
|
|
- // Tor SOCKS error 0xF0
|
246
|
|
- pageTitle: getString(
|
247
|
|
- "descNotFound.pageTitle",
|
248
|
|
- kProblemLoadingSiteFallback
|
249
|
|
- ),
|
250
|
|
- header: getString("descNotFound.header", "Onionsite Not Found"),
|
251
|
|
- longDescription: getString(
|
252
|
|
- "descNotFound.longDescription",
|
253
|
|
- kLongDescFallback
|
254
|
|
- ),
|
255
|
|
- },
|
256
|
|
- descInvalid: {
|
257
|
|
- // Tor SOCKS error 0xF1
|
258
|
|
- pageTitle: getString(
|
259
|
|
- "descInvalid.pageTitle",
|
260
|
|
- kProblemLoadingSiteFallback
|
261
|
|
- ),
|
262
|
|
- header: getString("descInvalid.header", "Onionsite Cannot Be Reached"),
|
263
|
|
- longDescription: getString(
|
264
|
|
- "descInvalid.longDescription",
|
265
|
|
- kLongDescFallback
|
266
|
|
- ),
|
267
|
|
- },
|
268
|
|
- introFailed: {
|
269
|
|
- // Tor SOCKS error 0xF2
|
270
|
|
- pageTitle: getString(
|
271
|
|
- "introFailed.pageTitle",
|
272
|
|
- kProblemLoadingSiteFallback
|
273
|
|
- ),
|
274
|
|
- header: getString("introFailed.header", "Onionsite Has Disconnected"),
|
275
|
|
- longDescription: getString(
|
276
|
|
- "introFailed.longDescription",
|
277
|
|
- kLongDescFallback
|
278
|
|
- ),
|
279
|
|
- },
|
280
|
|
- rendezvousFailed: {
|
281
|
|
- // Tor SOCKS error 0xF3
|
282
|
|
- pageTitle: getString(
|
283
|
|
- "rendezvousFailed.pageTitle",
|
284
|
|
- kProblemLoadingSiteFallback
|
285
|
|
- ),
|
286
|
|
- header: getString(
|
287
|
|
- "rendezvousFailed.header",
|
288
|
|
- "Unable to Connect to Onionsite"
|
289
|
|
- ),
|
290
|
|
- longDescription: getString(
|
291
|
|
- "rendezvousFailed.longDescription",
|
292
|
|
- kLongDescFallback
|
293
|
|
- ),
|
294
|
|
- },
|
295
|
|
- clientAuthMissing: {
|
296
|
|
- // Tor SOCKS error 0xF4
|
297
|
|
- pageTitle: getString(
|
298
|
|
- "clientAuthMissing.pageTitle",
|
299
|
|
- "Authorization Required"
|
300
|
|
- ),
|
301
|
|
- header: getString(
|
302
|
|
- "clientAuthMissing.header",
|
303
|
|
- "Onionsite Requires Authentication"
|
304
|
|
- ),
|
305
|
|
- longDescription: getString(
|
306
|
|
- "clientAuthMissing.longDescription",
|
307
|
|
- kLongDescFallback
|
308
|
|
- ),
|
309
|
|
- },
|
310
|
|
- clientAuthIncorrect: {
|
311
|
|
- // Tor SOCKS error 0xF5
|
312
|
|
- pageTitle: getString(
|
313
|
|
- "clientAuthIncorrect.pageTitle",
|
314
|
|
- "Authorization Failed"
|
315
|
|
- ),
|
316
|
|
- header: getString(
|
317
|
|
- "clientAuthIncorrect.header",
|
318
|
|
- "Onionsite Authentication Failed"
|
319
|
|
- ),
|
320
|
|
- longDescription: getString(
|
321
|
|
- "clientAuthIncorrect.longDescription",
|
322
|
|
- kLongDescFallback
|
323
|
|
- ),
|
324
|
|
- },
|
325
|
|
- badAddress: {
|
326
|
|
- // Tor SOCKS error 0xF6
|
327
|
|
- pageTitle: getString(
|
328
|
|
- "badAddress.pageTitle",
|
329
|
|
- kProblemLoadingSiteFallback
|
330
|
|
- ),
|
331
|
|
- header: getString("badAddress.header", "Invalid Onionsite Address"),
|
332
|
|
- longDescription: getString(
|
333
|
|
- "badAddress.longDescription",
|
334
|
|
- kLongDescFallback
|
335
|
|
- ),
|
336
|
|
- },
|
337
|
|
- introTimedOut: {
|
338
|
|
- // Tor SOCKS error 0xF7
|
339
|
|
- pageTitle: getString(
|
340
|
|
- "introTimedOut.pageTitle",
|
341
|
|
- kProblemLoadingSiteFallback
|
342
|
|
- ),
|
343
|
|
- header: getString(
|
344
|
|
- "introTimedOut.header",
|
345
|
|
- "Onionsite Circuit Creation Timed Out"
|
346
|
|
- ),
|
347
|
|
- longDescription: getString(
|
348
|
|
- "introTimedOut.longDescription",
|
349
|
|
- kLongDescFallback
|
350
|
|
- ),
|
351
|
|
- },
|
352
|
236
|
authPrompt: {
|
353
|
237
|
description: getString(
|
354
|
238
|
"authPrompt.description2",
|
toolkit/themes/shared/aboutNetError.css
... |
... |
@@ -8,11 +8,11 @@ body { |
8
|
8
|
--warning-color: #ffa436;
|
9
|
9
|
}
|
10
|
10
|
|
|
11
|
+/**
|
|
12
|
+ * Blank page whilst we show the prompt.
|
|
13
|
+ */
|
11
|
14
|
body.onionAuthPrompt {
|
12
|
|
- background: white;
|
13
|
|
-}
|
14
|
|
-.onionAuthPrompt > * {
|
15
|
|
- display: none;
|
|
15
|
+ display: none !important;
|
16
|
16
|
}
|
17
|
17
|
|
18
|
18
|
@media (prefers-color-scheme: dark) {
|
... |
... |
@@ -50,6 +50,13 @@ body.certerror .title { |
50
|
50
|
color: var(--warning-color);
|
51
|
51
|
}
|
52
|
52
|
|
|
53
|
+body.onion-error .title {
|
|
54
|
+ background-image: url("chrome://browser/skin/onion-warning.svg");
|
|
55
|
+ -moz-context-properties: fill, stroke;
|
|
56
|
+ fill: currentColor;
|
|
57
|
+ stroke: var(--warning-color);
|
|
58
|
+}
|
|
59
|
+
|
53
|
60
|
body.blocked .title {
|
54
|
61
|
background-image: url("chrome://global/skin/icons/blocked.svg");
|
55
|
62
|
}
|
toolkit/torbutton/chrome/locale/en-US/torbutton.properties
... |
... |
@@ -32,53 +32,6 @@ onionServices.authPreferences.removeAll=Remove All |
32
|
32
|
onionServices.authPreferences.failedToGetKeys=Unable to retrieve keys from tor
|
33
|
33
|
onionServices.authPreferences.failedToRemoveKey=Unable to remove key
|
34
|
34
|
|
35
|
|
-# Onion services error strings.
|
36
|
|
-onionServices.errorPage.browser=Browser
|
37
|
|
-onionServices.errorPage.network=Network
|
38
|
|
-onionServices.errorPage.onionSite=Onionsite
|
39
|
|
-# LOCALIZATION NOTE: In the longDescription strings, %S will be replaced with
|
40
|
|
-# an error code, e.g., 0xF3.
|
41
|
|
-# Tor SOCKS error 0xF0:
|
42
|
|
-onionServices.descNotFound.pageTitle=Problem Loading Onionsite
|
43
|
|
-onionServices.descNotFound.header=Onionsite Not Found
|
44
|
|
-onionServices.descNotFound=The most likely cause is that the onionsite is offline. Contact the onionsite administrator.
|
45
|
|
-onionServices.descNotFound.longDescription=Details: %S — The requested onion service descriptor can't be found on the hashring and therefore the service is not reachable by the client.
|
46
|
|
-# Tor SOCKS error 0xF1:
|
47
|
|
-onionServices.descInvalid.pageTitle=Problem Loading Onionsite
|
48
|
|
-onionServices.descInvalid.header=Onionsite Cannot Be Reached
|
49
|
|
-onionServices.descInvalid=The onionsite is unreachable due an internal error.
|
50
|
|
-onionServices.descInvalid.longDescription=Details: %S — The requested onion service descriptor can't be parsed or signature validation failed.
|
51
|
|
-# Tor SOCKS error 0xF2:
|
52
|
|
-onionServices.introFailed.pageTitle=Problem Loading Onionsite
|
53
|
|
-onionServices.introFailed.header=Onionsite Has Disconnected
|
54
|
|
-onionServices.introFailed=The most likely cause is that the onionsite is offline. Contact the onionsite administrator.
|
55
|
|
-onionServices.introFailed.longDescription=Details: %S — Introduction failed, which means that the descriptor was found but the service is no longer connected to the introduction point. It is likely that the service has changed its descriptor or that it is not running.
|
56
|
|
-# Tor SOCKS error 0xF3:
|
57
|
|
-onionServices.rendezvousFailed.pageTitle=Problem Loading Onionsite
|
58
|
|
-onionServices.rendezvousFailed.header=Unable to Connect to Onionsite
|
59
|
|
-onionServices.rendezvousFailed=The onionsite is busy or the Tor network is overloaded. Try again later.
|
60
|
|
-onionServices.rendezvousFailed.longDescription=Details: %S — The client failed to rendezvous with the service, which means that the client was unable to finalize the connection.
|
61
|
|
-# Tor SOCKS error 0xF4:
|
62
|
|
-onionServices.clientAuthMissing.pageTitle=Authorization Required
|
63
|
|
-onionServices.clientAuthMissing.header=Onionsite Requires Authentication
|
64
|
|
-onionServices.clientAuthMissing=Access to the onionsite requires a key but none was provided.
|
65
|
|
-onionServices.clientAuthMissing.longDescription=Details: %S — The client downloaded the requested onion service descriptor but was unable to decrypt its content because client authorization information is missing.
|
66
|
|
-# Tor SOCKS error 0xF5:
|
67
|
|
-onionServices.clientAuthIncorrect.pageTitle=Authorization Failed
|
68
|
|
-onionServices.clientAuthIncorrect.header=Onionsite Authentication Failed
|
69
|
|
-onionServices.clientAuthIncorrect=The provided key is incorrect or has been revoked. Contact the onionsite administrator.
|
70
|
|
-onionServices.clientAuthIncorrect.longDescription=Details: %S — The client was able to download the requested onion service descriptor but was unable to decrypt its content using the provided client authorization information. This may mean that access has been revoked.
|
71
|
|
-# Tor SOCKS error 0xF6:
|
72
|
|
-onionServices.badAddress.pageTitle=Problem Loading Onionsite
|
73
|
|
-onionServices.badAddress.header=Invalid Onionsite Address
|
74
|
|
-onionServices.badAddress=The provided onionsite address is invalid. Please check that you entered it correctly.
|
75
|
|
-onionServices.badAddress.longDescription=Details: %S — The provided .onion address is invalid. This error is returned due to one of the following reasons: the address checksum doesn't match, the ed25519 public key is invalid, or the encoding is invalid.
|
76
|
|
-# Tor SOCKS error 0xF7:
|
77
|
|
-onionServices.introTimedOut.pageTitle=Problem Loading Onionsite
|
78
|
|
-onionServices.introTimedOut.header=Onionsite Circuit Creation Timed Out
|
79
|
|
-onionServices.introTimedOut=Failed to connect to the onionsite, possibly due to a poor network connection.
|
80
|
|
-onionServices.introTimedOut.longDescription=Details: %S — The connection to the requested onion service timed out while trying to build the rendezvous circuit.
|
81
|
|
-
|
82
|
35
|
# Profile/startup error messages.
|
83
|
36
|
# LOCALIZATION NOTE: %S is the application name.
|
84
|
37
|
profileProblemTitle=%S Profile Problem
|
tools/lint/eslint/eslint-plugin-mozilla/lib/environments/remote-page.js
... |
... |
@@ -39,6 +39,5 @@ module.exports = { |
39
|
39
|
RPMGetTRRDomain: false,
|
40
|
40
|
RPMIsSiteSpecificTRRError: false,
|
41
|
41
|
RPMSetTRRDisabledLoadFlags: false,
|
42
|
|
- RPMGetTorStrings: false,
|
43
|
42
|
},
|
44
|
43
|
}; |
tools/torbrowser/l10n/migrations/bug-41622-neterror.py
|
1
|
+from fluent.migrate.helpers import transforms_from
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+def migrate(ctx):
|
|
5
|
+ ctx.add_transforms(
|
|
6
|
+ "tor-browser.ftl",
|
|
7
|
+ "tor-browser.ftl",
|
|
8
|
+ transforms_from(
|
|
9
|
+ """
|
|
10
|
+onion-neterror-not-found-description = { COPY(path, "onionServices.descNotFound") }
|
|
11
|
+onion-neterror-unreachable-description = { COPY(path, "onionServices.descInvalid") }
|
|
12
|
+onion-neterror-disconnected-description = { COPY(path, "onionServices.introFailed") }
|
|
13
|
+onion-neterror-connection-failed-description = { COPY(path, "onionServices.rendezvousFailed") }
|
|
14
|
+onion-neterror-missing-authentication-description = { COPY(path, "onionServices.clientAuthMissing") }
|
|
15
|
+onion-neterror-incorrect-authetication-description = { COPY(path, "onionServices.clientAuthIncorrect") }
|
|
16
|
+onion-neterror-invalid-address-description = { COPY(path, "onionServices.badAddress") }
|
|
17
|
+onion-neterror-timed-out-description = { COPY(path, "onionServices.introTimedOut") }
|
|
18
|
+""",
|
|
19
|
+ path="torbutton.properties",
|
|
20
|
+ ),
|
|
21
|
+ ) |
|