async handleProxifiedRequest()

in src/js/background/assignManager.js [195:219]


  async handleProxifiedRequest(requestInfo) {
    // The following blocks potentially dangerous requests for privacy that come without a tabId

    if(requestInfo.tabId === -1) {
      return {};
    }

    const tab = await browser.tabs.get(requestInfo.tabId);
    const result = await proxifiedContainers.retrieve(tab.cookieStoreId);
    if (!result || !result.proxy) {
      return {};
    }

    // proxyDNS only works for SOCKS proxies
    if (["socks", "socks4"].includes(result.proxy.type)) {
      result.proxy.proxyDNS = true;
    }

    if (!result.proxy.mozProxyEnabled) {
      return result.proxy;
    }

    // Let's add the isolation key.
    return [{ ...result.proxy, connectionIsolationKey: "" + MozillaVPN_Background.isolationKey }];
  },