Context isolation for About, ScreenShare, Preferences
This commit is contained in:
parent
59ca63cd2e
commit
43685d15c6
20 changed files with 234 additions and 321 deletions
31
ts/windows/screenShare/preload.ts
Normal file
31
ts/windows/screenShare/preload.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
|
||||
// It is important to call this as early as possible
|
||||
import '../context';
|
||||
|
||||
import { SignalWindow } from '../configure';
|
||||
import { CallingScreenSharingController } from '../../components/CallingScreenSharingController';
|
||||
|
||||
contextBridge.exposeInMainWorld('SignalWindow', SignalWindow);
|
||||
|
||||
function renderScreenSharingController(presentedSourceName: string): void {
|
||||
ReactDOM.render(
|
||||
React.createElement(CallingScreenSharingController, {
|
||||
i18n: SignalWindow.i18n,
|
||||
onCloseController: () =>
|
||||
ipcRenderer.send('close-screen-share-controller'),
|
||||
onStopSharing: () => ipcRenderer.send('stop-screen-share'),
|
||||
presentedSourceName,
|
||||
}),
|
||||
document.getElementById('app')
|
||||
);
|
||||
}
|
||||
|
||||
ipcRenderer.once('render-screen-sharing-controller', (_, name: string) => {
|
||||
renderScreenSharingController(name);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue