refactor: replace webFrame.routingId with sync IPC#47717
Conversation
| ): Electron.WebFrame | null { | ||
| findFrameByRoutingIdDeprecated(); | ||
| const frameToken = ipcRendererUtils.invokeSync<string | undefined>( | ||
| IPC_MESSAGES.BROWSER_GET_FRAME_TOKEN_SYNC, |
There was a problem hiding this comment.
It hadn't occurred to me that this workaround would require one roundtrip to get the routingId, and then a second roundtrip to convert it right back into a frame token 😅
That said, this still seems like the best way to give apps more time to migrate.
There was a problem hiding this comment.
It's only one roundtrip so it's not too bad! FindFrameByToken only looks within the current renderer process afaik. If the frame is in another process, it won't be returned from the WebFrame API.
electron/shell/renderer/api/electron_api_web_frame.cc
Lines 823 to 826 in a33b599
3da63d1 to
b61f468
Compare
|
I'll wait for the roll to be merged before fixing up this PR. |
4db9fea to
d3690a9
Compare
dd92508 to
18c2fdd
Compare
18c2fdd to
3bd7805
Compare
|
No Release Notes |
|
I have automatically backported this PR to "38-x-y", please check out #47941 |
* refactor: replace webFrame.routingId with sync IPC * fix: GetConstructor missing isolate * fix: missing isolate
Description of Change
Follow up to #47616
Depends on #47850
Replaces
webFrame.routingIdandwebFrame.findFrameByRoutingId()with internal synchronous IPC implementations. This allows us to avoid immediate breaking changes and allows application developers time to upgrade.Checklist
npm testpassesRelease Notes
Notes: none