[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] branch tor-browser-91.7.0esr-11.5-1 updated: fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser



This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.7.0esr-11.5-1
in repository tor-browser.

The following commit(s) were added to refs/heads/tor-browser-91.7.0esr-11.5-1 by this push:
     new 111041676aed fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser
111041676aed is described below

commit 111041676aed0f28f03b2f183c6a9eed065fb2a0
Author: Pier Angelo Vendrame <pierov@xxxxxxxxxxxxxx>
AuthorDate: Fri Mar 11 18:44:34 2022 +0100

    fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser
    
    Moved the checks outside `initPage`, as per Richard's comments, to avoid
    dispatching the `AboutNetErrorLoad` event.
---
 .../components/httpsonlyerror/content/errorpage.js | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/toolkit/components/httpsonlyerror/content/errorpage.js b/toolkit/components/httpsonlyerror/content/errorpage.js
index 3684475d4935..cdb269346eeb 100644
--- a/toolkit/components/httpsonlyerror/content/errorpage.js
+++ b/toolkit/components/httpsonlyerror/content/errorpage.js
@@ -8,14 +8,7 @@
 
 const searchParams = new URLSearchParams(document.documentURI.split("?")[1]);
 
-async function initPage() {
-  if (await RPMSendQuery("ShouldShowTorConnect")) {
-    // pass orginal destination as redirect param
-    const encodedRedirect = encodeURIComponent(document.location.href);
-    document.location.replace(`about:torconnect?redirect=${encodedRedirect}`);
-    return;
-  }
-
+function initPage() {
   if (!searchParams.get("e")) {
     document.getElementById("error").remove();
   }
@@ -131,8 +124,17 @@ function addAutofocus(selector, position = "afterbegin") {
 
 /* Initialize Page */
 
-initPage();
-// Dispatch this event so tests can detect that we finished loading the error page.
-// We're using the same event name as neterror because BrowserTestUtils.jsm relies on that.
-let event = new CustomEvent("AboutNetErrorLoad", { bubbles: true });
-document.dispatchEvent(event);
+RPMSendQuery("ShouldShowTorConnect").then(shouldShow => {
+  if (shouldShow) {
+    // pass orginal destination as redirect param
+    const encodedRedirect = encodeURIComponent(document.location.href);
+    document.location.replace(`about:torconnect?redirect=${encodedRedirect}`);
+    return;
+  }
+
+  initPage();
+  // Dispatch this event so tests can detect that we finished loading the error page.
+  // We're using the same event name as neterror because BrowserTestUtils.jsm relies on that.
+  let event = new CustomEvent("AboutNetErrorLoad", { bubbles: true });
+  document.dispatchEvent(event);
+});

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits