Home

Awesome

<div align="center"> <a href="https://eruda.liriliri.io/" target="_blank"> <img src="https://eruda.liriliri.io/icon.png" width="400"> </a> </div> <h1 align="center">Eruda</h1> <div align="center">

Console for Mobile Browsers.

NPM version Build status Test coverage Downloads License

</div> <img src="https://eruda.liriliri.io/screenshot.jpg" style="width:100%">

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="https://cdn.jsdelivr.net/npm/eruda"; document.body.append(script); script.onload = function () { eruda.init(); } })();

Features

Install

You can get it on npm.

npm install eruda --save-dev

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="https://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>');
})();

If you are using modern JavaScript tooling, you can dynamically import it.

if (import.meta.env.MODE === 'development') {
    import('eruda').then(eruda => eruda.default.init());
}

Configuration

When initialization, a configuration object can be passed in.

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

Third Party

Backers

<a rel="noreferrer noopener" href="https://opencollective.com/eruda" target="_blank"><img src="https://opencollective.com/eruda/backers.svg?width=890"></a>

Contribution

Read Contributing Guide for development setup instructions.