To debugging web page by Chrome DevTools Protocol.
yarn global add chrome-remote-debugger
# OR
npm install chrome-remote-debugger -g
crd start
The tool will start on port 9222
by default. If you want to set port, then use -p
or --port
short args:
crd start [-p, --port <port>]
The board UI start autoing at browser when you use start command.
Debugging page must import our client to your page. The client supports three import mode.
Import as ESM
or CJS
, then install package by npm:
yarn add chrome-remote-debugger-client
# OR
npm install chrome-remote-debugger-client --save
- ESM:
import CRD from 'chrome-remote-debugger-client'
- CJS
const CRD = require('chrome-remote-debugger-client')
- UMD
<script type="text/javascript" src="crd.umd.min.js"></script>
Then you can new a instance to use it:
new CRD([options]).init()
The supporting client in another warehouse is Chrome Remote Debugger Client