diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-09-05 17:59:28 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-05 17:59:28 +0530 |
commit | c40e50274ec326d29d3373fa3b346b1f29cf8b95 (patch) | |
tree | 1a652c89551c2120eec57c2d7e7e19bd3c86ed83 /src/webview/recipe.js | |
parent | docs: Updated CHANGELOG.md [skip ci] (diff) | |
download | ferdium-app-c40e50274ec326d29d3373fa3b346b1f29cf8b95.tar.gz ferdium-app-c40e50274ec326d29d3373fa3b346b1f29cf8b95.tar.zst ferdium-app-c40e50274ec326d29d3373fa3b346b1f29cf8b95.zip |
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'
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r-- | src/webview/recipe.js | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ | |||
1 | /* eslint-disable import/first */ | 1 | /* eslint-disable import/first */ |
2 | import { contextBridge, ipcRenderer } from 'electron'; | 2 | import { contextBridge, desktopCapturer, ipcRenderer } from 'electron'; |
3 | import { BrowserWindow, getCurrentWebContents } from '@electron/remote'; | ||
3 | import { join } from 'path'; | 4 | import { join } from 'path'; |
4 | import { autorun, computed, observable } from 'mobx'; | 5 | import { autorun, computed, observable } from 'mobx'; |
5 | import { pathExistsSync, readFileSync } from 'fs-extra'; | 6 | import { pathExistsSync, readFileSync } from 'fs-extra'; |
@@ -107,6 +108,11 @@ contextBridge.exposeInMainWorld('ferdi', { | |||
107 | displayNotification: (title, options) => | 108 | displayNotification: (title, options) => |
108 | notificationsHandler.displayNotification(title, options), | 109 | notificationsHandler.displayNotification(title, options), |
109 | getDisplayMediaSelector, | 110 | getDisplayMediaSelector, |
111 | getCurrentWebContents, | ||
112 | BrowserWindow, | ||
113 | ipcRenderer, | ||
114 | // TODO: When the discord recipe is changed to use the screenshare.js, this can be removed | ||
115 | desktopCapturer, | ||
110 | }); | 116 | }); |
111 | 117 | ||
112 | ipcRenderer.sendToHost( | 118 | ipcRenderer.sendToHost( |