morgan pushed to branch tor-browser-153.0esr-16.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
72159ca2
by Pier Angelo Vendrame at 2026-08-05T14:10:10+00:00
1 changed file:
Changes:
| ... | ... | @@ -1384,28 +1384,29 @@ async function ensureCertErrorCode() { |
| 1384 | 1384 | i++;
|
| 1385 | 1385 | errorCode = await retryCertErrorCode();
|
| 1386 | 1386 | }
|
| 1387 | +}
|
|
| 1387 | 1388 | |
| 1388 | - if (!errorCode) {
|
|
| 1389 | - errorCode = gErrorCode;
|
|
| 1389 | +async function maybeRedirectToBootstrap() {
|
|
| 1390 | + if (gErrorCode !== "proxyConnectFailure") {
|
|
| 1391 | + return;
|
|
| 1390 | 1392 | }
|
| 1391 | - if (errorCode === "proxyConnectFailure") {
|
|
| 1392 | - let inIframe;
|
|
| 1393 | - try {
|
|
| 1394 | - inIframe = window.self !== window.top;
|
|
| 1395 | - } catch {
|
|
| 1396 | - // Assume a frame if access to top is blocked.
|
|
| 1397 | - inIframe = true;
|
|
| 1398 | - }
|
|
| 1399 | - if (!inIframe && (await RPMSendQuery("ShouldShowTorConnect"))) {
|
|
| 1400 | - // pass orginal destination as redirect param
|
|
| 1401 | - const encodedRedirect = encodeURIComponent(document.location.href);
|
|
| 1402 | - document.location.replace(`about:torconnect?redirect=${encodedRedirect}`);
|
|
| 1403 | - }
|
|
| 1393 | + let inIframe;
|
|
| 1394 | + try {
|
|
| 1395 | + inIframe = window.self !== window.top;
|
|
| 1396 | + } catch {
|
|
| 1397 | + // Assume a frame if access to top is blocked.
|
|
| 1398 | + inIframe = true;
|
|
| 1399 | + }
|
|
| 1400 | + if (!inIframe && (await RPMSendQuery("ShouldShowTorConnect"))) {
|
|
| 1401 | + // pass orginal destination as redirect param
|
|
| 1402 | + const encodedRedirect = encodeURIComponent(document.location.href);
|
|
| 1403 | + document.location.replace(`about:torconnect?redirect=${encodedRedirect}`);
|
|
| 1404 | 1404 | }
|
| 1405 | 1405 | }
|
| 1406 | 1406 | |
| 1407 | 1407 | async function main() {
|
| 1408 | 1408 | await ensureCertErrorCode();
|
| 1409 | + await maybeRedirectToBootstrap();
|
|
| 1409 | 1410 | if (!NetErrorCard.isSupported()) {
|
| 1410 | 1411 | // Initialize the error registry for legacy path
|
| 1411 | 1412 | initializeRegistry();
|