From 0f498682348965409e6c843c5888ad6e4b999f5d Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 9 Aug 2023 16:38:48 +0200 Subject: [PATCH] chore: deprecate `senderId` and `senderIsMainFrame` (#39381) --- docs/api/structures/ipc-renderer-event.md | 4 ++-- docs/breaking-changes.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/api/structures/ipc-renderer-event.md b/docs/api/structures/ipc-renderer-event.md index 8c4fe1bceea7..4e8b32f47c78 100644 --- a/docs/api/structures/ipc-renderer-event.md +++ b/docs/api/structures/ipc-renderer-event.md @@ -1,8 +1,8 @@ # IpcRendererEvent Object extends `Event` * `sender` [IpcRenderer](../ipc-renderer.md) - The `IpcRenderer` instance that emitted the event originally -* `senderId` Integer - The `webContents.id` that sent the message, you can call `event.sender.sendTo(event.senderId, ...)` to reply to the message, see [ipcRenderer.sendTo][ipc-renderer-sendto] for more information. This only applies to messages sent from a different renderer. Messages sent directly from the main process set `event.senderId` to `0`. -* `senderIsMainFrame` boolean (optional) - Whether the message sent via [ipcRenderer.sendTo][ipc-renderer-sendto] was sent by the main frame. This is relevant when `nodeIntegrationInSubFrames` is enabled in the originating `webContents`. +* `senderId` Integer _Deprecated_ - The `webContents.id` that sent the message, you can call `event.sender.sendTo(event.senderId, ...)` to reply to the message, see [ipcRenderer.sendTo][ipc-renderer-sendto] for more information. This only applies to messages sent from a different renderer. Messages sent directly from the main process set `event.senderId` to `0`. +* `senderIsMainFrame` boolean (optional) _Deprecated_ - Whether the message sent via [ipcRenderer.sendTo][ipc-renderer-sendto] was sent by the main frame. This is relevant when `nodeIntegrationInSubFrames` is enabled in the originating `webContents`. * `ports` [MessagePort][][] - A list of MessagePorts that were transferred with this message [ipc-renderer-sendto]: ../ipc-renderer.md#ipcrenderersendtowebcontentsid-channel-args-deprecated diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index a0ed15a13acb..4b473c158f0d 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -25,6 +25,8 @@ or later will be required to run Electron v27.0.0 and higher. The `ipcRenderer.sendTo()` API has been deprecated. It should be replaced by setting up a [`MessageChannel`](tutorial/message-ports.md#setting-up-a-messagechannel-between-two-renderers) between the renderers. +The `senderId` and `senderIsMainFrame` properties of `IpcRendererEvent` have been deprecated as well. + ## Planned Breaking API Changes (25.0) ### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol`