mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: do not remove node globals when context isolation is enabled (#18967)
This commit is contained in:
committed by
Shelley Vohr
parent
1d8e16bc6e
commit
6eed4a98ce
@@ -179,14 +179,17 @@ if (nodeIntegration) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Delete Node's symbols after the Environment has been loaded.
|
||||
process.once('loaded', function () {
|
||||
delete global.process
|
||||
delete global.Buffer
|
||||
delete global.setImmediate
|
||||
delete global.clearImmediate
|
||||
delete global.global
|
||||
})
|
||||
// Delete Node's symbols after the Environment has been loaded in a
|
||||
// non context-isolated environment
|
||||
if (!contextIsolation) {
|
||||
process.once('loaded', function () {
|
||||
delete global.process
|
||||
delete global.Buffer
|
||||
delete global.setImmediate
|
||||
delete global.clearImmediate
|
||||
delete global.global
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
|
||||
Reference in New Issue
Block a user