ipcman-demo.mp4
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 |
First, download IpcMan Devtools from Releases and extract.
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({})
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!
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.
Options for ipcMan()
.
The event handler. Required.
ID detect logic for resoving wrapped request/response of target app. Optional.
Start IpcMan Devtools.
Options for ipcManDevtools()
. Same as IpcManConfig
but without handler
.
MIT