Giter VIP home page Giter VIP logo

devtools-remote-debugger's Introduction

Devtools Remote Debugger

中文文档

Based on Google's open source devtools-frontend developer tools, and implement the Chrome DevTools Protocol with JavaScript. You only need to load a js script in the web page to use the most familiar chrome devtools to remotely debug the page.

The web page being debugged is connected to the middle node layer through websocket, and devtools is also connected to node through websocket. The role of the node middle layer is mainly to forward the socket protocol to each other, so that the web page and devtools can realize full-duplex communication.

Features:

  • Elements

    • Display Html Tags
    • Edit Html Attributes
    • Display Style Rules
    • Highlight Node
  • Console

    • Execute JavaScript Code
    • Show Error Stack
  • Sources

    • Show Source Code
  • Network

    • Show XHR request
  • Application

    • Local storage
    • Session storage
    • Cookies
  • Screenshot

    • Live Preview

Debug DEMO

demo.mp4

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
├── sdk.js  # The sdk code for debugging needs to load the script in the debugged page, and it can be deployed to cdn

3、Start the backend

npm run start

Other instructions

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

  • Browsers do not allow JavaScript to read CSSRules of different domains by default, so you need to add the crossorigin="anonymous" attribute when the link introduces an external style, and the style of the style tag does not have this problem.
  • To capture Javascript specific error messages, you also need to add crossorigin="anonymous" to the script tag.

devtools-remote-debugger's People

Contributors

nice-plq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.