From a40f9e8eb9e536d554b699f2dc428cc532cbc6f6 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Tue, 21 Sep 2021 02:17:28 +0530 Subject: remove reference to '@electron/remote' module (for spell-checker) (#1968) * fix: remove reference to '@electron/remote' module for spell-checker * chore: removed redundant methods from being exposed via 'window.ferdi' to the recipes --- src/webview/recipe.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/webview/recipe.js') diff --git a/src/webview/recipe.js b/src/webview/recipe.js index 32df0f756..892b08e54 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js @@ -100,7 +100,7 @@ window.open = (url, frameName, features) => { } }; -// We can't override APIs here, so we first expose functions via window.ferdi, +// We can't override APIs here, so we first expose functions via 'window.ferdi', // then overwrite the corresponding field of the window object by injected JS. contextBridge.exposeInMainWorld('ferdi', { open: window.open, @@ -108,7 +108,6 @@ contextBridge.exposeInMainWorld('ferdi', { safeParseInt: text => badgeHandler.safeParseInt(text), displayNotification: (title, options) => notificationsHandler.displayNotification(title, options), - releaseServiceWorkers: () => sessionHandler.releaseServiceWorkers(), getDisplayMediaSelector, }); @@ -275,8 +274,8 @@ class RecipeController { } if (this.settings.app.enableSpellchecking) { - debug('Setting spellchecker language to', this.spellcheckerLanguage); let { spellcheckerLanguage } = this; + debug(`Setting spellchecker language to ${spellcheckerLanguage}`); if (spellcheckerLanguage.includes('automatic')) { this.automaticLanguageDetection(); debug( @@ -285,7 +284,7 @@ class RecipeController { ); spellcheckerLanguage = this.settings.app.locale; } - switchDict(spellcheckerLanguage); + switchDict(spellcheckerLanguage, this.settings.service.id); } else { debug('Disable spellchecker'); } @@ -440,7 +439,7 @@ class RecipeController { spellcheckerLocale, ); if (spellcheckerLocale) { - switchDict(spellcheckerLocale); + switchDict(spellcheckerLocale, this.settings.service.id); } }, 225), ); -- cgit v1.2.3-70-g09d2