Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

fix-chrome-lock

Fix "Google Chrome opens but my profiles are gone" on macOS — in one command. A headless Google Chrome.app process (from Playwright, Puppeteer, Selenium, agent-browser, or an AI agent's browser tool) can shadow your real Chrome so its window and profile picker never appear. fix-chrome-lock clears it instantly.

platform: macOS shell: POSIX sh dependencies: none license: MIT

Symptoms this fixes

  • Chrome opens but all your profiles are missing / the profile picker is empty.
  • Clicking Chrome does nothing, or only re-focuses an existing (invisible) instance.
  • Chrome opens a blank/fresh window with none of your logins after running browser automation.
  • Happens after a Playwright / Puppeteer / Selenium / agent-browser run, or an AI coding agent that drives Chrome headlessly.
  • You checked and it is not a corrupt profile — the data is all still there.

The problem

On macOS, only one instance of an application bundle activates at a time. When a headless process started from /Applications/Google Chrome.app is running — typically from automation tooling that points at the primary Chrome install instead of Chrome for Testing — macOS considers Chrome "already running." Clicking Chrome then just re-activates the invisible headless process, so your window and profile picker never appear.

It is not a corrupt profile and usually not even a stale lock file — it's a live headless process shadowing your real Chrome.

Install

The script is pure POSIX sh with a #!/bin/sh shebang, so it runs the same whether your login shell is zsh, bash, dash, or fish — nothing to configure.

One-liner (curl):

curl -fsSL https://raw.githubusercontent.com/kylebrodeur/fix-chrome-lock/main/bin/fix-chrome-lock \
  -o ~/.local/bin/fix-chrome-lock && chmod +x ~/.local/bin/fix-chrome-lock

Or clone the repo:

git clone https://github.com/kylebrodeur/fix-chrome-lock.git
ln -sf "$PWD/fix-chrome-lock/bin/fix-chrome-lock" ~/.local/bin/fix-chrome-lock

Make sure ~/.local/bin is on your PATH. For zsh:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc

Prefer a single-file gist? Mirror: https://gist.github.com/kylebrodeur/b0e6e34924434cc9d47c269ff3938175

Usage

fix-chrome-lock          # kill headless shadow instances + clear stale locks
fix-chrome-lock -o       # ...and relaunch Chrome afterward
fix-chrome-lock -n       # dry run — show what it would do, change nothing
fix-chrome-lock -h       # help

What it does

  1. Finds every Google Chrome.app process running with --headless and terminates it (SIGTERM, then SIGKILL for stragglers).
  2. If no GUI Chrome is running, removes stale SingletonLock / SingletonCookie / SingletonSocket files from your profile directory.
  3. Optionally relaunches Chrome (-o).

Safe by design

  • Only kills Chrome processes that carry --headless.
  • Never touches your normal (GUI) Chrome or a separate Chrome for Testing install.
  • Only removes Singleton* locks when no GUI Chrome is running (a live Chrome legitimately holds them).
  • The process match targets the bundle's /Contents/ executable path, so the scan can never match its own awk command line.

Preventing recurrence

Point your automation at Chrome for Testing (a distinct app bundle) instead of the primary /Applications/Google Chrome.app, so headless runs can never shadow your daily browser. fix-chrome-lock is for the times you forget — or when a tool you don't control makes that choice for you.

Requirements

macOS. No bash required — pure POSIX sh (uses only ps, awk, kill, open).

License

MIT — see LICENSE.


Keywords: macOS Chrome profiles missing, Chrome won't open, Chrome already running, headless Chrome shadow, Playwright Chrome profile, Puppeteer, Selenium, agent-browser, SingletonLock, Chrome for Testing, kill headless Chrome.

About

Fix "Google Chrome opens but my profiles are gone" on macOS. Kills headless Google Chrome.app instances (Playwright/Puppeteer/Selenium/agent-browser) that shadow your real Chrome. Pure POSIX sh, no deps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages