Firefox still loads some fonts when downloadable fonts disabled
Categories
(Core :: Networking, defect, P2)
Tracking
()
People
(Reporter: seth, Assigned: jfkthame)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(2 files)
190.74 KB,
image/png
|
Details | |
Bug 1852587 - Disable font preloads if the downloadable_fonts pref is turned off. r=#necko-reviewers
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
Steps to reproduce:
- Navigate to about:config
- Set gfx.downloadable_fonts.enabled to false
- Open the network tab and filter by Font requests
- Visit a website like flathub.org or freecodecamp.org
Actual results:
Fonts are being downloaded, visible from the network tab.
On most sites they are ignored correctly, it's unclear to me why it's behaving differently on some.
Expected results:
When gfx.downloadable_fonts.enabled is set to false, font declarations in the HTML or via @font-face are meant to be ignored afaik.
Comment 1•1 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Netmonitor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 years ago
•
|
||
Thanks for reporting i tested on freecodecamp.org. I can confirm that certain fonts get ignored and not others. One obvious difference is initiators. I'll investigate this a little bit more.
Comment 3•1 years ago
•
|
||
Thanks for reporting i tested on freecodecamp.org. I can confirm that certain fonts get ignored and not others. One obvious difference is initiators
Updated•1 years ago
|
Updated•1 years ago
|
Some more context that may be valuable. On Firefox 117, it loads the font but doesn't actually use it.
On Firefox ESR 115 it actually uses the fonts too, despite downloadable fonts being disabled.
Oh actually, upon double-checking this, that is not the case.
I'm unable to remove/delete comments, but please ignore what I previously reported with Firefox ESR using the font.
It appears in Firefox ESR it does not use the font, I probably just messed up while testing.
Comment 6•1 years ago
|
||
In general, updating preferences in about:config is not recommended for end-users, unless this is exposed by some UI or recommended in one of our documentations.
Brad: do you or someone else in the Graphics team know what is the expected behavior when gfx.downloadable_fonts.enabled
is set to false? Should it prevent from downloading the fonts, or only prevent using it.
Also the preference is quite old, and has defaulted to true for a while. Do we still want to expose it?
Updated•1 years ago
|
There is a different setting in the UI in about:preferences
→ Allow pages to choose their own fonts, instead of your selections above.
I did not use that one as the font files are still downloaded, so a blocking request which only serves to block rendering of the page. I assume there are some differences relative to gfx.downloadable_fonts.enabled
, for example, icon fonts actually work the setting exposed in about:preferences
.
If about:config
→ gfx.downloadable_fonts.enabled
is deprecated or will be removed, then I can use the one exposed in about:preferences
paired with a uBlock Origin filter to block fonts from third-party servers like Google Fonts instead, perhaps.
Just wanted to share why I'm using it, but I won't fuss if it's removed.
Comment 8•1 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #6)
Brad: do you or someone else in the Graphics team know what is the expected behavior when
gfx.downloadable_fonts.enabled
is set to false? Should it prevent from downloading the fonts, or only prevent using it.Also the preference is quite old, and has defaulted to true for a while. Do we still want to expose it?
Jonathan, can you give guidance on how we use this pref?
Assignee | ||
Comment 9•1 years ago
|
||
This pref was originally designed, I think, to effectively block @font-face rules from being used. If it's disabled, this code block will not execute, and any @font-face rules present in the document (stylesheet) won't actually contribute to the "user font set" that layout uses, and that in turn triggers loading of the actual resources.
What I suspect is happening here, though, is that the fonts are being inserted into the font set via the CSS Font Loading API, rather than from @font-face rules, and we don't check this pref in that case. (Note that I haven't confirmed this directly, as the freecodecamp.org site looks like a huge and complex mass of stuff.... so for now it's just a theory.)
Probably it'd make sense to also block the Font Loading API if this pref is disabled. (Not to throw an error or anything, most likely, as that'd break sites; just make it a no-op.)
Assignee | ||
Comment 10•1 years ago
|
||
Hmm, another possibility -- and I think this might be what's happening in the freecodecamp case -- is that these downloads are being triggered by a <link rel=preload ....> that the site uses to try and optimize rendering. AFAICS they're not actually being used on the page when the pref is disabled, but if there are preload links, that still causes the resources to get downloaded.
Assignee | ||
Updated•1 years ago
|
Assignee | ||
Comment 11•1 years ago
|
||
Updated•1 years ago
|
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
bugherder |
Updated•1 year ago
|
Reproducible on a 2023-09-11 Nightly build on Ubuntu 22.
Verified as fixed on Nightly 120.0a1(20231018094117) and Firefox 119.0(build ID: 20231019122658) on Ubuntu 22, macOS 12, Windows 10.
Description
•