Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
chromium-edge-launcher
Advanced tools
Launch Microsoft Edge with ease from Node.js.
remote-debugging-port
on an available port.kill()
.Ctrl-C
(by default) to terminate the Edge process.yarn add chromium-edge-launcher
# or with npm:
npm install chromium-edge-launcher
.launch([opts])
{
// (optional) remote debugging port number to use.
// If provided port is already busy, launch() will reject.
// Default: an available port is autoselected
port: number;
// (optional) Additional flags to pass to Edge,
// for example: ['--headless', '--disable-gpu'].
// See: https://github.com/cezaraugusto/chromium-edge-launcher/blob/main/docs/edge-flags-for-tools.md
// Do note, many flags are set by default.
// See https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/src/flags.ts
edgeFlags: Array<string>;
// (optional) Close the Edge process on `Ctrl-C`.
// Default: true
handleSIGINT: boolean;
// (optional) Explicit path of intended Edge binary.
// * If this `edgePath` option is defined, it will be used.
// * Otherwise, the `EDGE_PATH` env variable will be used if set.
// (`LIGHTHOUSE_CHROMIUM_PATH` is deprecated)
// * Otherwise, a detected Edge Canary will be used if found.
// * Otherwise, a detected Edge (stable) will be used.
edgePath: string;
// (optional) Edge profile path to use, if set to `false` then
// the default profile will be used.
// Default: a fresh Edge profile.
userDataDir: string | boolean;
// (optional) Starting URL to open the browser with
// Default: `about:blank`
startingUrl: string;
// (optional) Logging level
// Default: 'silent'
logLevel: 'verbose'|'info'|'error'|'silent';
// (optional) Flags specific in [flags.ts](src/flags.ts) will
// not be included. Typically used with the defaultFlags() method
// and edgeFlags option.
// Default: false
ignoreDefaultFlags: boolean;
// (optional) Interval in ms, which defines how often launcher checks
// browser port to be ready.
// Default: 500
connectionPollInterval: number;
// (optional) A number of retries, before browser launch
// considered unsuccessful.
// Default: 50
maxConnectionRetries: number;
// (optional) A dict of environmental key value pairs to pass to
// the spawned edge process.
envVars: {[key: string]: string};
};
.launch().then(edge => ...
// The remote debugging port exposed by the launched edge
edge.port: number;
// Method to kill Edge (and cleanup the profile folder)
edge.kill: () => Promise<void>;
// The process id
edge.pid: number;
// The childProcess object for the launched Edge
edge.process: childProcess
EdgeLauncher.Launcher.defaultFlags()
Returns an Array<string>
of the default flags Edge is launched with. Typically used along with the ignoreDefaultFlags
and edgeFlags
options.
Note: This array will exclude the following flags: --remote-debugging-port
--disable-setuid-sandbox
--user-data-dir
.
EdgeLauncher.Launcher.getInstallations()
Returns an Array<string>
of paths to available Edge installations. When edgePath
is not provided to .launch()
, the first installation returned from this method is used instead.
Note: This method performs synchronous I/O operations.
.killAll()
Attempts to kill all Edge instances created with .launch([opts])
. Returns a Promise that resolves to an array of errors that occurred while killing instances. If all instances were killed successfully, the array will be empty.
const EdgeLauncher = require('chromium-edge-launcher');
async function cleanup() {
await EdgeLauncher.killAll();
}
const EdgeLauncher = require('chromium-edge-launcher');
EdgeLauncher.launch({
startingUrl: 'https://google.com'
}).then(edge => {
console.log(`Edge debugging port running on ${edge.port}`);
});
const EdgeLauncher = require('chromium-edge-launcher');
EdgeLauncher.launch({
startingUrl: 'https://google.com',
edgeFlags: ['--headless', '--disable-gpu']
}).then(edge => {
console.log(`Edge debugging port running on ${edge.port}`);
});
const EdgeLauncher = require('chromium-edge-launcher');
const newFlags = EdgeLauncher.Launcher.defaultFlags().filter(flag => flag !== '--disable-extensions' && flag !== '--mute-audio');
EdgeLauncher.launch({
ignoreDefaultFlags: true,
edgeFlags: newFlags,
}).then(edge => { ... });
In a CI environment like Travis, Edge may not be installed. If you want to use chromium-edge-launcher
, Travis can install Edge at run time with an addon. Alternatively, you can also install Edge using the download-edge.sh
script.
Then in .travis.yml
, use it like so:
language: node_js
install:
- yarn install
before_script:
- export DISPLAY=:99.0
- export CHROME_PATH="$(pwd)/edge-linux/edge"
- sh -e /etc/init.d/xvfb start
- sleep 3 # wait for xvfb to boot
addons:
edge: stable
This project started as a fork of Chrome Launcher, which is released under the Apache-2.0 License, and is copyright of Google Inc. Original contributors and git commit history kept intact for proper attribution.
FAQs
Launch latest Edge with the Devtools Protocol port open
The npm package chromium-edge-launcher receives a total of 669,709 weekly downloads. As such, chromium-edge-launcher popularity was classified as popular.
We found that chromium-edge-launcher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.