aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/lib
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-04-22 15:04:21 -0500
committerLibravatar GitHub <noreply@github.com>2022-04-22 20:04:21 +0000
commit759d93dc198a3cc8c5265245c0144efa5435682b (patch)
tree53e963a085d3d12af5a2efa2f1ab6f3e5574edc7 /src/webview/lib
parentAdded build scripts for linux, macos and windows to help new contributors get... (diff)
downloadferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.gz
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.zst
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.zip
Turn off usage of 'debug' npm package using with electron-16 (fixes #17)
Diffstat (limited to 'src/webview/lib')
-rw-r--r--src/webview/lib/RecipeWebview.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/webview/lib/RecipeWebview.ts b/src/webview/lib/RecipeWebview.ts
index 568c31255..cf70164ef 100644
--- a/src/webview/lib/RecipeWebview.ts
+++ b/src/webview/lib/RecipeWebview.ts
@@ -2,7 +2,8 @@ import { ipcRenderer } from 'electron';
2import { BrowserWindow } from '@electron/remote'; 2import { BrowserWindow } from '@electron/remote';
3import { pathExistsSync, readFileSync, existsSync } from 'fs-extra'; 3import { pathExistsSync, readFileSync, existsSync } from 'fs-extra';
4 4
5const debug = require('debug')('Ferdium:Plugin:RecipeWebview'); 5// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed
6// const debug = require('debug')('Ferdium:Plugin:RecipeWebview');
6 7
7class RecipeWebview { 8class RecipeWebview {
8 badgeHandler: any; 9 badgeHandler: any;
@@ -27,7 +28,7 @@ class RecipeWebview {
27 ipcRenderer.on('poll', () => { 28 ipcRenderer.on('poll', () => {
28 this.loopFunc(); 29 this.loopFunc();
29 30
30 debug('Poll event'); 31 console.log('Poll event');
31 32
32 // This event is for checking if the service recipe is still actively 33 // This event is for checking if the service recipe is still actively
33 // communicating with the client 34 // communicating with the client
@@ -109,7 +110,7 @@ class RecipeWebview {
109 110
110 if (head) { 111 if (head) {
111 head.append(styles); 112 head.append(styles);
112 debug('Append styles', styles); 113 console.log('Append styles', styles);
113 } 114 }
114 } 115 }
115 }); 116 });
@@ -121,13 +122,13 @@ class RecipeWebview {
121 if (existsSync(file)) { 122 if (existsSync(file)) {
122 return readFileSync(file, 'utf8'); 123 return readFileSync(file, 'utf8');
123 } 124 }
124 debug('Script not found', file); 125 console.log('Script not found', file);
125 return null; 126 return null;
126 }), 127 }),
127 ).then(scripts => { 128 ).then(scripts => {
128 const scriptsFound = scripts.filter(script => script !== null); 129 const scriptsFound = scripts.filter(script => script !== null);
129 if (scriptsFound.length > 0) { 130 if (scriptsFound.length > 0) {
130 debug('Inject scripts to main world', scriptsFound); 131 console.log('Inject scripts to main world', scriptsFound);
131 ipcRenderer.sendToHost('inject-js-unsafe', ...scriptsFound); 132 ipcRenderer.sendToHost('inject-js-unsafe', ...scriptsFound);
132 } 133 }
133 }); 134 });