diff options
author | 2021-12-03 15:36:58 +0530 | |
---|---|---|
committer | 2021-12-03 15:38:19 +0530 | |
commit | 29c34dee285f359be22f3c1edcbbe9ad41d16bd7 (patch) | |
tree | c504da9f1208a5c2bcaad7b48a4d36a40bb79889 /src/webview/recipe.js | |
parent | 5.6.4-nightly.23 [skip ci] (diff) | |
download | ferdium-app-29c34dee285f359be22f3c1edcbbe9ad41d16bd7.tar.gz ferdium-app-29c34dee285f359be22f3c1edcbbe9ad41d16bd7.tar.zst ferdium-app-29c34dee285f359be22f3c1edcbbe9ad41d16bd7.zip |
chore: do not assume that the recipe contains a 'webview.js' file
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r-- | src/webview/recipe.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js index 0b44d1d01..7c069562f 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js | |||
@@ -16,6 +16,7 @@ import { | |||
16 | disable as disableDarkMode, | 16 | disable as disableDarkMode, |
17 | } from 'darkreader'; | 17 | } from 'darkreader'; |
18 | 18 | ||
19 | import { existsSync } from 'fs'; | ||
19 | import ignoreList from './darkmode/ignore'; | 20 | import ignoreList from './darkmode/ignore'; |
20 | import customDarkModeCss from './darkmode/custom'; | 21 | import customDarkModeCss from './darkmode/custom'; |
21 | 22 | ||
@@ -209,9 +210,11 @@ class RecipeController { | |||
209 | notificationsHandler, | 210 | notificationsHandler, |
210 | sessionHandler, | 211 | sessionHandler, |
211 | ); | 212 | ); |
212 | // eslint-disable-next-line import/no-dynamic-require | 213 | if (existsSync(modulePath)) { |
213 | require(modulePath)(this.recipe, { ...config, recipe }); | 214 | // eslint-disable-next-line import/no-dynamic-require |
214 | debug('Initialize Recipe', config, recipe); | 215 | require(modulePath)(this.recipe, { ...config, recipe }); |
216 | debug('Initialize Recipe', config, recipe); | ||
217 | } | ||
215 | 218 | ||
216 | this.settings.service = Object.assign(config, { recipe }); | 219 | this.settings.service = Object.assign(config, { recipe }); |
217 | 220 | ||