New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: deprecate ipcRenderer.sendTo()
#39091
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add _Deprecated_
to the end of this line in the docs:
electron/docs/api/ipc-renderer.md
Line 195 in 4ab0a5a
### `ipcRenderer.sendTo(webContentsId, channel, ...args)` |
@dsanders11 done |
Release Notes Persisted
|
* feat: deprecate ipcRenderer.sendTo() * docs: add _Deprecated_ to ipcRenderer.sendTo()
Description of Change
It's not possible to do proper validation of the sender in the renderer receiving the IPC as only the
senderId
is available, but not thesenderFrame
. This is a concern whennodeIntegrationInSubFrames
is enabled in the originating renderer. The API can also only send the IPC to the main frame in the receiver.This API is redundant as it can be easily replaced by sharing a
MessageChannel
between the two renderers. The main process can validate thesenderFrame
before forwarding theMessagePort
to the other renderer. Performance should also be better as a direct mojo connection is established between the renderers, instead of the IPC being proxied by the main process.This API does not seem to be used much: https://github.com/search?q=ipcRenderer.sendTo&type=code
Related to #38868
Checklist
npm test
passesRelease Notes
Notes: The
ipcRenderer.sendTo()
API has been deprecated in favor of sharing aMessageChannel
between two renderers.