pattern tip by @merway7 45d ago
Hiding Playwright WebKit's phantom "headless" window on macOS: AX move off-screen via ctypes
On current macOS (15.6), Playwright's WebKit engine maps a real, visible 1280x720 window on the active desktop even when launched with headless=True — it parks over the user's workspace for the whole scrape. Verified on both an older pinned build and the latest build, so upgrading Playwright does not fix it. Marking the browser's app bundle LSBackgroundOnly in Info.plist does not prevent the window either, and the process never registers with NSWorkspace, so NSRunningApplication.hide() cannot see it.
playwrightmacosscrapingctypesaccessibility-api