blokadaorg / blokada

The official repo for Blokada apps.
https://blokada.org
3.07k stars 215 forks source link

I want an easy way to check if ad blocking works #255

Open alexanderadam opened 6 years ago

alexanderadam commented 6 years ago

This issue is similar to #187.

Maybe it would even useful to give Blokada the possibility to make a health check for blocking on it's own.

Let's say:

  1. Check whether DNS is working (#187). If it isn't: inform the user that blokada has a DNS problem
  2. check whether we are online. Maybe this functionality exists already or we should try to reach https://www.fsf.org/ and http://blokada.org/ (or other domains that definitely shouldn't be blocked and maybe aren't allowed to be blacklisted)
  3. check whether a hardcoded, blocked domain is not reachable (i.e. http://auto-ad-test.blokada.org/) (and obviously don't allow whitelisting for this domain)

Inform the user if 2. was successful and 3. wasn't, that Blokada has some blocking problems.

This check should probably be done on initialization and maybe once an hour.

Issue like #137 would also be visible earlier.

jawz101 commented 6 years ago

Notifications can tell you when it's working. Anything else feels like overengineering.

alexanderadam commented 6 years ago

Hi @jawz101, no it obviously can't. See #137 for example (there are other issues where blocking wasn't working). The notification only shows that it's running. It can't show whether it is indeed able to block anything.

peterroth commented 6 years ago

It can be a bit misleading. If you say, that "adblocking is working" in the app, you expect every ad is blocked on the net and in the apps, however only that one ad, that is for testing purpose is blocked, and Blokada can't guarantee that every ad is blocked, as it depends on the lists you use. I understand the goal and I think it's a good and user friendly initiative, but can be confusing.

jawz101 commented 6 years ago

@rpeter85 that's another good point.

It's similar to something I've requested to remove from some popular blocklists that block evil-tracker.net, trackersimulator.org, and do-not-tracker.org to pass panopticlick tests as well as fp2.js in adblock-formatted blocklists. I said something like "these test cookies and scripts do certain things to test certain techniques. Flat out blocking these domains and scripts are just voiding these particular, innocuous tests on this particular test site. I'd actually like to see if other protections are actually blocking the things they are testing. Otherwise, you're just giving people a false sense of security as a genuine domain or script you'd want to block will simply be named differently."

alexanderadam commented 6 years ago

@rpeter85 but if you know that not even the hardcoded ad wasn't blocked, you know that all other ads wont be blocked as well.

peterroth commented 6 years ago

yes, if you know that is just a test, yes. Trend is, that only a very limited number of users read what is on the screen or checks the start up screen that explains what is what. My impression is that would confuse people. I don't say it's not a good idea, as it is definitely a good one, but risky.

jawz101 commented 6 years ago

What I'm thinking -and I can't find many apps that do this- is a log that shows all of your DNS lookups. If they are being blocked it shows that they are resolving to whatever the loopback ip is and if they are passing through it shows the results of the resolution.

The only implementations I've found so far is AdGuard and NetGuard.

In AdGuard it's under the filtering log menu item.

In NetGuard you can find it under Settings/Advanced/Show Resolved Domain Names . Here, it shows you the resulting IP. If it's being blocked it shows the loopback it uses (10.10.10.1 is the default value I think).

I've been hunting for something like this so I can see if any domains are getting through so I can add them to a personal blocklist. The other feature I cannot find is one that lets you export the resolutions so I can review several days of logs since so much happens when I'm not looking at it.

peterroth commented 6 years ago

You opened a separate request for this, it's https://github.com/blokadaorg/blokada/issues/264. And there is another one to log blocked hosts: https://github.com/blokadaorg/blokada/issues/178

This ticket is to request a feature to easily check if the blocking mechanism is working.

alexanderadam commented 6 years ago

@jawz101 your last comment really isn't related to this issue here at all, right?

It can be a bit misleading. If you say, that "adblocking is working" in the app, you expect every ad is blocked on the net and in the apps, however only that one ad, that is for testing purpose is blocked, and Blokada can't guarantee that every ad is blocked, as it depends on the lists you use.

@rpeter85 I agree that it is important to communicate this in a good manner. But I never mentioned that it should show adblocking is working.

Everything should stay as it is if it is working. But it should show something if the health check showed that blocking is not working as expected.

This way it shouldn't be misleading. Or at least not more misleading as it is now. :wink:

PS: With the latest release on F-Droid, I have the problem that suddenly sometimes everything is blocked when blokada is running. So the health check should probably also check whether blokada blocks something it shouldn't. But I guess this is more difficult because it is not easy to tell whether we are really online, right? Or blokada have to do this health check before and after setting up the VPN to see whether blokada setup broke something.

jawz101 commented 6 years ago

Alex- correct. Kinda. I mean it's related in that you see if DNS requests are being blocked.

Simply saying there could be a health check is not specific enough. If you want to have it, say, try to resolve google.com as a check to see if a hardcoded safe website resolves while a well-known ad domain does not resolve, that would be a health check you're describing I guess.

If so, I'm just saying a log file of what IP addresses a domain resolves to would tell you the same thing.

If you go to google.com and it's not resolving, you could tell if it's because the connection is down, on a host file (resolving to 0.0.0.0), or is indeed resolving to Google's correct IP address.

Same thing, just more informative.

alexanderadam commented 6 years ago

@jawz101 these are two different things though:

You have to look actively in a log and most of the non-techy users wont have any interest in that log because it is just too verbose for them. Think of the folks that just want to have their phone working, people who don't want to have a deeper technical expertise just because they want to have ads blocked. Why should they consult a log?

This feature here makes the functionality of Blokada more transparent. If there is a bug in Blokada (i.e. blocking nothing or everything) it communicates it clearly. There's no need in something verbose like a log or something you have to consult manually. This solution aims to be simpler and easier for most of the users.

PS: I would like to have a log like it is described in #178 as well but for different reasons. That's why I think it's not related to this issue here. You want to discuss the log topic? Go for it, but do it on it's issue #178. :wink:

alexanderadam commented 5 years ago

Maybe blokada should retry once to reinitialize the whole connection if step 3 wasn't successful. This might help in cases like #284, where reactivating the connection helped to fix connection issues.

alexanderadam commented 5 years ago

@rpeter85 just to be sure: which user input is needed here? I'm asking because of the tag.

peterroth commented 5 years ago

@alexanderadam tag replaced. Sorry, didn't check it for a time.