Enables context isolation for loading window
This commit is contained in:
parent
ccfb9579ad
commit
6c906d5da8
5 changed files with 17 additions and 39 deletions
|
@ -1,19 +1,11 @@
|
|||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { ipcRenderer } from 'electron';
|
||||
import * as url from 'url';
|
||||
import * as i18n from '../../../js/modules/i18n';
|
||||
import { strictAssert } from '../../util/assert';
|
||||
import { contextBridge } from 'electron';
|
||||
|
||||
const config = url.parse(window.location.toString(), true).query;
|
||||
// It is important to call this as early as possible
|
||||
import '../context';
|
||||
|
||||
const { locale } = config;
|
||||
strictAssert(
|
||||
typeof locale === 'string',
|
||||
'Expected to be configured with a string locale'
|
||||
);
|
||||
import { SignalWindow } from '../configure';
|
||||
|
||||
const localeMessages = ipcRenderer.sendSync('locale-data');
|
||||
|
||||
window.i18n = i18n.setup(locale, localeMessages);
|
||||
contextBridge.exposeInMainWorld('SignalWindow', SignalWindow);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue