Commit 72159ca2 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by morgan
Browse files

fixup! TB 27476: Implement about:torconnect captive portal within Tor Browser

TB 45192: Fix about:torconnect redirects for HSTS-preloaded URLs.
parent c81304d6
Loading
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -1384,11 +1384,12 @@ async function ensureCertErrorCode() {
    i++;
    errorCode = await retryCertErrorCode();
  }
}

  if (!errorCode) {
    errorCode = gErrorCode;
async function maybeRedirectToBootstrap() {
  if (gErrorCode !== "proxyConnectFailure") {
    return;
  }
  if (errorCode === "proxyConnectFailure") {
  let inIframe;
  try {
    inIframe = window.self !== window.top;
@@ -1402,10 +1403,10 @@ async function ensureCertErrorCode() {
    document.location.replace(`about:torconnect?redirect=${encodedRedirect}`);
  }
}
}

async function main() {
  await ensureCertErrorCode();
  await maybeRedirectToBootstrap();
  if (!NetErrorCard.isSupported()) {
    // Initialize the error registry for legacy path
    initializeRegistry();