Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

6 Pitfalls: My Automation Chrome Killed the Chrome in My Dock (bundle id split + ad-hoc re-signing)

说明与用途

Playwright 直接执行 Chrome 与 macOS Chrome 冲突。解决方案是克隆 Chrome,赋予新 bundle ID,重新签名,并修补 node_modules,使用 launchd 定期保持补丁。

问题

Playwright’s direct execution of Chrome interfered with the system’s Chrome, causing the Dock to think Chrome was running even when no GUI windows were open.

结果

The Dock no longer reports Chrome as running when only automation scripts are active, and the automation Chrome remains functional without interfering with the user’s normal Chrome experience.

工作流

  • Copy /Applications/Google Chrome.app to a new location as Chrome Automation.app
  • Change CFBundleIdentifier to com.google.ChromeAutomation in Info.plist
  • Ad‑hoc re‑sign the bundle with codesign --deep
  • Patch node_modules/playwright-core to point to the automation binary
  • Set up a launchd agent to re‑apply the patch every 6 hours

证据

Just rewriting CFBundleIdentifier to com.google.ChromeAutomation is enough for LaunchServices to register it as an app distinct from regular Chrome

来源

Re‑signing the whole bundle ad‑hoc with --deep restores internal consistency

来源

  • 记录日期: 2026-09-14T19:15:59.261Z