Skip to content
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

Merged
merged 17 commits into from
Aug 7, 2024
Merged

Make BrowserAction actually WERK #29

merged 17 commits into from
Aug 7, 2024

Conversation

strseb
Copy link
Collaborator

@strseb strseb commented Aug 6, 2024

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 ❤️

@strseb strseb changed the title Basti/ipc all Make BrowserAction actually WERK Aug 6, 2024
Copy link
Member

@lesleyjanenorton lesleyjanenorton left a 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) => {
Copy link
Member

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.

Copy link
Member

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.

Copy link
Collaborator Author

@strseb strseb Aug 7, 2024

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 :)

src/background/requestHandler.js Outdated Show resolved Hide resolved

for (let urlString of [url, originUrl]) {
Copy link
Member

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.

Copy link
Collaborator Author

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 :)

src/background/requestHandler.js Outdated Show resolved Hide resolved
@strseb strseb merged commit e2d8c52 into main Aug 7, 2024
5 checks passed
@strseb strseb deleted the basti/ipc_all branch August 7, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants