aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/lib')
-rw-r--r--src/webview/lib/RecipeWebview.js24
-rw-r--r--src/webview/lib/Userscript.js10
2 files changed, 32 insertions, 2 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js
index f1d493e7c..ebe88ed85 100644
--- a/src/webview/lib/RecipeWebview.js
+++ b/src/webview/lib/RecipeWebview.js
@@ -5,8 +5,14 @@ import { pathExistsSync, readFileSync, existsSync } from 'fs-extra';
5const debug = require('debug')('Ferdi:Plugin:RecipeWebview'); 5const debug = require('debug')('Ferdi:Plugin:RecipeWebview');
6 6
7class RecipeWebview { 7class RecipeWebview {
8 constructor(badgeHandler, notificationsHandler, sessionHandler) { 8 constructor(
9 badgeHandler,
10 dialogTitleHandler,
11 notificationsHandler,
12 sessionHandler,
13 ) {
9 this.badgeHandler = badgeHandler; 14 this.badgeHandler = badgeHandler;
15 this.dialogTitleHandler = dialogTitleHandler;
10 this.notificationsHandler = notificationsHandler; 16 this.notificationsHandler = notificationsHandler;
11 this.sessionHandler = sessionHandler; 17 this.sessionHandler = sessionHandler;
12 18
@@ -59,6 +65,17 @@ class RecipeWebview {
59 } 65 }
60 66
61 /** 67 /**
68 * Set the active dialog title to the app title
69 *
70 * @param {string | undefined | null} title Set the active dialog title
71 * to the app title
72 * eg. WhatsApp contact name
73 */
74 setDialogTitle(title) {
75 this.dialogTitleHandler.setDialogTitle(title);
76 }
77
78 /**
62 * Safely parse the given text into an integer 79 * Safely parse the given text into an integer
63 * 80 *
64 * @param {string | number | undefined | null} text to be parsed 81 * @param {string | number | undefined | null} text to be parsed
@@ -127,7 +144,10 @@ class RecipeWebview {
127 } 144 }
128 145
129 clearStorageData(serviceId, targetsToClear) { 146 clearStorageData(serviceId, targetsToClear) {
130 ipcRenderer.send('clear-storage-data', { serviceId, targetsToClear }); 147 ipcRenderer.send('clear-storage-data', {
148 serviceId,
149 targetsToClear,
150 });
131 } 151 }
132 152
133 releaseServiceWorkers() { 153 releaseServiceWorkers() {
diff --git a/src/webview/lib/Userscript.js b/src/webview/lib/Userscript.js
index bed2b1ff8..f7bb99206 100644
--- a/src/webview/lib/Userscript.js
+++ b/src/webview/lib/Userscript.js
@@ -60,6 +60,16 @@ export default class Userscript {
60 } 60 }
61 61
62 /** 62 /**
63 * Set active dialog title to the app title
64 * @param {*} title Dialog title
65 */
66 setDialogTitle(title) {
67 if (this.recipe && this.recipe.setDialogTitle) {
68 this.recipe.setDialogTitle(title);
69 }
70 }
71
72 /**
63 * Inject CSS files into the current page 73 * Inject CSS files into the current page
64 * 74 *
65 * @param {...string} files 75 * @param {...string} files