diff options
author | 2019-10-25 10:43:33 +0200 | |
---|---|---|
committer | 2019-10-25 10:43:33 +0200 | |
commit | 25d1d5b7a12f911be3e5e71667878618bd1569c8 (patch) | |
tree | 4db8260319411f39858cf566b131a334ff471498 /src/webview/recipe.js | |
parent | Merge pull request #155 from getferdi/l10n_develop (diff) | |
download | ferdium-app-25d1d5b7a12f911be3e5e71667878618bd1569c8.tar.gz ferdium-app-25d1d5b7a12f911be3e5e71667878618bd1569c8.tar.zst ferdium-app-25d1d5b7a12f911be3e5e71667878618bd1569c8.zip |
Add debug statements to help #158
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r-- | src/webview/recipe.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js index 2bf8f757a..4c5eebc83 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js | |||
@@ -120,6 +120,7 @@ class RecipeController { | |||
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | console.log('Set theme to: ', this.settings.service.isDarkModeEnabled ? 'Dark' : 'Light'); | ||
123 | if (this.settings.service.isDarkModeEnabled) { | 124 | if (this.settings.service.isDarkModeEnabled) { |
124 | debug('Enable dark mode'); | 125 | debug('Enable dark mode'); |
125 | 126 | ||
@@ -127,9 +128,18 @@ class RecipeController { | |||
127 | const darkModeStyle = path.join(this.settings.service.recipe.path, 'darkmode.css'); | 128 | const darkModeStyle = path.join(this.settings.service.recipe.path, 'darkmode.css'); |
128 | const darkModeExists = fs.pathExistsSync(darkModeStyle); | 129 | const darkModeExists = fs.pathExistsSync(darkModeStyle); |
129 | 130 | ||
131 | console.log('darkmode.css exists? ', darkModeExists ? 'Yes': 'No'); | ||
132 | |||
130 | if (darkModeExists) { | 133 | if (darkModeExists) { |
134 | console.log('Injecting darkmode.css'); | ||
131 | injectDarkModeStyle(this.settings.service.recipe.path); | 135 | injectDarkModeStyle(this.settings.service.recipe.path); |
136 | |||
137 | // Make sure universal dark mode is disabled | ||
138 | disableDarkMode(); | ||
139 | this.universalDarkModeInjected = false; | ||
132 | } else if (this.settings.app.universalDarkMode && !ignoreList.includes(window.location.host)) { | 140 | } else if (this.settings.app.universalDarkMode && !ignoreList.includes(window.location.host)) { |
141 | console.log('Injecting DarkReader'); | ||
142 | |||
133 | // Use darkreader instead | 143 | // Use darkreader instead |
134 | enableDarkMode({}, { | 144 | enableDarkMode({}, { |
135 | css: customDarkModeCss[window.location.host] || '', | 145 | css: customDarkModeCss[window.location.host] || '', |
@@ -138,10 +148,14 @@ class RecipeController { | |||
138 | } | 148 | } |
139 | } else { | 149 | } else { |
140 | debug('Remove dark mode'); | 150 | debug('Remove dark mode'); |
151 | console.log('DarkMode disabled - removing remaining styles'); | ||
141 | 152 | ||
142 | if (isDarkModeStyleInjected()) { | 153 | if (isDarkModeStyleInjected()) { |
154 | console.log('Removing injected darkmode.css'); | ||
143 | removeDarkModeStyle(); | 155 | removeDarkModeStyle(); |
144 | } else { | 156 | } else { |
157 | console.log('Removing DarkReader'); | ||
158 | |||
145 | disableDarkMode(); | 159 | disableDarkMode(); |
146 | this.universalDarkModeInjected = false; | 160 | this.universalDarkModeInjected = false; |
147 | } | 161 | } |