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

[Feature Request]: Allow custom v8 snapshots to be used in the main process and the default snapshot in the browser process #35170

Closed
3 tasks done
ryanthemanuel opened this issue Aug 2, 2022 · 2 comments · Fixed by #35266

Comments

@ryanthemanuel
Copy link
Contributor

ryanthemanuel commented Aug 2, 2022

Preflight Checklist

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

@brian-mann
Copy link

brian-mann commented Aug 3, 2022

Hopefully someone from the core team will see this. We recently updated the content above to clarify the problem we're seeing as well as the desired solution.

@brian-mann
Copy link

cc @MarshallOfSound can we chat about this? This is for Cypress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment