aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-12 08:57:54 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-12 08:57:54 +0530
commit52ca44b9df4dafcdc0eaa517146638e01fca5449 (patch)
tree6df3814408495402b7c9a409f94a634b6e25bd73 /docs
parentchore: fixed issue with incorrect eslint config (diff)
downloadferdium-recipes-52ca44b9df4dafcdc0eaa517146638e01fca5449.tar.gz
ferdium-recipes-52ca44b9df4dafcdc0eaa517146638e01fca5449.tar.zst
ferdium-recipes-52ca44b9df4dafcdc0eaa517146638e01fca5449.zip
Enabled darkmode for
Facebook Messenger Facebook Workplace Chat (Facebook at work) Slack Google Calendar Whatsapp LinkedIn Telegram Instagram (from: https://github.com/ducfilan/Dark-mode-Franz-Ferdi)
Diffstat (limited to 'docs')
-rw-r--r--docs/frontend_api.md8
1 files changed, 3 insertions, 5 deletions
diff --git a/docs/frontend_api.md b/docs/frontend_api.md
index c8e6ba2..59a2467 100644
--- a/docs/frontend_api.md
+++ b/docs/frontend_api.md
@@ -128,21 +128,19 @@ module.exports = (Ferdi) => {
128 Ferdi.loop(getMessages); 128 Ferdi.loop(getMessages);
129 129
130 Ferdi.onNotify(notification => { 130 Ferdi.onNotify(notification => {
131
132 if (typeof notification.title !== 'string') { 131 if (typeof notification.title !== 'string') {
133 notification.title = ((notification.title.props || {}).content || [])[0] || 'Messenger'; 132 notification.title = ((notification.title.props || {}).content || [])[0] || 'Messenger';
134 } 133 }
135 134
136 return notification; 135 return notification;
137
138 }); 136 });
139}; 137};
140``` 138```
141 139
142### handleDarkMode(callback) 140### handleDarkMode(callback)
143You can use a `darkmode.css` to automatically get the service into a dark theme. If your service already supports its own dark mode (e.g. Reddit and YouTube have build-in dark modes) you can use a custom dark mode handler instead. 141You can use a `darkmode.css` to automatically get the service into a dark theme. If your service already supports its own dark mode (e.g. Reddit and YouTube have built-in dark modes), then you can use a custom dark mode handler instead.
144 142
145This handler should take the nesessary steps to (de-)activate dark mode on the page, e.g. by clicking a button or flipping a switch. 143This handler should take the necessary steps to (de-)activate dark mode on the page, e.g. by clicking a button or flipping a switch.
146 144
147Ferdi won't activate DarkReader or inject `darkmode.css` if the recipe has defined a custom handler. If you still need to do this, you can use the `injectDarkModeStyle` or `enableDarkMode` function provided as the second argument. 145Ferdi won't activate DarkReader or inject `darkmode.css` if the recipe has defined a custom handler. If you still need to do this, you can use the `injectDarkModeStyle` or `enableDarkMode` function provided as the second argument.
148 146
@@ -153,9 +151,9 @@ Ferdi won't activate DarkReader or inject `darkmode.css` if the recipe has defin
1531. `boolean` isEnabled: Is Dark Mode currently enabled? 1511. `boolean` isEnabled: Is Dark Mode currently enabled?
1542. `object` helpers: Helper functions that you can use in your function: 1522. `object` helpers: Helper functions that you can use in your function:
155 `enableDarkMode` - Enable DarkReader 153 `enableDarkMode` - Enable DarkReader
154 `disableDarkMode` - Disable DarkReader
156 `injectDarkModeStyle` - Inject darkmode.css 155 `injectDarkModeStyle` - Inject darkmode.css
157 `removeDarkModeStyle` - Remove service's darkmode.css 156 `removeDarkModeStyle` - Remove service's darkmode.css
158 `disableDarkMode` - Disable DarkReader
159 `isDarkModeStyleInjected` - Function that returns true if darkmode.css is injected into the page 157 `isDarkModeStyleInjected` - Function that returns true if darkmode.css is injected into the page
160 158
161#### Usage 159#### Usage