Re: [qutebrowser] Adblock not working properly with local files

2020-05-19 Thread Florian Bruhin
Hey,

On Tue, May 19, 2020 at 04:18:12PM +, Paulo Silva de Alíbano wrote:
> I've never been in a mailing list before. I apologize in advance if I make
> any more blunder.

No problem, no harm done! Wouldn't call it a blunder, just something you need
to be aware of when using mailinglists :)

> A more sensitive example is , that does not get
> blocked, although  figures in the list. Is there

I assume you mean this?
https://github.com/disconnectme/disconnect-tracking-protection/blob/05fa7f5fa78c88c74d9e62c8cabffc7b6b133cb7/entities.json#L5681

Note that's not a line saying "googleusercontent.com should be blocked", it's
just a line saying "googleusercontent.com belongs to Google", just like e.g.
google.com, youtube.com, and many other domains being listed there.

In other words, you're trying to treat something which isn't a block list like
a block list. This will probably not do what you want, unless your goal is to
block anything coming from Google, but then that will also include many
legitimate hosts and break a lot of stuff.

> Is there any way to make Qutebrowser parse the list and block a match even if
> "lower" subdomains differ?

Not at the moment - however, there's an issue about making user-supplied
blocked-hosts files accept URL patterns:
https://github.com/qutebrowser/qutebrowser/issues/4188

And there's also some work going on for a more sophisticated adblocker:
https://github.com/qutebrowser/qutebrowser/pull/5317

Both would allow you to do so, as far as I know.

Florian

-- 
m...@the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org 
   https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
 I love long mails! | https://email.is-not-s.ms/


signature.asc
Description: PGP signature


Re: [qutebrowser] Adblock not working properly with local files

2020-05-19 Thread Paulo Silva de Alíbano
Many thanks for guiding me there, Florian, I've never been in a mailing list 
before. I apologize in advance if I make any more blunder. About your reply:

Florian wrote:
>The pictures are served from www.gravatar.com, but 
>you're only blocking
>gravatar.com. Those are two different hosts.

Indeed, after prepending "www." to the address, it worked. However, I'm afraid 
that means that lists from Disconnect (to be found in 
) cannot be 
reliably used, because they usually do not include subdomains. A more sensitive 
example is , that does not get blocked, although 
 figures in the list. Is there any way to make 
Qutebrowser parse the list and block a match even if "lower" subdomains differ?




[qutebrowser] Adblock not working properly with local files

2020-05-19 Thread Paulo Silva de Alíbano
Hi, I have the following two files with domains I'd like to block. They are 
from the Disconnect open source list which Firefox uses to block trackers of 
all sorts.

$ head -n 4 /home/abc/Downloads/blockentities.txt
127.0.0.1 2leep.com
127.0.0.1 2leep.com
127.0.0.1 33across.com
127.0.0.1 tynt.com

$ head -n 4 /home/abc/Downloads/blockservices.txt
127.0.0.1 2leep.com
127.0.0.1 33across.com
127.0.0.1 365media.com
127.0.0.1 4info.com

Then I have this list in content.host_blocking.lists: 
["file:///home/abc/Downloads/blockentities.txt", 
"file:///home/abc/Downloads/blockservices.txt"]. I have also run 
:adblock-update successfully.

However, they don't quite seem to work in blocking unwanted domains. For 
example, if I go to 
stackoverflow.com/questions,
 default avatar pictures (of new users) are still loaded, even though they are 
hosted in 
https://www.gravatar.com,
 which I have blocked in both files:

$ grep gravatar /home/abc/Downloads/*
blockentities.txt:127.0.0.1 gravatar.com
blockservices.txt:127.0.0.1 gravatar.com

In Firefox, those pictures are indeed blocked and don't show up, but in 
Qutebrowser they do show up, so I conclude the ad-blocking is not working.

However, if I add "127.0.0.1 stackoverflow.com" to any of them, then, as 
expect, I cannot access Stackoverflow anymore. So there should be something 
non-obvious there...

Am I missing some important step there or should I go to Issues on the Github?

Thanks for the great browser.