Skip to content

Commit a17b6b3

Browse files
Fix FXVPN-412 (#213)
Fixes [FXVPN-412](https://mozilla-hub.atlassian.net/browse/FXVPN-412) - Sites with custom locations are broken when the client and extension are off if a browser level proxy setting exists. This patch modifies `proxyAllReqsByDefault` to return true when: 1. the client is On and the Extension is Off (extState.bypassTunnel == true) 2. the Client is Off and the Extension is On 3. the Client _and_ extension are both on _and_ a browser level proxy setting is present (we previously weren't removing the req listener when a browser level proxy setting was present, thus bricking sites with custom geolocation settings)
1 parent c1098b1 commit a17b6b3

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/background/proxyHandler/proxyUtils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export const ProxyUtils = {
2323
return (
2424
settingValue?.proxyType != "none" &&
2525
!(
26-
settingValue?.autoConfigUrl == "" &&
27-
settingValue?.http == "" &&
28-
settingValue?.socks == ""
26+
settingValue?.autoConfigUrl == undefined &&
27+
settingValue?.http == undefined &&
28+
settingValue?.socks == undefined
2929
)
3030
);
3131
},

src/background/requestHandler.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class RequestHandler extends Component {
6161

6262
extController.state.subscribe((s) => {
6363
this.extState = s;
64-
this.handleExtensionStateChanges(s);
64+
return this.addOrRemoveRequestListener();
6565
});
6666

6767
propertySum(
@@ -83,14 +83,6 @@ export class RequestHandler extends Component {
8383
this.currentExitRelay = exitRelays;
8484
}
8585

86-
/**
87-
* Handles changes in extension state and updates request listener.
88-
* @param {FirefoxVPNState} extState
89-
*/
90-
handleExtensionStateChanges(extState) {
91-
return this.addOrRemoveRequestListener();
92-
}
93-
9486
async init() {
9587
log("Initiating RequestHandler");
9688
}
@@ -132,7 +124,9 @@ export class RequestHandler extends Component {
132124
return (
133125
this.extState.bypassTunnel ||
134126
this.extState.useExitRelays ||
135-
ProxyUtils.browserProxySettingIsValid(this.browserProxySettings?.value)
127+
(this.extState.enabled &&
128+
!this.extState.useExitRelays &&
129+
ProxyUtils.browserProxySettingIsValid(this.browserProxySettings?.value))
136130
);
137131
}
138132

src/background/toolbarIconHandler.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ export class ToolbarIconHandler extends Component {
9292
return this.setIcon(scheme, "disabled", windowInfo.id);
9393
}
9494

95-
let status = ["Connecting", "Enabled"].includes(this.extState.state)
95+
let status = ["Connecting", "Enabled"].includes(this.extState?.state)
9696
? "enabled"
9797
: "disabled";
98-
9998
const stability = this.vpnState?.connectionHealth;
10099

101100
if (!stability || stability == "Stable") {

0 commit comments

Comments
 (0)