[PR #560] Allow IpcMain to send IPC messages to BrowserViews #1215

Open
opened 2026-01-29 16:58:30 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/ElectronNET/Electron.NET/pull/560

State: closed
Merged: Yes


Currently, IpcMain can only send IPC messages to BrowserWindows, because the Send method's browserWindow parameter is strongly typed to BrowserWindow. This PR overloads the Send method to accept a BrowserView as well, emitting the sendToIpcRendererBrowserView socket message with the same implementation. The host receives this message in ipc.ts, locates the BrowserView with the given ID from the global browserViews array created in browserView.ts, and sends the IPC message to its webContents.

**Original Pull Request:** https://github.com/ElectronNET/Electron.NET/pull/560 **State:** closed **Merged:** Yes --- Currently, `IpcMain` can only send IPC messages to `BrowserWindow`s, because the `Send` method's `browserWindow` parameter is strongly typed to `BrowserWindow`. This PR overloads the `Send` method to accept a `BrowserView` as well, emitting the `sendToIpcRendererBrowserView` socket message with the same implementation. The host receives this message in `ipc.ts`, locates the `BrowserView` with the given ID from the global `browserViews` array created in `browserView.ts`, and sends the IPC message to its `webContents`.
claunia added the pull-request label 2026-01-29 16:58:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1215