Skip to content

Preload scripts can run twice in the same process in different node environments #17576

@MarshallOfSound

Description

@MarshallOfSound

Issue Details

  • Electron Version:
    • 3.x, 4.x, 5.x, 6.x
  • Operating System:
    • All
  • Last Known Working Electron version::
    • 2.x

Expected Behavior

When navigations occur, a new process should be created for the navigation.

Actual Behavior

When a navigation occurs during a preloads scripts execution the same process is re-used as Chromium does not think the navigation has been committed yet. This causes a memory leak and all native node modules to break.

To Reproduce

Fiddle: https://gist.github.com/MarshallOfSound/c89aa0037c3da114d44aa3a2d1a0fc24

Screenshots

image

As you can see here there are three navigation loads, the second and the third one actually have the same process ID (and are running in the same process)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions