Hi everyone,
I am monitoring font loading via the CDP, specifically the Font.fontsUpdated event.
When a page uses <link rel="preload"> to preload a font, the fontsUpdated event is not emitted consistently.
ObservationsI use DevTools Protocol Monitor to listen for Font.fontsUpdated.
Network cache is disabled, so events should be emitted on every reload.
When the font is preloaded, the fontsUpdated event is sometimes missing.
When I remove the preload link, the event is emitted on every refresh.
When I inject the CSS via a <style> tag in <head>, the event is triggered more often, but still not consistently.
Font.fontsUpdated should be emitted consistently whenever a font is loaded and used, regardless of whether it was loaded via preload or regular CSS loading.
Actual BehaviorWhen fonts are preloaded, Font.fontsUpdated is emitted inconsistently or not at all.
ReproductionMinimal repro attached below.
page.htmlThis behavior makes it difficult to reliably track font usage via CDP when preload is involved.
Thanks,
Yonatan