Socket
Socket
Sign inDemoInstall

chrome-launcher

Package Overview
Dependencies
Maintainers
4
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


Version published
Weekly downloads
2.6M
decreased by-19.9%
Maintainers
4
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 12 Jun 2024

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