You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
25.9.8
What operating system are you using?
Windows
Operating System Version
Windows 11 23H2
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Because function calls through contextBridge actually involve parameter passing by copying, this leads to poor performance in scenarios with large amounts of data.
So you can use postMessage between renderer and the preload script.
The main reason to use contextBridge is for synchronous messaging between the isolated world and main world. If you don't need synchronous messaging, window.postMessage works just as well.
@Prinzhorn Your response successfully solved my problem.However, I have a question. Since it's supposed to be context isolated, why can the preload.js file access the same window object as the rendering process?
Preflight Checklist
Electron Version
25.9.8
What operating system are you using?
Windows
Operating System Version
Windows 11 23H2
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Because function calls through contextBridge actually involve parameter passing by copying, this leads to poor performance in scenarios with large amounts of data.
preload.js
WEB.js
Actual Behavior
I hope there is a way, like postMessage, to transfer control and avoid a large amount of data copying.
Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: