🌜
🌞
karma-firefox-launcher

karma-firefox-launcher

v2.1.2

A Karma plugin. Launcher for Firefox.

npm install karma-firefox-launcher

README

karma-firefox-launcher

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

Build Status Dependency Status devDependency Status

Launcher for Mozilla Firefox.

Installation

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

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    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/[email protected]'),
          path.resolve(__dirname, 'helpers/extensions/[email protected]')
        ]
    }
}

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="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
  <Description about="urn:mozilla:install-manifest">
    <em:id>[email protected]</em:id>
    <em:version>1.0</em:version>
    <em:type>2</em:type>
    <em:bootstrap>true</em:bootstrap>
    <em:unpack>false</em:unpack>

    [...]
  </Description>
</RDF>

Then you should name your extension [email protected].


For more information on Karma see the homepage.

Release Notes

2.1.2
By Karma Bot • Published on November 2, 2021

2.1.2 (2021-11-02)

Bug Fixes

2.1.1
By Karma Bot • Published on June 2, 2021

2.1.1 (2021-06-02)

Bug Fixes

  • update name of Developer Edition on macOS (a0b5e58)
2.1.0
By Karma Bot • Published on November 3, 2020

2.1.0 (2020-11-03)

Features

  • provide a way to configure location of executable in customLauncher (fix #125) (c53efcc)
2.0.0
By Karma Bot • Published on October 20, 2020

2.0.0 (2020-10-20)

Bug Fixes

  • Bypass WSL check if Firefox is present in WSL environment (23a5d10), closes #107
  • Update is-wsl to v2.2.0 to detect docker under WSL (#116) (c585393)

Features

  • Make Node 10 minimum required version (480dafd), closes #118

BREAKING CHANGES

  • Changed minimum required version of node.js from 8 to 10.

Node 8 EOL was 2019-12-31.

General

License
MIT
Typescript Types
Tree-shakeable
No

Popularity

GitHub Stargazers
99
Community Interest
201
Number of Forks
60

Maintenance

Commits
10/219/22020
Last Commit
Open Issues
26
Closed Issues
36
Open Pull Requests
5
Closed Pull Requests
18

Versions

Versions Released
10/219/2201
Latest Version Released
Nov 2, 2021
Current Tags
latest2.1.2

Contributors

birtles
birtles
Commits: 28
vojtajina
vojtajina
Commits: 19
dignifiedquire
dignifiedquire
Commits: 11
zzo
zzo
Commits: 8
mgol
mgol
Commits: 4
semantic-release-bot
semantic-release-bot
Commits: 4
johnjbarton
johnjbarton
Commits: 2
azaslavsky
azaslavsky
Commits: 2
markchagers
markchagers
Commits: 2
appzuka
appzuka
Commits: 2
zilvinasu
zilvinasu
Commits: 2
jamestalmage
jamestalmage
Commits: 1
petejohanson
petejohanson
Commits: 1
keithamus
keithamus
Commits: 1
honzabrecka
honzabrecka
Commits: 1