This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
forked from electron/electron
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EventEmitter is missing properties in sandbox preload script. (e…
- Loading branch information
1 parent
dd3533b
commit 2a96c35
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(function () { | ||
const { EventEmitter } = require('events'); | ||
const emitter = new EventEmitter(); | ||
const rendererEventEmitterProperties = []; | ||
let currentObj = emitter; | ||
do { | ||
rendererEventEmitterProperties.push(...Object.getOwnPropertyNames(currentObj)); | ||
} while ((currentObj = Object.getPrototypeOf(currentObj))); | ||
const { ipcRenderer } = require('electron'); | ||
ipcRenderer.send('answer', rendererEventEmitterProperties); | ||
})(); |