Get rid of electron.remote

This commit is contained in:
Fedor Indutny 2021-10-27 10:54:16 -07:00 committed by GitHub
parent 246583d274
commit 76d8b5e375
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 563 additions and 591 deletions

View file

@ -53,6 +53,7 @@ export type SignalContextType = {
getEnvironment: () => string;
getNodeVersion: () => string;
getVersion: () => string;
getPath: (name: 'userData' | 'home' | 'downloads') => string;
i18n: LocalizerType;
log: LoggerType;
renderWindow?: () => void;
@ -71,6 +72,9 @@ export const SignalContext: SignalContextType = {
getEnvironment,
getNodeVersion: (): string => String(config.node_version),
getVersion: (): string => String(config.version),
getPath: (name: 'userData' | 'home' | 'downloads'): string => {
return String(config[`${name}Path`]);
},
i18n: setupI18n(locale, localeMessages),
log: window.SignalContext.log,
nativeThemeListener: createNativeThemeListener(ipcRenderer, window),