electron/lib/renderer/api/exports/electron.js
Alexey Kuzmin dee9aef975 Add "enable_desktop_capturer" build flag (#13133)
* Make it possible to disable a module for a renderer

* Put DesktopCapturer API under a build flag

The name is "enable_desktop_capturer".
Enabled by default.
2018-06-13 11:15:34 -05:00

21 lines
441 B
JavaScript

const common = require('../../../common/api/exports/electron')
const moduleList = require('../module-list')
// Import common modules.
common.defineProperties(exports)
for (const {
name,
file,
enabled = true,
private: isPrivate = false
} of moduleList) {
if (!enabled) {
continue
}
Object.defineProperty(exports, name, {
enumerable: !isPrivate,
get: () => require(`../${file}`)
})
}