Commit 1f8e95ba authored by ma1's avatar ma1 Committed by ma1
Browse files

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

TB 45264: Use parent process for TorConnect redirections
parent 7abdb578
Loading
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -60,12 +60,7 @@ export class TorConnectChild extends RemotePageChild {
      console.error(`Invalid redirect URL "${redirect}"`);
    }

    // Replace the destination to prevent "about:torconnect" entering the
    // history.
    // NOTE: This is done here, in the window actor, rather than in content
    // because we have the privilege to redirect to a "chrome:" uri here (for
    // when the HomePage is set to be blank).
    this.contentWindow.location.replace(replaceURI);
    this.sendQuery("torconnect:redirect", replaceURI);
  }

  actorCreated() {
+10 −0
Original line number Diff line number Diff line
@@ -112,6 +112,16 @@ export class TorConnectParent extends JSWindowActorParent {
        return Promise.resolve(
          TorConnectParent.fixupURIs(lazy.HomePage.get())[0]
        );
      case "torconnect:redirect":
        this.browsingContext.top.embedderElement.loadURI(
          Services.io.newURI(message.data),
          {
            triggeringPrincipal:
              Services.scriptSecurityManager.getSystemPrincipal(),
            loadFlags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
          }
        );
        break;
      case "torconnect:set-quickstart":
        TorConnect.quickstart = message.data;
        break;