Nancy's Preferred Machete

    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/karma-firefox-launcher package

    2.1.2 • Public • Published


    js-standard-style npm version npm downloads semantic-release

    Build Status Dependency Status devDependency Status

    Launcher for Mozilla Firefox.


    The easiest way is to keep karma-firefox-launcher as a devDependency in your package.json.

    You can simple do it by:

    npm install karma-firefox-launcher --save-dev


    // karma.conf.js
    module.exports = function(config) {
        browsers: ['Firefox', 'FirefoxDeveloper', 'FirefoxAurora', 'FirefoxNightly'],

    You can pass list of browsers as a CLI argument too:

    karma start --browsers Firefox,Chrome

    To run Firefox in headless mode, append Headless to the version name, e.g. FirefoxHeadless, FirefoxNightlyHeadless.

    Environment variables

    You can specify the location of the Firefox executable using the following environment variables:

    • FIREFOX_BIN (for browser Firefox or FirefoxHeadless)
    • FIREFOX_DEVELOPER_BIN (for browser FirefoxDeveloper or FirefoxDeveloperHeadless)
    • FIREFOX_AURORA_BIN (for browser FirefoxAurora or FirefoxAuroraHeadless)
    • FIREFOX_NIGHTLY_BIN (for browser FirefoxNightly or FirefoxNightlyHeadless)

    Custom Firefox location

    In addition to Environment variables you can specify location of the Firefox executable in a custom launcher:

    browsers: ['Firefox68', 'Firefox78'],
    customLaunchers: {
        Firefox68: {
            base: 'Firefox',
            name: 'Firefox68',
            command: '<path to FF68>/firefox.exe'
        Firefox78: {
            base: 'Firefox',
            name: 'Firefox78',
            command: '<path to FF78>/firefox.exe'

    Custom Preferences

    To configure preferences for the Firefox instance that is loaded, you can specify a custom launcher in your Karma config with the preferences under the prefs key:

    browsers: ['FirefoxAutoAllowGUM'],
    customLaunchers: {
        FirefoxAutoAllowGUM: {
            base: 'Firefox',
            prefs: {
                'media.navigator.permission.disabled': true

    Loading Firefox Extensions

    If you have extensions that you want loaded into the browser on startup, you can specify the full path to each extension in the extensions key:

    browsers: ['FirefoxWithMyExtension'],
    customLaunchers: {
        FirefoxWithMyExtension: {
            base: 'Firefox',
            extensions: [
              path.resolve(__dirname, 'helpers/extensions/myCustomExt@suchandsuch.xpi'),
              path.resolve(__dirname, 'helpers/extensions/myOtherExt@soandso.xpi')

    Please note: the extension name must exactly match the 'id' of the extension. You can discover the 'id' of your extension by extracting the .xpi (i.e. unzip XXX.xpi) and opening the install.RDF file with a text editor, then look for the em:id tag under the Description tag. If your extension manifest looks something like this:

    <?xml version="1.0" encoding="utf-8"?>
       <RDF xmlns="" xmlns:em="">
      <Description about="urn:mozilla:install-manifest">

    Then you should name your extension myCustomExt@suchandsuch.xpi.

    For more information on Karma see the homepage.


    npm i karma-firefox-launcher

    DownloadsWeekly Downloads






    Unpacked Size

    26.7 kB

    Total Files


    Last publish


    • dignifiedquire
    • zzo
    • vojtajina
    • karmarunnerbot