diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/frontend_api.md | 8 |
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) |
143 | You 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. | 141 | You 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 | ||
145 | This handler should take the nesessary steps to (de-)activate dark mode on the page, e.g. by clicking a button or flipping a switch. | 143 | This 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 | ||
147 | Ferdi 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. | 145 | Ferdi 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 | |||
153 | 1. `boolean` isEnabled: Is Dark Mode currently enabled? | 151 | 1. `boolean` isEnabled: Is Dark Mode currently enabled? |
154 | 2. `object` helpers: Helper functions that you can use in your function: | 152 | 2. `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 |