Skip to content

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Jan 3, 2023

Closes #6630

In Electron renderers with nodeIntegration enabled, process.type === 'renderer'.

I think this should be ok with bundlers. I think the check below for isNodeEnv uses Object.prototype.toString because bundlers can shim process with an object:

export function isNodeEnv(): boolean {
// explicitly check for browser bundles as those can be optimized statically
// by terser/rollup.
return (
!isBrowserBundle() &&
Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'
);
}

@mydea
Copy link
Member

mydea commented Jan 4, 2023

Sorry, completely missed this before I started to write #6653.

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to capture replays for Electron when node integration is enabled
2 participants