Giter VIP home page Giter VIP logo

ipcman's Introduction

IpcMan

Electron IPC Hook/Devtools

NPM Version npm package minimized gzipped size License

ipcman-demo.mp4

Contents

Package Contents
ipcman ~3KB core module, providing Electron IPC hook with request/response tagging
@ipcman/devtools Devtools backend, providing an HTTP/WebSocket API
@ipcman/devtools-fe Devtools frontend, providing real-time IPC monitoring, history playback, request/response binding and inspector

IpcMan Devtools Guide

Step 1: Download IpcMan Devtools

First, download IpcMan Devtools from Releases and extract.

Step 2: Inject

Next, inject IpcMan Devtools into the target electron app. There are several ways to do this, the simplest of which is to directly modify the entry JavaScript file. We'll take Waves Central as an example.

Open resources folder under app directory. If there's no app folder in it but only app.asar file, run following command to extract app folder:

npx asar extract app.asar app
mv app.asar app.asar.bak

Next, open package.json inside app, you'll see the entrypoint of the app:

{
  // ...
  "main": "src/main.js",
  // ...
}

Open src/main.js and insert the line below at the top of the file:

require('/path/to/downloaded/ipcman.js').ipcManDevtools({})

Step 3: Run App

Finally, directly run the app. Once the app starts, head to http://127.0.0.1/9009 and you'll see the Devtools frontend. Happy hacking!

ipcman Reference

Events

Event Description
send Emits before sending a message to frontend.
receive Emits before receiving a message from frontend.

Function ipcMan: <IpcArgs extends unknown[] = unknown[]>(config: IpcManConfig<IpcArgs>) => IpcManContext

The ipcMan() function.

Interface IpcManConfig

Options for ipcMan().

Function handler: (data: IpcManData) => unknown

The event handler. Required.

Function getId?: (p: IpcArgs) => string | undefined

ID detect logic for resoving wrapped request/response of target app. Optional.

@ipcman/devtools Reference

Function ipcManDevtools: (config: IpcManDevtoolsConfig) => Promise<void>

Start IpcMan Devtools.

Interface IpcManDevtoolsConfig extends Omit<IpcManConfig, 'handler'>

Options for ipcManDevtools(). Same as IpcManConfig but without handler.

LICENSE

MIT

ipcman's People

Contributors

ilharp avatar microcber avatar

Stargazers

KBLonay 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.