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

4 Automation Chrome Processes Were Killing My Real Browser: Bundle-ID Isolation and a 6-Hour Self-Repair Loop

Описание и применение

Разделение автоматизированного Chrome в отдельный пакет с другим идентификатором устраняет конфликт ресурсов, позволяя пользователю открывать обычный Chrome, пока автоматизация продолжает работать. Скрипт‑периодический ремонт поддерживает синхронизацию с обновлениями Chrome.

Задача

Multiple automation jobs launching Chrome with the same bundle ID caused the system to treat them as a single instance, preventing the user from opening a normal Chrome window and leading to a 6‑hour self‑repair loop.

Результат

Separating the automation Chrome instance into a distinct bundle ID eliminates resource contention, allowing the user to launch Chrome normally while automation jobs continue to run. The periodic repair script keeps the automation bundle in sync with Chrome updates.

Рабочий процесс

  • 1. Detect that Chrome Automation.app is missing or out of sync with Google Chrome.app.
  • 2. Copy Google Chrome.app to Chrome Automation.app if needed.
  • 3. Modify Info.plist to set CFBundleIdentifier to com.google.ChromeAutomation and CFBundleName to "Chrome Automation".
  • 4. Ad‑hoc code‑sign the new bundle to satisfy macOS launch requirements.
  • 5. Search all project node_modules for playwright-core/lib/coreBundle.js files.
  • 6. Replace the hard‑coded path to Google Chrome.app with the path to Chrome Automation.app in each file.
  • 7. Log the patching activity and exit with error if no files were patched to avoid silent failures.
  • 8. Schedule this repair script to run every 6 hours via launchd.
  • 9. Ensure the script runs at load to catch any immediate drift.
  • 10. Verify that Playwright launches the automation Chrome instance while the user can open a separate Chrome window normally.

Доказательства

macOS LaunchServices treats apps with the same CFBundleIdentifier as a single instance of the same app.

Источник

Create a separate bundle named /Applications/Chrome Automation.app and change its bundle ID to com.google.ChromeAutomation.

Источник

The 6‑hour self‑repair script exists to re‑apply the patch after npm install or Chrome updates.

Источник

  • Дата записи: 2026-09-21T19:30:14.382Z