镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

IPC handlers on webContents.ipc not unwrapped properly #324

Open

Description

@UndefinedOffset

It looks like devtron is not properly unwrapping ipc handlers bound on webContents.ipc this gist https://github.com/proxy/gist.github.com/wbgsupport/8cb6257df3c50804675f8de6f0f7f73c reproduces the issue. All events show in devtron as expected but when the request reaches the handler it's not unwrapped. Using the gist the example output is shown in the console.

Handle: {
  __uuid__devtron: 'deb2f126-07a2-49c2-98a4-6fb691ec33d4',
  args: [ 'Hello World' ]
}
HandleOnce: {
  __uuid__devtron: '4becdc5f-4821-42b7-ab88-cd8ac4862ee1',
  args: [ 'Hello World' ]
}
Send On: Hello World
Send Once: Hello World
SendSync On: {
  __uuid__devtron: '795a5dbc-16bb-4833-984d-7b068904f925',
  args: [ 'Hello World' ]
}
SendSync Once: {
  __uuid__devtron: '5eb677b7-07ae-4821-8d69-ea894e052c33',
  args: [ 'Hello World' ]
}

Activity

  1. mossae commented on Feb 17, 2026

    @mossae

    I investigated this and it looks like the issue is related to how Devtron patches IPC handlers.
    In patchIpcMain() Devtron monkey-patches ipcMain.on, ipcMain.handle, etc., and wraps listeners to unwrap custom payloads using getArgsFromPayload().
    However, webContents.ipc handlers are not patched there.
    Tracking still works because Devtron listens to internal session events (-ipc-message, -ipc-invoke, etc.), but the unwrapping logic is only applied when handlers are registered via ipcMain.
    When using webContents.ipc.handle or webContents.ipc.on, the listener does not go through Devtron’s cleanedListener, so the wrapped payload ({ __uuid__devtron, args }) reaches the user handler directly.
    It seems Devtron would also need to patch webContents.ipc methods similarly to how ipcMain is patched, likely by hooking into browser-window-created and wrapping webContents.ipc methods.
    Happy to attempt a PR if this direction makes sense.

  2. UndefinedOffset commented on Feb 18, 2026

    @UndefinedOffset
    Author

    Might be best to hook into web-contents-created rather than browser-window-created as that would catch BrowserContentView instances as well not just BrowserWindow. Regardless that's the conclusion I came to as well it's simply not running through the cleaned listener.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions