signal-desktop/ts/windows/about/preload.ts

24 lines
691 B
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2018 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { contextBridge } from 'electron';
import { MinimalSignalContext } from '../minimalContext';
2023-03-14 15:55:31 +00:00
import { config } from '../../context/config';
import { environment } from '../../context/environment';
const environments: Array<string> = [environment];
if (config.appInstance) {
environments.push(String(config.appInstance));
}
const Signal = {
AboutWindowProps: {
arch: process.arch,
environmentText: environments.join(' - '),
platform: process.platform,
2023-03-14 15:55:31 +00:00
},
};
contextBridge.exposeInMainWorld('Signal', Signal);
contextBridge.exposeInMainWorld('SignalContext', MinimalSignalContext);