GithubHelp home page GithubHelp logo

alexxnica / devtron Goto Github PK

View Code? Open in Web Editor NEW

This project forked from electron-userland/devtron

0.0 1.0 0.0 737 KB

An Electron DevTools Extension

Home Page: http://electron.atom.io/devtron

License: MIT License

JavaScript 71.87% CSS 6.16% HTML 21.97%

devtron's Introduction

Devtron icon Devtron

An Electron DevTools extension to help you inspect, monitor, and debug your app.

Travis Build Status AppVeyor Build status js-standard-style downloads:?

screenshot

Features

  • Require graph to help you visualize your app's internal and external library dependencies in both the main and renderer processes.
  • IPC monitor to track and inspect the messages sent and received between the renderer and main processes in your app.
  • Event inspector that shows the events and listeners that are registered in your app on the core Electron APIs such as the window, the app, and the processes.
  • App Linter that checks your apps for possible issues and missing functionality.

Installing

npm install --save-dev devtron

Then execute the following from the Console tab of your running Electron app's developer tools:

require('devtron').install()

You should then see a Devtron tab added.

Disabled Node Integration

If your application's BrowserWindow was created with nodeIntegration set to false then you will need to expose some globals via a preload script to allow Devtron access to Electron APIs:

window.__devtron = {require: require, process: process}

Then restart your application and Devtron should successfully load. You may want to guard this assignment with a if (process.env.NODE_ENV === 'development') check to ensure these variables aren't exposed in production.

Developing locally

git clone https://github.com/electron/devtron
cd devtron
npm install
npm start

This will start a process that watches and compiles the extension as files are modified.

Then open the Console tab of your Electron app and run the following with the path updated for the location that you've cloned devtron to:

require('/Users/me/code/devtron').install()

Then a Devtron tab should appear and it will now be enabled for that application.

You can reload the extension by closing and reopening the dev tools.

Running in a browser

To make developing and debugging the extension easier, you can run it in a Chrome tab that will talk remotely to a running Electron app over HTTP.

  • Set the DEVTRON_DEBUG_PATH environment variable to the path of the cloned devtron repository.

  • Start your Electron application.

  • Click the Devtron tab.

  • You should then see the following messages logged to the Console tab:

    Devtron server listening on http://localhost:3948

    Open file:///Users/me/devtron/static/index.html to view

  • Then open /Users/me/devtron/static/index.html in Chrome

  • The page there will talk remotely to the running Electron app so you'll be able to fully interact with each pane with real data.

Contributing

Have an idea for something this extension could do to make debugging Electron apps easier? Please open an issue.

Pull requests are also welcome and appreciated. Run npm test to run the existing tests. This project uses the standard JavaScript style.

License

MIT

devtron's People

Contributors

kevinsawicki avatar jlord avatar philschatz avatar marshallofsound avatar zeke avatar binarymuse avatar princejwesley avatar rafaelstz avatar sindresorhus avatar stevekinney avatar simurai avatar

Watchers

 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.