services/messenger-web-dom.md
Facebook Messenger (messenger.com) via browser automation
No usable API for a personal account, so the messenger skill (~/.agents/skills/messenger) drives messenger.com in the headed personal Playwright window (CDP 9222, already signed in). Scripts: threads.mjs, read-thread.mjs, send.mjs (dry run unless --yes). Selector map and gotchas live in the skill's references/dom.md; the highlights:
- Sidebar rows are
a[href]of the form/t/<id>/or/e2ee/t/<id>/. The left rail (Chats, Marketplace, Requests, Archive) also has anchors whose hrefs embed the open thread id, so the first anchor for an id can be the wrong one (this bit the first parser: Mรก's row came back named "Chats ยท 1 unread"). Filter by href prefix. - Messages are
div[role=article]with aria-labelsAt <date>, <You|Name>: <text>. Media and calls have no text in the label. - The message list is virtualized (10 to 25 rows in the DOM). Older history loads only on real mouse-wheel events over the log (
page.mouse.wheel); settingscrollTopdoes nothing. - E2EE threads (Mรก, Sarah) decrypt in the browser with no PIN prompt on this profile.
- Opening a thread sends a read receipt. Composer is
getByRole("textbox", {name: /^Write to/}), send is Enter. - Tested only on reads of Mรก's thread and the composer on the Meta AI thread. The real send path is unverified.
- Mรก = "Theresa Pham", thread
7226659630784250.