headless-support
v1.0.0
Published
Returns whether a given browser supports headless mode
Downloads
288
Maintainers
Readme
headless-support
Returns whether a given browser supports headless mode.
Usage
const headless = require('headless-support')
console.log(headless('chromium', 59, 'linux')) // true
console.log(headless('edge', 59, 'win32')) // false
console.log(headless('edge', 60, 'win32')) // true
consoke.log(headless('ff', 56, 'darwin')) // true
API
headless(name[, version][, platform])
Arguments:
name
(string): browser name, loosely matched withbrowser-names
version
(number or string): browser version, either a major version number (e.g.85
) or a full version string ('85.0.564.68'
). Ifversion
is falsy then latest is assumed.platform
(string): defaults toprocess.platform
Returns a boolean that indicates support of headless mode. For Chromium-based browsers it means they accept a --headless
flag on the command line, for Firefox it means the browser accepts a -headless
flag.
Install
With npm do:
npm install headless-support
License
MIT © 2020-present Airtap contributors