8000 [Feature Request]: Allow custom v8 snapshots to be used in the main process and the default snapshot in the browser process · Issue #35170 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Feature Request]: Allow custom v8 snapshots to be used in the main process and the default snapshot in the browser process #35170
Closed
@ryanthemanuel

Description

@ryanthemanuel

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0