Home

Awesome

Devtools Remote Debugger

δΈ­ζ–‡ζ–‡ζ‘£

Based on Google's open-source devtools-frontend, you can use JavaScript to implement the Chrome DevTools Protocol . By simply loading a piece of JavaScript code on a web page, you can use the familiar Chrome DevTools to remotely debug the page.

The web page being debugged connects to an intermediate Node layer via WebSocket, and DevTools also connects to the Node layer via WebSocket. The primary role of the Node intermediate layer is to forward socket protocols between the web page and DevTools, enabling full-duplex communication between them.

Additionally, this project has been included in the awesome-chrome-devtools collection.

🎬 Debug DEMO

https://github.com/Nice-PLQ/devtools-remote-debugger/assets/10710341/93c5cbb4-c13d-4f93-866c-9b97ffc327e9

πŸŽ‰ Features:

Elements

<details> <summary> Preivew </summary>

</details>

Console

<details> <summary> Preivew </summary>

</details>

Sources

<details> <summary> Preivew </summary>

</details>

Network

<details> <summary> Preivew </summary>

</details>

Application

<details> <summary> Preivew </summary>

</details>

ScreenPreview

<details> <summary> Preivew </summary>

</details>

How to start?

Open the command terminal and start the following two commands

1. Start Serve

#1. Start the node service
npm run serve

# 2. Start a new terminal
npm run client

2. Open the debug page

Open two pages in the browser

How to use?

1、Modify the variables of the .env file

# The port number to start the Node, such as: port 80
DEBUG_PORT=8080
# Debug the domain name after the deployment of the backend, such as: https://www.remote-debug.com/
DEBUG_HOST='http://localhost:8080'
  1. Execute npm run build to build the project code, and the dist directory will be packaged. The structure is as follows:
β”œβ”€β”€ page    # Debug backend
β”‚   β”œβ”€β”€ index.css
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ index.js
β”œβ”€β”€ cdp.js  # The CDP code for debugging needs to be loaded on the page being debugged. You can deploy it to a CDN.
  1. Start the backend
npm run start
  1. The browser opens the debugging backend http://www.debug.com/remote/debug/index.html, if the debugging target page loads the cdp.js code, then the debugging backend will see the connection record

πŸ’‘Please note that www.debug.com is just an example, please replace it with your own specific domain.

Additional Information

Due to the restrictions of the same-origin policy, you may need to make the following changes:

Star History

Star History Chart

License

MIT

Copyright (c) Nice-PLQ