🌜
🌞
karma-chrome-launcher

karma-chrome-launcher

v3.1.1

A Karma plugin. Launcher for Chrome and Chrome Canary.

npm install karma-chrome-launcher

README

karma-chrome-launcher

js-standard-style npm version npm downloads

Build Status Dependency Status devDependency Status

Launcher for Google Chrome, Google Chrome Canary and Google Chromium.

Installation

The easiest way is to keep karma-chrome-launcher as a devDependency in your package.json, by running

$ npm i -D karma-chrome-launcher

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    browsers: ['Chrome', 'Chrome_without_security'], // You may use 'ChromeCanary', 'Chromium' or any other supported browser

    // you can define custom flags
    customLaunchers: {
      Chrome_without_security: {
        base: 'Chrome',
        flags: ['--disable-web-security', '--disable-site-isolation-trials']
      }
    }
  })
}

The --user-data-dir is set to a temporary directory but can be overridden on a custom launcher as shown below. One reason to do this is to have a permanent Chrome user data directory inside the project directory to be able to install plugins there (e.g. JetBrains IDE Support plugin).

customLaunchers: {
  Chrome_with_debugging: {
    base: 'Chrome',
    chromeDataDir: path.resolve(__dirname, '.chrome')
  }
}

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

$ karma start --browsers Chrome,Chrome_without_security

Headless Chromium with Puppeteer

The Chrome DevTools team created Puppeteer - it will automatically install Chromium for all platforms and contains everything you need to run it from within your CI.

Available Browsers

Note: Headless mode requires a browser version >= 59

  • Chrome (CHROME_BIN)
  • ChromeHeadless (CHROME_BIN)
  • Chromium (CHROMIUM_BIN)
  • ChromiumHeadless (CHROMIUM_BIN)
  • ChromeCanary (CHROME_CANARY_BIN)
  • ChromeCanaryHeadless (CHROME_CANARY_BIN)
  • Dartium (DARTIUM_BIN)

Usage

$ npm i -D puppeteer karma-chrome-launcher
// karma.conf.js
process.env.CHROME_BIN = require('puppeteer').executablePath()

module.exports = function(config) {
  config.set({
    browsers: ['ChromeHeadless']
  })
}

For more information on Karma see the homepage.

Release Notes

3.1.1
By Karma Bot • Published on March 9, 2022

3.1.1 (2022-03-09)

Bug Fixes

  • artificially trigger a release (83fdc3c)
3.1.0
By johnjbarton • Published on August 13, 2019

Features

  • add --disable-dev-shm-usage flag to headless (137005d)
3.0.0
By johnjbarton • Published on July 12, 2019

Features

  • allow overriding of the default debug port (26ae9f4), closes #187
2.2.0
By Friedel Ziegelmayer • Published on June 23, 2017

Features

2.1.1
By Friedel Ziegelmayer • Published on May 5, 2017

Bug Fixes

  • add disable-renderer-backgrounding flag (6bfc170), closes #123
2.1.0
By Friedel Ziegelmayer • Published on May 2, 2017

Features

  • add support for custom user-data-dir in Chromium (579fcfc), closes #89
  • add support for headless Chrome/ChromeCanary (7446181)
2.0.0
By Friedel Ziegelmayer • Published on August 18, 2016

Features

  • Chromium support for Linux, Darwin and Windows (33e8d82)
0.2.3
By Friedel Ziegelmayer • Published on March 22, 2016

Features

  • config: Allow --user-data-dir to be set in launcher properties (2c0b7f4)
0.2.2
By Mark Trostler • Published on December 1, 2015

Bug Fixes

  • chrome will ignore command line flags it does not yet know about (426e7c3)
0.2.1
By Friedel Ziegelmayer • Published on October 7, 2015

Bug Fixes

  • ChromeCanary: on Linux (archlinux), it can be named google-chrome-unstable (28cb5b0)

General

License
MIT
Typescript Types
Tree-shakeable
No

Popularity

GitHub Stargazers
458
Community Interest
625
Number of Forks
127

Maintenance

Commits
10/219/22015
Last Commit
Mar 9, 2022
Open Issues
52
Closed Issues
104
Open Pull Requests
11
Closed Pull Requests
42

Versions

Versions Released
10/219/2201
Latest Version Released
Current Tags
latest3.1.1

Contributors

zzo
zzo
Commits: 30
vojtajina
vojtajina
Commits: 28
dignifiedquire
dignifiedquire
Commits: 24
rogeriopvl
rogeriopvl
Commits: 14
greenkeeperio-bot
greenkeeperio-bot
Commits: 5
johnjbarton
johnjbarton
Commits: 4
mgol
mgol
Commits: 4
alias-mac
alias-mac
Commits: 2
rgant
rgant
Commits: 1
Fidge123
Fidge123
Commits: 1
aymericbeaumet
aymericbeaumet
Commits: 1
nimi
nimi
Commits: 1
abbotto
abbotto
Commits: 1
gkostov
gkostov
Commits: 1
cexbrayat
cexbrayat
Commits: 1