/** * Widevine CDM hint-file seeding for persistent contexts. * Mirrors Python cloakbrowser/widevine.py. * * CloakBrowser's binary supports Widevine but ships no CDM (proprietary, can't * redistribute). Users sideload it by copying a `WidevineCdm/` directory from a * real Chrome install next to the binary (see issue #96). Chromium reads a * "hint file" from the user-data-dir at early startup to register the CDM, but * on a fresh profile it doesn't exist yet, and Playwright disables the component * updater that would write it. This seeds the hint file before launch so a * sideloaded CDM works on the first run. It never bundles, downloads, or copies * the CDM — only writes the hint when a user-provided CDM is already present. * * Linux only: Chromium's hint-file mechanism is Linux/ChromeOS-specific. */ /** * Locate a sideloaded Widevine CDM directory, or null if absent. * * Resolution order: * 1. If CLOAKBROWSER_WIDEVINE_CDM is set, it is used exclusively (overrides * auto-detection). An invalid value (no `manifest.json`) skips seeding. * 2. `