Skip to content
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: add <webview>.sendToFrame() / frameId to 'ipc-message' event #30451

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Aug 9, 2021

Description of Change

This allows replying to an IPC sent by a frame (when nodeIntegrationInSubFrames is enabled) inside of the <webview>:

webview.addEventListener('ipc-message', event => {
  webview.sendToFrame(event.frameId, event.channel, ...event.args);
});

Fixes #30207.

Checklist

Release Notes

Notes: Added <webview>.sendToFrame() / frameId to 'ipc-message' event.

@miniak miniak added semver/minor backwards-compatible functionality target/15-x-y labels Aug 9, 2021
@miniak miniak self-assigned this Aug 9, 2021
@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours api-review/requested 🗳 labels Aug 9, 2021
@miniak miniak marked this pull request as ready for review August 9, 2021 14:05
@miniak miniak changed the title feat: add <webview>.sendToFrame() feat: add <webview>.sendToFrame() / frameId to 'ipc-message' event Aug 9, 2021
@miniak miniak force-pushed the miniak/webview-send-to-frame branch from 3a560c2 to e70b3b4 Compare August 9, 2021 22:05
@miniak miniak requested a review from a team as a code owner August 9, 2021 22:05
@miniak miniak force-pushed the miniak/webview-send-to-frame branch from e70b3b4 to 671fdff Compare August 9, 2021 22:15
@ryankashi
Copy link

webview.sendToFrame with passing in the frameId looks good to me!

@miniak miniak force-pushed the miniak/webview-send-to-frame branch from 671fdff to 699982f Compare August 9, 2021 23:11
Copy link
Contributor

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API looks good to me.

Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

docs/api/webview-tag.md Outdated Show resolved Hide resolved
docs/api/webview-tag.md Show resolved Hide resolved
shell/renderer/api/electron_api_web_frame.cc Outdated Show resolved Hide resolved
@miniak miniak force-pushed the miniak/webview-send-to-frame branch from 699982f to bb0b2e6 Compare August 10, 2021 23:53
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 16, 2021
@codebytere
Copy link
Member

@miniak could you please rebase this? In addition - needs one more button-click API LGTM (@nornagon maybe?)

@miniak
Copy link
Contributor Author

miniak commented Aug 18, 2021

@codebytere conflicts resolved

@nornagon
Copy link
Member

API LGTM. button click is a bit pointless b/c it gets reset by any rebase or other change.

@miniak
Copy link
Contributor Author

miniak commented Aug 23, 2021

@codebytere can we merge this now?

@jkleinsc jkleinsc force-pushed the miniak/webview-send-to-frame branch from fc660e5 to e6eb812 Compare August 23, 2021 14:37
@codebytere codebytere merged commit 501ac15 into main Aug 25, 2021
@codebytere codebytere deleted the miniak/webview-send-to-frame branch August 25, 2021 07:46
@release-clerk
Copy link

release-clerk bot commented Aug 25, 2021

Release Notes Persisted

Added &lt;webview&gt;.sendToFrame() / frameId to 'ipc-message' event.

@trop
Copy link
Contributor

trop bot commented Aug 25, 2021

I was unable to backport this PR to "15-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Aug 25, 2021

@miniak has manually backported this PR to "15-x-y", please check out #30704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/requested 🗳 semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: allow webview.send to send to iframes enabled via nodeintegrationinsubframes
8 participants