Giter Site home page Giter Site logo

yyyanghj / eruda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liriliri/eruda

0.0 0.0 0.0 3.16 MB

Console for mobile browsers

Home Page: https://eruda.liriliri.io/

License: MIT License

JavaScript 87.77% CSS 1.07% HTML 2.13% Handlebars 2.98% SCSS 6.05%

eruda's Introduction

δΈ­ζ–‡

Eruda

NPM version Build status Test coverage Downloads License Join the chat at https://gitter.im/liriliri/eruda Donate

Console for Mobile Browsers.

Eruda

Demo

Demo

Browse it on your phone: https://eruda.liriliri.io/

In order to try it for different sites, execute the script below on browser address bar.

javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init() } })();

Features

  • Console: Display JavaScript logs.
  • Elements: Check dom state.
  • Network: Show requests status.
  • Resource: Show localStorage, cookie information.
  • Info: Show url, user agent info.
  • Snippets: Include snippets used most often.
  • Sources: Html, js, css source viewer.

Install

You can get it on npm.

npm install eruda --save

Add this script to your page.

<script src="node_modules/eruda/eruda.js"></script>
<script>eruda.init();</script>

It's also available on jsDelivr and cdnjs.

<script src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>

The JavaScript file size is quite huge(about 100kb gzipped) and therefore not suitable to include in mobile pages. It's recommended to make sure eruda is loaded only when eruda is set to true on url(http://example.com/?eruda=true), for example:

;(function () {
    var src = '//cdn.jsdelivr.net/npm/eruda';
    if (!/eruda=true/.test(window.location) && localStorage.getItem('active-eruda') != 'true') return;
    document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
    document.write('<scr' + 'ipt>eruda.init();</scr' + 'ipt>');
})();

Configuration

When initialization, a configuration object can be passed in.

  • container: Container element. If not set, it will append an element directly under html root element.
  • tool: Choose which default tools you want, by default all will be added.

For more information, please check the documentation.

let el = document.createElement('div');
document.body.appendChild(el);

eruda.init({
    container: el,
    tool: ['console', 'elements']
});

Plugins

If you want to create a plugin yourself, follow the guides here.

Related Projects

Contribution

Read Contributing Guide for development setup instructions.

eruda's People

Contributors

surunzi avatar omarchehab98 avatar fa-ge avatar zilong-thu avatar unclebill avatar moklick avatar gitter-badger avatar mayness avatar tlongzou avatar zjffun 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.