salarcode / SmartProxy

Firefox/Chrome browser extension. SmartProxy will automatically enable/disable proxy for the sites you visit, based on customizable patterns.
https://addons.mozilla.org/en-US/firefox/addon/smartproxy/
GNU General Public License v3.0
1.93k stars 117 forks source link

Fix proxy per tab/origin feature #406

Closed brawaru closed 4 weeks ago

brawaru commented 4 weeks ago

In b486a8c252, in an attempt to fix incognito profile not applying, a fix was made to check for incognito on request details, rather than the tab data. This fix, however, had an unfortunate side effect of removing assignment of tabData. That resulted in profile not applying to any of the requests made on the tab, completely breaking the proxy per tab/origin feature.

This PR brings back assignment of tabData, but only if previous incognito condition did not apply, which should hopefully correct the previous incognito fix, making proxy per tab/origin feature functional again.

Fixes #403

brawaru commented 4 weeks ago

Tested in dev mode, this seems to work.

To reproduce,

  1. Have "Enable proxy per tab/origin" feature enabled.
  2. Add www.ipify.org (mind www.) to proxied domains.
  3. Visit https://www.ipify.org/.

Expected result: IP matches the one of proxy, because requests to api.ipify.org made on that tab were proxied.

salarcode commented 4 weeks ago

This makes sense now, thanks, but placement of tabData = TabManager.getTab could be better and it should always run so else is not needed. I have pushed a commit with that