uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
944 stars 80 forks source link

Static filters don't seem to block remote fonts from 3rd party #323

Closed antistress closed 5 years ago

antistress commented 5 years ago

Prerequisites

Description

remotes fonts from 3rd party are not blocked despite dedicated filter (as suggested at https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-remote-fonts).

Here are some of my filters : @@||ajax.googleapis.com^ ||googleapis.com^ *$font,third-party

Note that, if I am not mistaken :

Also :

However both Lightbeam & uBlockOrigin add-ons show that connections are made to fonts.googleapis.com

capture1

capture2

A specific URL where the issue occurs

https://ledenicheur.fr/product.php?p=2798699

Steps to Reproduce

  1. uBlockOrigin advanced user features is not activated
  2. add theses filters within uBlockOrigin My Filters pane : @@||ajax.googleapis.com^ ||googleapis.com^ *$font,third-party
  3. Go to https://ledenicheur.fr/product.php?p=2798699 and see that connection is made to fonts.googleapis.com

Expected behavior:

No connection should be made to fonts.googleapis.com

Actual behavior:

Connections are made to fonts.googleapis.com despite dedicated settings

Your environment

antistress commented 5 years ago

mes-filtres-statiques-ublock_2018-12-02_14.03.49.txt

I've attached all my filters

Thanks

uBlock-user commented 5 years ago

uBlock-user commented 5 years ago

Check the logger for any filters which are overiding the blocking filters for fonts.

gwarser commented 5 years ago

Dynamic URL filtering rule? Like this one:

ledenicheur.fr https://fonts.googleapis.com stylesheet allow

No need for advanced user mode. Check logger


Fonts are loaded from other domain.

image

gorhill commented 5 years ago

Unable to reproduce, using default settings and lists + OP's filters.

@antistress you need to look at all your other settings and as always, use the logger to diagnose such issues.

uBlock-user commented 5 years ago

Dynamic URL filtering rule?

He hasn't activated dynamic filtering from the picture he posted.

gorhill commented 5 years ago

Also, @antistress, your filters are not very efficient, there is no need to prepend an asterisk to most of them, this prevents uBO from efficiently storing these filters.

gorhill commented 5 years ago

He hasn't activated dynamic filtering from the picture he posted.

No need for advanced user mode.

antistress commented 5 years ago

Hi,

Thank you uBlock-user for your tip about the logger, it allowed me further debugging. Very powerfull tool to investigate filters actions. Using the logger, I've discovered that Adguard Base Filters was the one that allowed fonts.googleapis.com domain (this Adguard issue confirms that point : https://github.com/AdguardTeam/AdguardFilters/issues/19281#issuecomment-402880006). Then I used the 4th cell logger (Static network filters) to create a dedicated filter that change that : ||fonts.googleapis.com^$important This rule has been added to former ones I used and it seems to work now :)

I suppose I could get the same result by turning $font,third-party into $font,third-party,important ?

Thanks you also gorhill for your syntax advice and for that great add-on :) NB : you wrote "need to prepend an asterisk to MOST of them" did you mean that it is still needed for SOME of them ?

uBlock-user commented 5 years ago

I suppose I could get the same result by turning $font,third-party into $font,third-party,important ?

Yes.

gorhill commented 5 years ago

did you mean that it is still needed for SOME of them ?

I said "most" because I quickly visually scanned. Looking at it again, you can remove all prepended asterisks, except for *$font,third-party. Any filter of the form:

example.com

Will be interpreted as a hostname, and as a result all subdomains will also be blocked.

antistress commented 5 years ago

Thank you !

antistress commented 5 years ago

Hi again,

To complete the discussion on this report, please note that *$font,third-party,important is not sufficient to block fonts.googleapis.com that Adguard Base Filters allows.

Only ||fonts.googleapis.com^$important succeed in blocking fonts.googleapis.com despite Adguard Base Filters

gorhill commented 5 years ago

Yes, because fonts.googleapis.com is also used to serve CSS, which won't be blocked by *$font,third-party,important.

antistress commented 5 years ago

I got it, thanks :)

uBlock-user commented 5 years ago

$font only covers font type requests, fonts are also loaded over by $stylesheets, so it's better you block the entire domain.