mozilla / multi-account-containers

Firefox Multi-Account Containers lets you keep parts of your online life separated into color-coded tabs that preserve your privacy. Cookies are separated by container, allowing you to use the web with multiple identities or accounts simultaneously.
https://addons.mozilla.org/firefox/addon/multi-account-containers/
Mozilla Public License 2.0
2.71k stars 341 forks source link

Content script of webextension operating in a tab using Firefox VPN through multi-account container does not go through vpn. #2483

Closed noobLue closed 1 year ago

noobLue commented 1 year ago

Before submitting a bug report

Step to reproduce

  1. Create a container and set it to use a Firefox vpn in some location
  2. Create a simple webextension with a content script that checks it's ip from some service. (webRequest to some ip service)
  3. Check ip on container tab, it will be the ip address of the country defined in the container's Firefox VPN settings.
  4. Check ip from content script, it will be your computers ip.

Check ip with jQuery:

var apiKey2 = 'd9e53816d07345139c58d0ea733e3870';
$.getJSON('https://api.bigdatacloud.net/data/ip-geolocation?key=' + apiKey2, function(data) {
console.log(`My ip: ${data.ip}`);
});

Actual behavior

Web requests made from a content script of a random webextension in a containerized tab don't go through the Firefox vpn, that is set up on a multi-account-container.

Expected behavior

Content scripts that are designed to change the functionality of a webpage should go through the same network as that webpage. The firefox vpn option in multi-account containers should also support the WebRequests from a content scripts of a WebExtensions.

Additional informations

Not sure if this is an issue with multi-account-container or is limited by Firefox design

Provide a copy of Troubleshooting Information page (optional)

No response

dannycolin commented 1 year ago

By default, the browser doesn't allow WebExtensions to communicate with each others.

noobLue commented 1 year ago

By default, the browser doesn't allow WebExtensions to communicate with each others.

Yes, thank you. I fixed the problem by injecting the code into the page DOM and the requests went through the vpn :)