Skip to content

Latest commit

 

History

History
124 lines (89 loc) · 2.71 KB

README.md

File metadata and controls

124 lines (89 loc) · 2.71 KB

airtap-system

Browser provider for locally installed browsers. List and run browsers on your machine. Supports Chrome, Chromium, Firefox, IE, Edge, Brave, Opera and Safari, on Linux, Mac & Windows, with cross-platform headless mode on Chromium, Chrome, Edge, Brave and Firefox.

npm status node Travis build status JavaScript Style Guide

Table of Contents

Click to expand

Usage

Programmatic

const System = require('airtap-system')
const system = new System()

// Get a list of desired browsers
const wanted = [{ name: 'firefox', version: 79 }]
const manifests = await system.manifests(wanted)

// Instantiate a browser
const target = { url: 'http://localhost:3000' }
const browser = system.browser(manifests[0], target)

await browser.open()

If you just want to open a single browser:

const browser = await system.open('chrome', 'https://example.com', {
  headless: false
})

Or find a single browser:

const manifest = await system.find({
  name: 'chrome',
  channel: 'canary',
  supports: { headless: true }
})

With Airtap

providers:
  - airtap-system

browsers:
  - name: firefox
    version: 79
  - name: chrome

This provider also exposes a supports property to match on:

browsers:
  - name: chrome
    supports:
      headless: true

As well as a release channel and (Windows-only) arch:

browsers:
  - name: chrome
    channel: beta
  - name: firefox
    channel: nightly
  - name: ie
    arch: i386

API

System()

Constructor. Returns an instance of browser-provider.

Browser options

  • headless (boolean, default true if supported): run in headless mode.

In Airtap these can be set like so:

browsers:
  - name: chrome
    options:
      headless: false

Install

With npm do:

npm install airtap-system

License

MIT © 2020-present Airtap contributors