Enables sandbox on about window
This commit is contained in:
parent
58691b2f5e
commit
4591b56f7f
27 changed files with 262 additions and 93 deletions
|
@ -12,13 +12,15 @@ import type { LocaleMessagesType } from '../types/I18N';
|
|||
import type { NativeThemeType } from '../context/createNativeThemeListener';
|
||||
import type { SettingType } from '../util/preload';
|
||||
import type { RendererConfigType } from '../types/RendererConfig';
|
||||
import { ActiveWindowService } from '../services/ActiveWindowService';
|
||||
|
||||
import { Bytes } from '../context/Bytes';
|
||||
import { Crypto } from '../context/Crypto';
|
||||
import { Timers } from '../context/Timers';
|
||||
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import type { ActiveWindowServiceType } from '../services/ActiveWindowService';
|
||||
import { config } from '../context/config';
|
||||
import { i18n } from '../context/i18n';
|
||||
import { activeWindowService } from '../context/activeWindowService';
|
||||
import {
|
||||
getEnvironment,
|
||||
parseEnvironment,
|
||||
|
@ -27,7 +29,7 @@ import {
|
|||
import { strictAssert } from '../util/assert';
|
||||
import { createSetting } from '../util/preload';
|
||||
import { initialize as initializeLogging } from '../logging/set_up_renderer_logging';
|
||||
import { waitForSettingsChange } from './waitForSettingsChange';
|
||||
import { waitForSettingsChange } from '../context/waitForSettingsChange';
|
||||
import { createNativeThemeListener } from '../context/createNativeThemeListener';
|
||||
import {
|
||||
isWindows,
|
||||
|
@ -37,24 +39,6 @@ import {
|
|||
getClassName,
|
||||
} from '../OS';
|
||||
|
||||
const activeWindowService = new ActiveWindowService();
|
||||
activeWindowService.initialize(window.document, ipcRenderer);
|
||||
|
||||
const params = new URLSearchParams(document.location.search);
|
||||
const configParam = params.get('config');
|
||||
strictAssert(typeof configParam === 'string', 'config is not a string');
|
||||
const config: RendererConfigType = JSON.parse(configParam);
|
||||
|
||||
const { resolvedTranslationsLocale } = config;
|
||||
strictAssert(
|
||||
resolvedTranslationsLocale,
|
||||
'locale could not be parsed from config'
|
||||
);
|
||||
strictAssert(
|
||||
typeof resolvedTranslationsLocale === 'string',
|
||||
'locale is not a string'
|
||||
);
|
||||
|
||||
const localeMessages = ipcRenderer.sendSync('locale-data');
|
||||
setEnvironment(parseEnvironment(config.environment));
|
||||
|
||||
|
@ -74,7 +58,7 @@ export type SignalContextType = {
|
|||
nativeThemeListener: NativeThemeType;
|
||||
setIsCallActive: (isCallActive: boolean) => unknown;
|
||||
|
||||
activeWindowService: typeof activeWindowService;
|
||||
activeWindowService: ActiveWindowServiceType;
|
||||
Settings: {
|
||||
themeSetting: SettingType<IPCEventsValuesType['themeSetting']>;
|
||||
waitForChange: () => Promise<void>;
|
||||
|
@ -128,7 +112,7 @@ export const SignalContext: SignalContextType = {
|
|||
getPath: (name: 'userData' | 'home'): string => {
|
||||
return String(config[`${name}Path`]);
|
||||
},
|
||||
i18n: setupI18n(resolvedTranslationsLocale, localeMessages),
|
||||
i18n,
|
||||
localeMessages,
|
||||
log: window.SignalContext.log,
|
||||
nativeThemeListener: createNativeThemeListener(ipcRenderer, window),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue