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.
Click to expand
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: chromeThis provider also exposes a supports property to match on:
browsers: - name: chrome supports: headless: trueAs well as a release channel and (Windows-only) arch:
browsers: - name: chrome channel: beta - name: firefox channel: nightly - name: ie arch: i386Constructor. Returns an instance of browser-provider.
headless(boolean, default true if supported): run in headless mode.
In Airtap these can be set like so:
browsers: - name: chrome options: headless: falseWith npm do:
npm install airtap-system MIT © 2020-present Airtap contributors