Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
We are using electron-mksnapshot
to generate a custom v8 snapshot for our application that is desired to run only in the main process, not the renderer process. While debugging our app, we noticed that the snapshot is available to the renderer process even with nodeIntegration disabled.
We noticed that electron is patching chromium to always load the v8 snapshots, with a comment indicating that this is required. Is loading the v8 snapshot required even when nodeIntegration is disabled?
We would like for there to be a way to use our custom snapshot in the main process but use the default snapshot (or no snapshot with nodeIntegration disabled) in the browser process.
Proposed Solution
This could be done a variety of ways, but one possibility would be to update the patch to not load the custom snapshot when node integration is disabled. Or if it's desired sometimes to have node integration disabled and a v8 snapshot included, you could have an additional parameter that specifies as such.
Alternatives Considered
One alternative for us would be to have separate main electron processes: one for the bulk of our main code that uses the snapshot, and one to purely launch the browser that doesn't launch the snapshot. This is undesirable as it significantly complicates the code and potentially bloats the size of our binary.
Additional Information
No response