• Stars
    star
    241
  • Rank 167,643 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React

English | 简体中文

基于React开发的移动web调试工具 更新日志

简单易用

功能全面

易扩展

高性能

使用cdn方式,一键接入 类Chrome devtools, 内嵌React开发者工具,支持日志,网络,元素,代理,存储,性能等, 具有更好的网络捕获能力和丰富的日志展现形式 暴露内部丰富的事件, 可以和react组件无缝进行集成 支持大数据量展示, 不卡顿
NPM Version PRs Node Version

一、快速体验

https://ihtml5.github.io/mdebug

image

二、Examples

  • Vanilla

Edit crimson-sun-py8x7

三、安装

Install using npm

npm install mdebug --save

四、使用

1. ES6

  import mdebug from 'mdebug';
  mdebug.init();

2.CDN

(function() {
    var scp = document.createElement('script');
    // 加载最新的mdebug版本
    scp.src = 'https://unpkg.com/mdebug@latest/dist/index.js';
    scp.async = true;
    scp.charset = 'utf-8';
    // 加载成功并初始化
    scp.onload = function() {
        mdebug.init();
    };
    // 加载状态切换回调
    scp.onreadystate = function() {};
    // 加载失败回调 
    scp.onerror = function() {};
    document.getElementsByTagName('head')[0].appendChild(scp);
})();

五、API

1. init

mdebug.init({
    containerId: '' // mdebug挂载容器id, 如果传空, 内部会自动生成一个不重复的id,
    plugins: [], // 传入mdebug插件
    hideToolbar: [], // 传入需要隐藏的tab id
});

2. addPlugin

mdebug.addPlugin({
    id: '', // tab id
    name: '', // tab对应的中文title,
    enName: '', // tab对应的英文title
    component: () => {}, // tab对应的react组件
});

3. removePlugin

// 支持移除的panel对应的id
/*
System => system;
Elements => elements;
Console => console
Application => application
NetWork => network
Performance => performance
Settings => settings
*/
mdebug.removePlugin([]);

4. exportLog

/*
@returned {
  type: '' // 日志类型
  source: [], // 原始日志
}
@params type
// type等于log, 返回所有的console日志
// type等于net, 返回所有的net日志
*/
mdebug.exportLog(type);

5. on

mdebug.on(eventName, callback);

6. emit

mdebug.emit(eventName, data);

六、事件列表

事件名称 数据 触发时机
ready object mdebug加载完毕
addTab object 增加面板
removeTab array 移除面板
changeTab object 面板切换

七、开发

  1. npm i
  2. npm start // 启动开发
  3. npm run build //打包
  4. npm run test // 单元测试

八、相关文章

  1. 移动端前端开发调试
  2. Chrome 开发者工具

九、相关项目

  1. eruda
  2. vConsole
  3. react-json-tree
  4. 基于React的移动端调试解决方案
  5. a useful debugger for mobile
  6. autoDevTools
  7. react-inspector
  8. web-console
  9. ChromeDevTools

十、License

The MIT License (MIT). Please see License File for more information.

More Repositories

1

50weekly

50weekly 发现高质量的前端资源
601
star
2

react-source

deep into react react源码阅读
11
star
3

uhooks

Explore hooks and start creating your own hooks
JavaScript
8
star
4

diagram

diagram front end 图解前端
6
star
5

blog

个人博客 源码阅读*前端实践 My Blog
CSS
6
star
6

frontEndBooks

前端资料库
6
star
7

react-accordion

accordion based on react
HTML
4
star
8

one-utils

Super useful utility tool library and run anywhere
JavaScript
3
star
9

norton-miniui

简单易用的快速开发框架
JavaScript
3
star
10

norton-state

A state management is built in react context
JavaScript
2
star
11

wx-component

微信小程序自定义组件
JavaScript
2
star
12

muso

muso
JavaScript
2
star
13

custom-renderer

custom-renderer
2
star
14

jscalpel-orm

It is convenient for you to extract the required fields from one object to generate another object.
JavaScript
2
star
15

mnu-cli

so easy and quickly create template
JavaScript
2
star
16

performance

Easy to use web performance analysis tool
JavaScript
2
star
17

dtracker

支持Ajax,Fetch,Image,navigator.sendBeacon等请求。常用于接口异常监控,数据上报,数据旁路等场景。Support Ajax, Fetch and other images, navigator.sendBeacon is often used in interface monitoring, data reporting, data bypass and other scenarios
JavaScript
2
star
18

forjs

wxweb seamlessly connects h5 and mini program
1
star
19

react-template

基于react和redux的高扩展性项目架构
JavaScript
1
star
20

react-mobile-template

基于 webpack2+react+redux+react-router移动端单页面应用模板
JavaScript
1
star
21

require-jquery-bootstrap

require query bootstrap demo
JavaScript
1
star
22

urlParser

Easy to use d url analysis tool
1
star
23

crossview

基于web components的混合技术栈开发
JavaScript
1
star
24

mnu

React-based mobile solution
JavaScript
1
star
25

virtual-scroller

Infinite List and React
1
star
26

growth-hacking

growth-hacking
1
star
27

webpack2-multipage-template

基于webpack2的前端工程化探索
JavaScript
1
star
28

wc-weekly

web components相关最新实践和进展
1
star
29

mobike

mobike web app based on vue 2.0 and vue-router 2.0
JavaScript
1
star
30

react-pullrefresh

use react to build pullrefresh and loadmore
JavaScript
1
star
31

issues

Collect high quality questions and answers
1
star
32

jrp

Created with CodeSandbox
JavaScript
1
star
33

wxapp-redux

use redux to build wx app
JavaScript
1
star
34

designthinking

designthinking in china
1
star
35

hack-wxapp

研究微信小程序内部实现,学习其开发架构
1
star
36

helloOpenSource

每周精选若干高质量开源项目 Select a few high-quality open source projects every week
1
star
37

advanceQuery

advanceQuery based on react
CSS
1
star
38

algorithm

algorithm && data structure
1
star
39

react-resources

everything about react
1
star
40

mtracker

User behavior trajectory tracking
JavaScript
1
star
41

cascadMenu

Level 3 cascading menu
JavaScript
1
star
42

ssr

基于create-react-app 2.0等最新前端技术框架的react同构渲染模版,支持热更新,redux等
JavaScript
1
star