CanvasBlocker
                                
                                 CanvasBlocker copied to clipboard
                                
                                    CanvasBlocker copied to clipboard
                            
                            
                            
                        textMetrics + FF86+
In FF86+
- 1676966
- pref: gfx.font_rendering.fallback.async(default true)
when characters that trigger the global fallback search (iterating over all available fonts to try and render the char) FF starts loading the character map data required to support this, but no longer allows this to block layout & rendering; instead, FF continues to render (perhaps rendering tofu) while the loading happens in the background, and then re-layout/renders the document once loading is complete
The way I found to code around it was to set (an offscreen) div to hold the character string very early in the process, and by the time the textmetrics font test fired off, they were properly rendered so I got a consistent fingerprint - not sure if this will always be sufficient: see 1687622 where on MacOS the bug reporter was talking about 2 secs (unscientific)
For the CB test, perhaps do the same and put the test behind a run button?
STR (if you have a font fallback search being triggered)
- do not enable textMetric spoofing
- new Firefox session
- TestA: load https://canvasblocker.kkapsner.de/test/textMetricsTest.html
- open a new tab
- TestB: load https://canvasblocker.kkapsner.de/test/textMetricsTest.html
- compare
- subsequent tests will be consistent with TestB results
Note that once the font has been rendered from font fallback, then the Firefox session will remember it, so it will only happen on first visits per session with CB textMetrics off : where the data could be incorrect, and a refresh could change values: possible confusion
note: this could also produce a false positive result for CB's textMetric spoofing if the spoof failed