uazo / cromite

Cromite a Bromite fork with ad blocking and privacy enhancements; take back your browser!
https://www.cromite.org/
GNU General Public License v3.0
2.9k stars 65 forks source link

[Android] Warn the user when changing ip #1220

Open uazo opened 3 weeks ago

uazo commented 3 weeks ago

Preliminary checklist

Is your feature request related to privacy?

Yes

Is there a patch available for this feature somewhere?

No

Describe the solution you would like

I would like to understand whether it is possible, without using resources on the internet, to intercept the ip change in android and alert the user requesting for a restart. The underlying assumption is that by having the automatic deletion active, the user may be induced to exploit the change of network to untie different sessions: comments on this point are welcome, I don't think of myself as an expert, so constructive discussion is welcome.

I have already analysed the possibilities and come up with this:

Of course, the limit of this idea is that re-opening the same url between different sessions might make it possible to hang up on the user, because there may be user-related information in the url. but it would be useful to me, since I use cromite in android basically for unrelated searches, and the urls of the pages that are always open are checked. therefore, the patch should be considered as a test and should only be done if it takes little time to write it.

Describe alternatives you have considered

none

uazo commented 3 weeks ago

by freezing the page, but there is a nice DCHECK that prevents freezing the visible page, to be checked if it is because it is really not possible to freeze the current page or just because it is not logically correct

explanation: https://issues.chromium.org/issues/40590208

uazo commented 3 weeks ago

I summarise what I found.

it is possible to take advantage of the chromuim offlinedector to see if the network has changed. unfortunately for now the assumption is that it also works with the ip change, because trying it only with the emulator does not allow me to try it. if there is someone who also tries it with vpn (which I don't use) I would be pleased.

when the network change is detected I activate the following things:

I have deliberately left the sending of ui messages by the browser on, although this can, in some cases, lead to the failure of some dchecks at unfreeze: sending the messages allows me to understand that indeed javascript execution is being blocked. execution resumes if the user responds to the message without selecting restart or uses one of the browser functions or launches navigation to a new url.

along with this patch I also disabled by default the auto-reconnect of quic connections (excluding those to the provider doh), otherwise it would have been all useless :)

uazo commented 2 weeks ago

~It seems to be working~, ip change is detected in the mobile phone network, I really didn't expect it :) ~next step, add the setting and activate it by default.~

no, the change is not detected if the browser is in the background.

@PF4Public do you detect any drawbacks?

PF4Public commented 2 weeks ago

@PF4Public do you detect any drawbacks?

Does everything you wrote here also apply for desktop? I'm afraid I wouldn't be able to test it on Android.

uazo commented 2 weeks ago

Does everything you wrote here also apply for desktop?

unfortunately, only android. it is actually written in the chromium code that there is no API to exploit on desktop platforms.