Closed jkleint closed 7 years ago
You can uncheck no remote fonts opption and add
*$font,third-party
to My filters
Oh, tasty. Thanks!
@aggat's workaround does reduce the risk of third party tracking, but allows fonts that may still be unwanted (e.g. the "CNN" font they use for the rest of the page). I think another possible feature would be to selectively allow icon fonts based on their name / unicode range, but I am not sure how that would be implemented.
You can uncheck no remote fonts option and add
*$font,third-party
toMy filters
Use *$font,third-party,domain=~example.com|~example2.net
(two domains) to whitelist domains.
@jkleint You shouldn't have closed this issue as an option to only block third-party fonts in uBlock Origin settings (chrome://ublock0/content/dashboard.html#settings.html
) would be highly desirable.
I second that, why should I want to block self-hosted fonts? They aren't ads, in my opinion not annoying (but it's annoying when icons aren't loaded) and I don't get why this is a privacy/security issue.
Yes. There are some first party fonts that are so goddamn terrible (especially these "clear types"), the only way to remove them is block the css, but it ruins the entire page. I want to be able to block toplevel domain fonts. Even the block remote fonts in the current version I run (1.13.8) blocks first party custom fonts, causing ascii characters.
Why can't I just block certain fonts that are in the css of the domain? font-family:'Gill Sans MT','Segoe UI' is GOD AWFUL and in order to view the pages that use it, I either have to enable block remote fonts, or uncheck "allow custom fonts" in firefox's settings briefly.
*trying to avoid bloating of addons, etc.
Or, run some custom CSS, e.g. with extensions like Stylish etc.?
uBlock Origin is NOT [only] an “ad blocker”: it is a wide-spectrum blocker – which happens to be able to function as a mere “ad blocker”
I.e., we should be able to block anything we want. Some are annoyed by web fonts, others are not.
The reason for not blocking all webfonts is icon fonts conveying important information. (Whether this is good design is another question – it is the current actual state of the web.) The reason for blocking other normal text fonts is that they consume a disproportionate amount of data, often for little benefit, or even actually making the web harder to read and uglier, which of course is subjective, which is why it would be optional.
Doing this with a Stylish script would still download the fonts, but just override them afterwards. uBlock is more powerful and expressive.
First/second/third party block rules are not enough either as many sites host their own copies of third party fonts.
Agreed, but better than nothing, when dealing with real issues like legibility etc.
The other issue is that I'm perfectly aware that even if they were to make this improvement on uBO, I'd have to upadte my browser which I just don't need nor want to do. So, I just write filters out of the logger and use the chrome\userContent.css method.
eg.
m.media-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-amazonember*$font
&
@font-face { font-family: 'Segoe UI'; src: local('Arial'); }
Doing this with a Stylish script would still download the fonts, but just override them afterwards. uBlock is more powerful and expressive.
Hmm? I pretty sure you are wrong.
Open https://twitter.com/
See in console what is font edge-icons-Regular is loaded:
Download and install this font to your system (https://abs.twimg.com/a/1510347670/font/edge-icons-Regular.ttf).
Create style in Stylish/userContent.css:
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
@font-face {
font-family: "edgeicons";
src: local("edge-icons-Regular");
}
}
Reload page (with cash disabled, of course):
no network request to load font is fired.
Currently, I open the logger, find the css or font via filtering, and then add the line once I've found the font using the "static filtering" tab. Most of are from fonts.gstatic.com/s/
which can be handled with ||fonts.gstatic.com/s/*$font
or ||fonts.googleapis.com/css?family=*
And keep the ASCII chars fine, but, some fonts like comfortaa still slip through in style.css which you can easily use the inspector tool in firefox to modify, but that isn't permanent, and there isn't a way to block it in origin that I've found which doesn't get rid of the entire style.css, etc.
Is it possible to block only third-party fonts? I understand many people want to block all remote fonts for security reasons, and that option should stay; however, many websites use fonts hosted on their own domain for icons, and blocking all remote fonts makes these impossible to see (as well as not rendering text in custom fonts, of course).
For example, here is part of the navigation bar from http://www.cnn.com normally (with remote fonts enabled):
And here it is with remote fonts blocked:
The magnifying glass icon has been replaced by a box with the hex value of the Unicode character in it. You can test this by checking "Block remote fonts" under "Default Behavior" in the uBlock settings and browsing to cnn.com.
From the uBlock logs, you can see that fonts from the domain cnn.com are being blocked with the
no-remote-fonts
rule:This is with uBlock Origin v1.7.6 on Firefox 47.
It would be nice to be able to block third-party fonts to prevent third-party tracking, while still allowing first-party fonts for usability and styling.
As a workaround, you can use Fanboy's Thirdparty Fonts filter list. Lists, of course, require manual curation and have some overhead. It seems like blocking third-party fonts in uBlock would be simple, efficient (making use of information uBlock already has: "is this a font?" "is it from the same origin?"), and could pro-actively provide better tracking protection than lists.
Thanks!