From c40e50274ec326d29d3373fa3b346b1f29cf8b95 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Sun, 5 Sep 2021 17:59:28 +0530 Subject: Expose some functions to the recipe child processes (#1869) * chore: expose some functions to the recipe child processes so as to bypass the need for the recipe to require '@electron/remote' --- src/webview/recipe.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/webview/recipe.js') diff --git a/src/webview/recipe.js b/src/webview/recipe.js index 1981c8731..10fdbe606 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js @@ -1,5 +1,6 @@ /* eslint-disable import/first */ -import { contextBridge, ipcRenderer } from 'electron'; +import { contextBridge, desktopCapturer, ipcRenderer } from 'electron'; +import { BrowserWindow, getCurrentWebContents } from '@electron/remote'; import { join } from 'path'; import { autorun, computed, observable } from 'mobx'; import { pathExistsSync, readFileSync } from 'fs-extra'; @@ -107,6 +108,11 @@ contextBridge.exposeInMainWorld('ferdi', { displayNotification: (title, options) => notificationsHandler.displayNotification(title, options), getDisplayMediaSelector, + getCurrentWebContents, + BrowserWindow, + ipcRenderer, + // TODO: When the discord recipe is changed to use the screenshare.js, this can be removed + desktopCapturer, }); ipcRenderer.sendToHost( -- cgit v1.2.3-54-g00ecf