karma-firefox-launcher
    Overview
    Documentation
    Tutorials
    Chat
    Insights
    Code
    Dependencies
    Contributors
    Jobs

karma-firefox-launcher

A Karma plugin. Launcher for Firefox.

1.2.0  •  Updated 10 months ago  •  by karma-runner  •  MIT License

js-standard-style npm version npm downloads

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

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="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>myCustomExt@suchandsuch</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 myCustomExt@suchandsuch.xpi.


For more information on Karma see the homepage.

Popularity

Maintenance

Development

Last ver 10 months ago
Created 7 years ago
Last commit 1 month ago
24 days between commits

Technology

Node version: 10.8.0
152.1K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

34 contributors
Brian Birtles
Maintainer, 18 commits, 15 merges, 8 PRs
Works at birchill
Vojta Jina
25 commits, 6 merges
Friedel Ziegelmayer
Maintainer, 18 commits, 12 merges, 1 PRs
Mark Trostler
13 commits, 5 merges
Works at ZZO Associates
dependabot[bot]
6 commits
Michał Gołębiowski
4 commits, 4 PRs
Works at Sumo Logic, jQuery, AngularJS

Tags

karma
testing
karma-plugin
karma-launcher
firefox
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.