Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chrome-launcher

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-launcher

Launch latest Chrome with the Devtools Protocol port open

  • 0.15.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6M
decreased by-53.87%
Maintainers
5
Weekly downloads
 
Created

What is chrome-launcher?

The chrome-launcher npm package is a tool that allows developers to automate the launching of Google Chrome with specific configurations. It is often used for running automated tests, scraping websites, and automating interactions with web pages.

What are chrome-launcher's main functionalities?

Launching Chrome

This feature allows you to launch a new instance of Chrome. The code sample demonstrates how to launch Chrome with a starting URL.

const chromeLauncher = require('chrome-launcher');

async function launchChrome() {
  const chrome = await chromeLauncher.launch({startingUrl: 'https://example.com'});
  console.log(`Chrome debugging port running on ${chrome.port}`);
}

launchChrome();

Custom Chrome Flags

This feature enables the use of custom flags when launching Chrome. The code sample shows how to launch Chrome in headless mode with GPU disabled.

const chromeLauncher = require('chrome-launcher');

async function launchChromeWithFlags() {
  const chrome = await chromeLauncher.launch({
    chromeFlags: ['--headless', '--disable-gpu']
  });
  console.log(`Chrome debugging port running on ${chrome.port}`);
}

launchChromeWithFlags();

Killing Chrome Instances

This feature allows you to programmatically kill the launched Chrome instance. The code sample illustrates launching Chrome and then killing it after some operations.

const chromeLauncher = require('chrome-launcher');

async function launchAndKillChrome() {
  const chrome = await chromeLauncher.launch({startingUrl: 'https://example.com'});
  console.log(`Chrome debugging port running on ${chrome.port}`);

  // Some time later...
  await chrome.kill();
}

launchAndKillChrome();

Other packages similar to chrome-launcher

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc