aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/recipe.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r--src/webview/recipe.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index d7032da3f..32df0f756 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -1,7 +1,6 @@
1/* eslint-disable global-require */ 1/* eslint-disable global-require */
2/* eslint-disable import/first */ 2/* eslint-disable import/first */
3import { contextBridge, desktopCapturer, ipcRenderer } from 'electron'; 3import { contextBridge, ipcRenderer } from 'electron';
4import { BrowserWindow, getCurrentWebContents } from '@electron/remote';
5import { join } from 'path'; 4import { join } from 'path';
6import { autorun, computed, observable } from 'mobx'; 5import { autorun, computed, observable } from 'mobx';
7import { pathExistsSync, readFileSync } from 'fs-extra'; 6import { pathExistsSync, readFileSync } from 'fs-extra';
@@ -109,15 +108,8 @@ contextBridge.exposeInMainWorld('ferdi', {
109 safeParseInt: text => badgeHandler.safeParseInt(text), 108 safeParseInt: text => badgeHandler.safeParseInt(text),
110 displayNotification: (title, options) => 109 displayNotification: (title, options) =>
111 notificationsHandler.displayNotification(title, options), 110 notificationsHandler.displayNotification(title, options),
112 clearStorageData: storageLocations =>
113 sessionHandler.clearStorageData(storageLocations),
114 releaseServiceWorkers: () => sessionHandler.releaseServiceWorkers(), 111 releaseServiceWorkers: () => sessionHandler.releaseServiceWorkers(),
115 getDisplayMediaSelector, 112 getDisplayMediaSelector,
116 getCurrentWebContents,
117 BrowserWindow,
118 ipcRenderer,
119 // TODO: When the discord recipe is changed to use the screenshare.js, this can be removed
120 desktopCapturer,
121}); 113});
122 114
123ipcRenderer.sendToHost( 115ipcRenderer.sendToHost(
@@ -207,7 +199,11 @@ class RecipeController {
207 // Delete module from cache 199 // Delete module from cache
208 delete require.cache[require.resolve(modulePath)]; 200 delete require.cache[require.resolve(modulePath)];
209 try { 201 try {
210 this.recipe = new RecipeWebview(badgeHandler, notificationsHandler); 202 this.recipe = new RecipeWebview(
203 badgeHandler,
204 notificationsHandler,
205 sessionHandler,
206 );
211 // eslint-disable-next-line import/no-dynamic-require 207 // eslint-disable-next-line import/no-dynamic-require
212 require(modulePath)(this.recipe, { ...config, recipe }); 208 require(modulePath)(this.recipe, { ...config, recipe });
213 debug('Initialize Recipe', config, recipe); 209 debug('Initialize Recipe', config, recipe);