fix: do not remove node globals when context isolation is enabled (#18967)
This commit is contained in:
parent
1d8e16bc6e
commit
6eed4a98ce
1 changed files with 11 additions and 8 deletions
|
@ -179,14 +179,17 @@ if (nodeIntegration) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Delete Node's symbols after the Environment has been loaded.
|
// Delete Node's symbols after the Environment has been loaded in a
|
||||||
process.once('loaded', function () {
|
// non context-isolated environment
|
||||||
delete global.process
|
if (!contextIsolation) {
|
||||||
delete global.Buffer
|
process.once('loaded', function () {
|
||||||
delete global.setImmediate
|
delete global.process
|
||||||
delete global.clearImmediate
|
delete global.Buffer
|
||||||
delete global.global
|
delete global.setImmediate
|
||||||
})
|
delete global.clearImmediate
|
||||||
|
delete global.global
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const errorUtils = require('@electron/internal/common/error-utils')
|
const errorUtils = require('@electron/internal/common/error-utils')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue