Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
browser-launcher
Advanced tools
Detect the browser versions available on your system and launch them in an isolated profile for automated testing purposes.
You can launch browsers headlessly (if you have Xvfb) and set the proxy configuration on the fly.
var launcher = require('browser-launcher');
launcher(function (err, launch) {
if (err) return console.error(err);
console.log('# available browsers:');
console.dir(launch.browsers);
var opts = {
headless : true,
browser : 'chrome',
proxy : 'localhost:7077',
};
launch('http://substack.net', opts, function (err, ps) {
if (err) return console.error(err);
});
});
$ node example/launch.js
# available browsers:
{ local:
[ { name: 'chrome',
re: {},
type: 'chrome',
profile: '/home/substack/.config/browser-launcher/chrome-17.0.963.12_9c0bdd8d',
command: 'google-chrome',
version: '17.0.963.12' },
{ name: 'chromium',
re: {},
type: 'chrome',
profile: '/home/substack/.config/browser-launcher/chromium-18.0.1025.168_e025d855',
command: 'chromium-browser',
version: '18.0.1025.168' },
{ name: 'firefox',
re: {},
type: 'firefox',
profile: [Object],
command: 'firefox',
version: '12.0' } ] }
var launcher = require('browser-launcher')
Create a new launcher function in cb(err, launch)
, scanning for system
browsers if no ~/.config/browser-launcher/config.json
is present and reading
from that file otherwise.
Launch a new instance of opts.browser
with the optional version constraint
opts.version
. Without an opts.version
, the highest version of opts.browser
is used.
To launch the browser headlessly (if it isn't already headless),
set opts.headless
. This launches the browser with
node-headless
which uses the Xvfb
command to create a fake X server.
To use the browser with a proxy, set opts.proxy
as a colon-separated
'host:port'
string.
Set proxy routes to skip over with opts.noProxy
.
You can pass additional options directly through to the browser commands with
opts.options
.
cb
fires with cb(err, ps)
where ps
is the process object created with
spawn()
.
This property shows what browsers are configured to be launchable, divided into
groups. The default group is 'local'
.
npm install browser-launcher
MIT
FAQs
detect and launch browser versions, headlessly or otherwise
The npm package browser-launcher receives a total of 1,942 weekly downloads. As such, browser-launcher popularity was classified as popular.
We found that browser-launcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.