Every name you put in the browsers array resolves to a launcher — a plugin responsible for actually starting, monitoring, and killing a browser process. This lesson explains what launchers are before diving into specific browsers.
What a Launcher Plugin Does
A launcher plugin implements the mechanics of starting one specific kind of browser process: locating its binary, building the correct command-line flags, pointing it at the Karma server's URL, and tearing it down cleanly when the run finishes. karma-chrome-launcher handles this for every Chrome-family browser (Chrome, ChromeHeadless, ChromeCanary, Edge); karma-firefox-launcher handles it for Firefox.
Karma ships no launchers built in — every single browser, including the very common ChromeHeadless, requires installing its launcher package explicitly.
A launcher plugin's responsibilities extend beyond just starting a process. It also monitors the browser's connection state, handles crashes and unexpected disconnects, and ensures the browser process is fully killed when a run ends — important for avoiding orphaned browser processes on CI machines.
Start: locate the binary and launch it with the right flags, pointed at the Karma server URL.
Monitor: track connection state and respond to unexpected disconnects.
Retry/report: surface capture failures clearly instead of hanging silently.
Kill: terminate the browser process cleanly at the end of the run or on Ctrl+C.
Environment Variable Overrides
Most launcher packages respect an environment variable pointing at a non-standard binary location, which is the standard fix when a CI image's browser lives somewhere the launcher doesn't automatically check.
Check the specific launcher package's README for its exact expected variable name — most Chrome-family launchers use CHROME_BIN.
Common Mistakes
Assuming any browser name is 'built into' Karma itself rather than provided by an installed launcher package.
Writing a fully custom launcher plugin when customLaunchers with a base and extra flags would be enough.
Not cleaning up orphaned browser processes after abnormal Karma exits (e.g. Ctrl+C during a hung run).
Forgetting that customLaunchers entries need a real base launcher to extend — they can't exist standalone.
Key Takeaways
Launcher plugins handle starting, monitoring, and killing specific browser processes.
No browser (including ChromeHeadless) is built into Karma — every one requires an installed launcher package.
customLaunchers extends a base launcher configuration with extra flags without writing a full plugin.
Environment variables like CHROME_BIN are the standard way to point launchers at non-standard binary locations.
Pro Tip
Before writing a custom launcher plugin from scratch, check whether customLaunchers with a base and a few extra flags solves your actual problem. The overwhelming majority of 'custom launcher' needs (like --no-sandbox in CI) don't require writing any plugin code at all.
You now understand launchers conceptually. Next, look specifically at the Chrome launcher, the most widely used option.