Verified Commit 9d6ca8ac authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain.

Collect the browsers also on Android.
parent 410b9a4c
Loading
Loading
Loading
Loading
+10 −0
Changes for toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -475,9 +475,19 @@ class TorDomainIsolatorImpl {
   * @returns {MozBrowser?} The browser the channel is associated to
   */
  #getBrowserForChannel(channel) {
    const currentBrowser =
      channel.loadInfo.browsingContext?.topChromeWindow?.browser;
    if (
      channel.loadInfo.browsingContext &&
      currentBrowser?.browsingContext === channel.loadInfo.browsingContext
    ) {
      // Android has only one browser, and does not have the browsers property.
      return currentBrowser;
    }
    const browsers =
      channel.loadInfo.browsingContext?.topChromeWindow?.gBrowser?.browsers;
    if (!browsers || !channel.loadInfo.browsingContext?.browserId) {
      logger.debug("Missing data to associate to a browser", channel.loadInfo);
      return null;
    }
    for (const browser of browsers) {