uBlock icon indicating copy to clipboard operation
uBlock copied to clipboard

Unable to Override "No Remote Fonts" with Dynamic URL filtering.

Open ghost opened this issue 10 years ago • 11 comments

I intended to use this feature to block most if not all webfonts by default, and of course, I can re-enable the whole site.

However, some sites might want to load various fonts, whereas I might only want them to load an "icon font" and let the text fall back to whatever my browser has.

The Dynamic URL filtering will allow finding the blocked font, going through the steps, but the no remote fonts will trump it.

Steps to Reproduce:

  1. Visit and site that loads fonts, block it from loading remote fonts.
  2. Open Logger, create unblock (neither noop nor allow work in the end) rule, either for the file or path.
  3. Refresh and see that the fonts will still be blocked.

ghost avatar Jun 16 '15 16:06 ghost

What about:

no-remote-fonts: * true
...
no-remote-fonts: example.com false
example.com https://fonts-whatever-cdn.com font block
example.com https://fonts-whatever-cdn.com/icons.ttf font allow

?

gorhill avatar Jun 16 '15 17:06 gorhill

That sounds viable, though it requires extra rules to accomplish.

On Tue, Jun 16, 2015 at 1:05 PM, Raymond Hill [email protected] wrote:

What about:

no-remote-fonts: * true ... no-remote-fonts: example.com falseexample.com https://fonts-whatever-cdn.com font blockexample.com https://fonts-whatever-cdn.com/icons.ttf font allow

?

— Reply to this email directly or view it on GitHub https://github.com/gorhill/uBlock/issues/363#issuecomment-112498547.

ghost avatar Jun 16 '15 18:06 ghost

Hm, still requires me to completely enable fonts, and end up in allow by default mode.

As in if a site uses font CDNs, I'd have to explicitly block those, block the 1st party fonts, then allow the specific 1st party font. All while if they change CDNs, those fonts would load.

This ties in with #320 to where if I could specify a rule such as test.com * font block would allow the block by default behavior to function. As of now, such a rule is silently trashed as invalid.

ghost avatar Jun 17 '15 16:06 ghost

You could use static filtering : *$font to block fonts everywhere and then @@||fonts.com$third-party for font CDN and/or @@||website.com/fonts/*$first-party for 1st party fonts. Or you can use Fanboy Anti Fonts filter list.

Snapy avatar Nov 01 '15 17:11 Snapy

Is there a reason not to use *$font as the default font blocking method? It has the desirable property of allowing easy exceptions.

yurikhan avatar Dec 31 '15 13:12 yurikhan

Is there a way to block all 3rd-party fonts? If I am already trusting a 1st party domain by loading their site's html, I trust them enough to load a font directly from them. I know that Fanboy Anti Fonts essentially covers this, but is there a rule that would be essentially no-remote-fonts: 3rd-party true (that rule does nothing, currently, that I can see) so I can ensure that all 3rd party fonts are blocked while still allowing all 1st party fonts (and not needing to create a new rule to allow 1st-party fonts for every individual site)? I've been searching for a solution for awhile for this, and haven't found anything. Thanks.

collinbarrett avatar Mar 03 '16 14:03 collinbarrett

*$font,third-party?

gorhill avatar Mar 03 '16 14:03 gorhill

@gorhill perfect, thanks.

collinbarrett avatar Mar 03 '16 14:03 collinbarrett

@gorhill , if I use *$font,third-party as a global rule, is there a way I can override it to allow third-party fonts when viewing a specific site? thanks.

collinbarrett avatar Mar 22 '16 15:03 collinbarrett

*$font,third-party,domain=~example.com|~example2.net?

ghost avatar Mar 22 '16 15:03 ghost

@IDKwhattoputhere , perfect! thanks.

collinbarrett avatar Mar 22 '16 15:03 collinbarrett