Browser Hyphenation Dictionary Names the OS It Runs On

joahnn_s1 pts0 comments

Your Browser's Hyphenation Dictionary Names the OS It Runs On · scrapfly.devSkip to content← Back to all postsSummarize this article with

Add as a preferred sourceShare

A note on how these are written: the posts here are drafted with AI. That lets our engineers put research and findings out quickly and spend their effort on the technical substance instead of the prose. The mechanisms, the numbers, and the code are ours.Fingerprinting looks at canvas, fonts, WebGL. There is a text-layout signal that is just as sharp and almost never spoofed: which words the browser is willing to hyphenate.<br>CSS hyphens: auto1 breaks a long word across lines using a per-language dictionary. Put a word in a box too narrow to hold it, with word-break: normal, and it wraps only if the browser has a hyphenation dictionary for that language. Without a dictionary there is no break, and the word overflows on one line.<br>Here is the probe:<br>function hyphenates(lang, word) {<br>const el = document.createElement('div');<br>el.setAttribute('lang', lang);<br>el.style.cssText =<br>'width:6ch;font:20px serif;hyphens:auto;' +<br>'overflow-wrap:normal;word-break:normal';<br>el.textContent = word;<br>document.body.appendChild(el);<br>const wrapped = el.getBoundingClientRect().height > 30; // taller than 1 line<br>el.remove();<br>return wrapped;

Run it for Finnish and for Latin on genuine Chrome 150, three real machines:<br>ProbemacOSWindowsLinuxhyphenates('fi', 'kansainvälistyminen')truefalsefalsehyphenates('la', 'constitutionalibus')falsetruetrueGenuine macOS Chrome hyphenates Finnish and refuses Latin. Genuine Windows and Linux Chrome do the opposite. One lang attribute and one height read, and the layout has told you the operating system.<br>Two engines, two dictionaries<br>Chrome carries two hyphenators, and the platform picks one at build time.<br>macOS and iOS call CoreFoundation2. The function is CFStringGetHyphenationLocationBeforeIndex, and it reads Apple&rsquo;s compiled dictionaries at /System/Library/LinguisticData//hyphenation.dat. Windows, Linux, Android, and ChromeOS call Minikin3, the AOSP hyphenator, which reads hyph-.hyb pattern files that Chrome&rsquo;s component updater4 delivers after startup.<br>The two libraries ship two dictionary sets, and the sets do not match.<br>Apple ships hyphenation for 21 locales: ca cs da de el en(US/GB) es fi fr hr hu it nb nl pl pt ro ru sk sv uk.<br>Minikin ships 52, the AOSP set. It includes af be bg bn cy et eu ga gl hi hy ka kn la lt lv ml mr nn or pa sl sq ta te tk and more, and it does not include Catalan, Finnish, Polish, or Romanian.<br>They overlap on the common European languages and split at the edges. Finnish, Polish, Catalan, Romanian are macOS-only. Latin, Welsh, Norwegian Nynorsk, Slovenian, Basque, Estonian are Minikin-only. A probe that walks ten of these locales reads the engine, and the engine is the OS family.<br>The coverage is only half the tell. Where both engines do hyphenate the same language, they still disagree on some words. Apple&rsquo;s patterns and the AOSP TeX-derived patterns break internacionalizace at different points in Czech, Slovak, and Ukrainian. A detector that records the break positions for a fixed word, not just whether it wrapped, gets a second axis for free.<br>The bot version of this fails two ways<br>A custom Chromium build inherits the leak and usually makes it worse.<br>The first failure was documented by Joe Rutkowski (joe12387)5 in a public proof of concept, hyphenation-dictionary-poc. Most non-official builds never run the component updater, so Minikin&rsquo;s dictionary directory stays empty and hyphens: auto never fires for any language. Real Chrome on the same OS hyphenates fine, because the updater delivered the dictionaries on first run. The custom build hyphenates nothing. That single delta, wraps versus does-not-wrap on English, separates a build that shipped no dictionaries from a real browser, and a probe that iterates locales defeats any half fix.<br>Second, once you do ship the AOSP .hyb set so English works, a profile claiming macOS is now hyphenating through Minikin. It hyphenates Latin and Nynorsk, which genuine macOS never does, and it fails Finnish and Polish, which genuine macOS always does. You have traded &ldquo;hyphenates nothing&rdquo; for &ldquo;hyphenates like the wrong OS.&rdquo;<br>Closing it for macOS means reproducing CoreFoundation. That library does not exist on Linux, so there is nothing to call.<br>Apple&rsquo;s dictionary is a compiled trie<br>hyphenation.dat is a serialized CFBurstTrie6, the same container CoreFoundation uses for its tokenizers, not a list of TeX patterns. The header gives it away:<br>struct TrieHeader {<br>uint32_t signature; // 0x0ddba11<br>uint32_t rootOffset;<br>uint32_t count; // pattern count<br>uint32_t size; // == file size<br>uint32_t flags; // ReadOnly | BitmapCompression<br>uint64_t reserved[16];<br>};

The reserved[16] field is left uninitialized on disk, so it carries whatever stack bytes Apple&rsquo;s serializer had lying around, including live pointers that look like...

dictionary word hyphenation hyphenates macos chrome

Related Articles