aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/lib/RecipeWebview.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/lib/RecipeWebview.js')
-rw-r--r--src/webview/lib/RecipeWebview.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js
index 4085b925b..a4951ed69 100644
--- a/src/webview/lib/RecipeWebview.js
+++ b/src/webview/lib/RecipeWebview.js
@@ -1,12 +1,14 @@
1import { ipcRenderer } from 'electron'; 1import { ipcRenderer } from 'electron';
2import { BrowserWindow, desktopCapturer, getCurrentWebContents } from '@electron/remote';
2import { pathExistsSync, readFileSync, existsSync } from 'fs-extra'; 3import { pathExistsSync, readFileSync, existsSync } from 'fs-extra';
3 4
4const debug = require('debug')('Ferdi:Plugin:RecipeWebview'); 5const debug = require('debug')('Ferdi:Plugin:RecipeWebview');
5 6
6class RecipeWebview { 7class RecipeWebview {
7 constructor(badgeHandler, notificationsHandler) { 8 constructor(badgeHandler, notificationsHandler, sessionHandler) {
8 this.badgeHandler = badgeHandler; 9 this.badgeHandler = badgeHandler;
9 this.notificationsHandler = notificationsHandler; 10 this.notificationsHandler = notificationsHandler;
11 this.sessionHandler = sessionHandler;
10 12
11 ipcRenderer.on('poll', () => { 13 ipcRenderer.on('poll', () => {
12 this.loopFunc(); 14 this.loopFunc();
@@ -23,6 +25,26 @@ class RecipeWebview {
23 25
24 darkModeHandler = false; 26 darkModeHandler = false;
25 27
28 // TODO Remove this once we implement a proper wrapper.
29 get ipcRenderer() {
30 return ipcRenderer;
31 }
32
33 // TODO Remove this once we implement a proper wrapper.
34 get desktopCapturer() {
35 return desktopCapturer;
36 }
37
38 // TODO Remove this once we implement a proper wrapper.
39 get BrowserWindow() {
40 return BrowserWindow;
41 }
42
43 // TODO Remove this once we implement a proper wrapper.
44 get getCurrentWebContents() {
45 return getCurrentWebContents;
46 }
47
26 /** 48 /**
27 * Initialize the loop 49 * Initialize the loop
28 * 50 *
@@ -113,6 +135,14 @@ class RecipeWebview {
113 fn(); 135 fn();
114 } 136 }
115 } 137 }
138
139 clearStorageData(storageLocations) {
140 this.sessionHandler.clearStorageData(storageLocations);
141 }
142
143 releaseServiceWorkers() {
144 this.sessionHandler.releaseServiceWorkers();
145 }
116} 146}
117 147
118export default RecipeWebview; 148export default RecipeWebview;