electron/lib/browser/api/native-theme.ts
Samuel Attard 660e566201
fix: don't expose nativeTheme in the renderer process (#20139)
Exposing these in the renderer didn't make sense as they weren't backed
by the same instance / value store.  This API should be browser only
especially now that we have nativeTheme.themeSource.  Exposing in
//common was a mistake from the beginning.
2019-09-16 14:23:13 -07:00

8 lines
254 B
TypeScript

import { EventEmitter } from 'events'
const { NativeTheme, nativeTheme } = process.electronBinding('native_theme')
Object.setPrototypeOf(NativeTheme.prototype, EventEmitter.prototype)
EventEmitter.call(nativeTheme as any)
module.exports = nativeTheme