

Mobile web debugging tool developed based on react
source link: https://dev.to/ihtml5/mobile-web-debugging-tool-developed-based-on-react-116f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Mobile web debugging tool developed based on react
Aug 26
・2 min read
Mobile web debugging tool developed based on react
Easy to use
Full-featured
Easy to expand
high performance
Use the cdn method, one-click access Similar to Chrome devtools, supports log, network, storage, performance, etc., has better network capture capabilities and rich log display Expose rich internal events, which can be seamlessly integrated with react components Support large amount of data display, no lag
github
https://github.com/tnfe/mdebug
Demos
Installation
Install using npm
npm install mdebug --save
Useage
1. ES6
import mdebug from 'mdebug';
mdebug.init();
2.CDN
(function() {
var scp = document.createElement('script');
// Load the latest mdebug version
scp.src = 'https://unpkg.com/mdebug@latest/dist/index.js';
scp.async = true;
scp.charset = 'utf-8';
// Successfully loaded and initialized
scp.onload = function() {
mdebug.init();
};
// Load state switch callback
scp.onreadystate = function() {};
// Load failed callback
scp.onerror = function() {};
document.getElementsByTagName('head')[0].appendChild(scp);
})();
1. init
mdebug.init({
containerId: '' // mdebug mounts the container id, if it is empty, a unique id will be automatically generated internally,
plugins: [], // Incoming mdebug plugin
hideToolbar: [], // Pass in the tab id that needs to be hidden
});
2. addPlugin
mdebug.addPlugin({
id: '', // tab id
name: '', // Chinese title corresponding to tab,
enName: '', // English title corresponding to tab
component: () => {}, // React component corresponding to tab
});
3. removePlugin
// Support the id of the panel to be removed
/*
System => system;
Elements => elements;
Console => console
Application => application
NetWork => network
Performance => performance
Settings => settings
*/
mdebug.removePlugin([]);
4. exportLog
/*
@returned {
type: '' // Log type
source: [], // Original log
}
@params type
// type is equal to log, return all console logs
// type is equal to net, return all net logs
*/
mdebug.exportLog(type);
mdebug.on(eventName, callback);
6. emit
mdebug.emit(eventName, data);
Event list
development
- npm start
- npm run build
License
The MIT License (MIT). Please see License File for more information.
Discussion (1)
Feedback is welcome
Recommend
-
15
repeat-please-mobile Virtual Pronunciation Coach developed in React Native. Built Using React Native - Framework to build iOS and Android App. Redux - Library for managing application state. Red...
-
7
State management tool based on React state hookThe simple but incredibly fast and flexible state management that is based on React state hook:Easy to UseIncredibly FastFeature RichFirst-...
-
8
ReactNativeWeather A weather app developed in React Native. It is the React Native version of SwiftWeather How to run the app Install react-native If you...
-
5
July 1, 2021 ...
-
8
Apps Project developed on NLW Together's React Native soundtrack Nov 18, 2021...
-
11
Apps A beautiful public transportation mobile application developed using Expo react native Feb 16, 2022 1 min read Previous Post ...
-
9
eCommerce E-commerce mobile application developed using React Native Jan 01, 2023 2 min read
-
5
Revolutionary AI Tool Developed to Diagnose Childhood Blindness Yana Khare — Published On M...
-
3
Learn why this is the correct answer According to Android Inc. founder
-
9
Mastercard has developed a new AI tool to prevent scams...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK