-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make BrowserAction actually WERK #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R+ with commentary
const localProxy = vpnState.loophole | ||
? [ProxyUtils.parseProxy(vpnState.loophole)] | ||
: []; | ||
siteContexts.forEach((ctx, origin) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about setting a proxyInfoToBypassTunnel
(needsBetterName) in RequestListener (or maybe in ProxyHandler would make more sense) and then doing something like if (excluded) then return proxyInfoToBypassTunnel
in interceptRequests(). Seems easier to update this in just one place if the socksproxy info changes or if we go into StateOnPartial
, where we'll want to return { type: "direct" }
for excluded sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then again: maybe it's better to take the ding here instead of adding another check in interceptRequests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to pull this out into a pure function so our "where does this site go?" becomes trivial to test. Currently interceptRequests is already doing multiple things :D
So in theory this function i would envision this function to check the VPN state and react to that :)
|
||
for (let urlString of [url, originUrl]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious: have you seen any requests where documentUrl
is different than originUrl
? I think we'll need to keep url
here for the situations where someone is on aSiteWithoutProxyConfig
with requests going to aSiteThatDoesHaveAProxyConfig
, which we'd want to reroute according to the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do a 3rdparty-request, yes.
Just go to whatismyip.com and you will see requests with originURL
Array [ "c.amazon-adsystem.com", undefined ]
requestHandler.js:101:17
Array [ "fonts.googleapis.com", undefined ]
requestHandler.js:101:17
Array [ "fonts.gstatic.com", undefined ]
requestHandler.js:101:17
Array [ "config.aps.amazon-adsystem.com", undefined ]
requestHandler.js:101:17
Array [ "tpc.googlesyndication.com", undefined ]
requestHandler.js:101:17
Array [ "secure.cdn.fastclick.net", undefined ]
requestHandler.js:101:17
Array [ "tags.crwdcntrl.net", undefined ]
on aSiteWithoutProxyConfig with requests going to aSiteThatDoesHaveAProxyConfig,
We should not do that imho.
evil.com (rule: Berlin)
whatIsMyIP.com (rule: None and the user is Connected to Brazil. )
and evil.com does fetch(whatIsMyIP.com)
evil.com has just learned another IP the user is using right now.
Firefox "total cookie protection" is partitions storage by top the level document origin, so i think for consistency we should do that too :)
This is my current branch i demoed....
i tried to make this easier to review by making small commit but this is still quite big. SORRY ❤️