Returns whether a given browser supports headless mode.
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
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.
With npm do:
npm install headless-support
MIT © 2020-present Airtap contributors