npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-chrome-debugger

v1.1.0

Published

Create a Chrome App Shortcut to Start Chrome with Remote Debugging Enabled

Downloads

143

Readme

icon

Create Chrome Debugger

This tool automates the process of creating a Chrome app shortcut, configured to launch Chrome in remote debugging mode.

Why use this tool?

While debugging JavaScript applications using editors such as VSCode, the Chrome browser must be launched with remote debugging enabled. This usually involves manually starting the browser from the command line with a specific flag (--remote-debugging-port=9222). This tool simplifies this process by creating a readily clickable Chrome Debugger app that launches Chrome with the needed command-line flag.

You can find more details about remote debugging in this post on the Chromium blog.

Demonstration

The following short video shows how to set up the Chrome Debugger and debug a React app from VSCode in no time:

https://github.com/zirkelc/chrome-debugger-node/assets/950244/0a8a4366-005b-4ea5-b4ad-2aeb4e6aec5a

Prerequisites

You must have Google Chrome installed on your machine. The tool assumes Chrome is installed at the following locations:

  • macOS: /Applications/Google Chrome
  • Linux: Support is currently unavailable. We welcome your contributions!
  • Windows: Support is currently unavailable. We welcome your contributions!

Installation

Install and run the package swiftly with npx:

npx create-chrome-debugger

Or, install it globally using npm and then execute:

npm install -g create-chrome-debugger
create-chrome-debugger

Upon successful installation, a new Chrome Debugger app shortcut will appear in your Application Library. You can relocate it as per your convenience, such as to your Dock.

How to use it?

Chrome

Click the Chrome Debugger app to launch a new Chrome instance with remote debugging enabled. Upon first launch, Chrome might prompt to set it as the default browser - this step can be disregarded.

To confirm that remote debugging is enabled, navigate to chrome://version in Chrome. It should display like this:

image

The Chrome instance launched by Chrome Debugger functions in its own user data directory, ensuring isolated history, bookmarks, cookies, etc. It will not interfere with your regular Chrome instance. The user data directory is found at /Users/<username>/Library/Application Support/Google/Chrome Debugger.

# print the location of the user data directory
echo "$HOME/Library/Application Support/Google/Chrome Debugger"

VSCode

For debugging JavaScript apps from VSCode, a debug configuration launch.json must be created inside the .vscode folder:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Attach to Chrome",
      "port": 9222,
      "request": "attach",
      "type": "chrome",
      "urlFilter": "http://localhost:3000/*",
      "webRoot": "${workspaceFolder}"
    }
  ]
}

For more insights, refer to this guide or the official VSCode documentation.

Release Notes

  • v1.1.x
    • Modified VSCode debug configuration "type": "pwa-chrome" to "type": "chrome"
    • Added --user-data-dir command line flag as recommended by Chromium
  • v1.0.x - Initial release

Acknowledgments

Credit for the initial implementation and the Chrome Debugger icon goes to David Mann's StackOverflow post.