diff options
author | vijay sundharapandiyan <vijaycenation14@gmail.com> | 2022-10-19 07:30:10 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 02:00:10 +0000 |
commit | bebcc2faf76f199bdf0012b4d16ff045d3f55ed1 (patch) | |
tree | 5295fba0abf99fee8c343c7bb06c9c1da9744f0c /recipes/google-groups/webview.js | |
parent | Fix: Unread count stays at 1 when all emails are read (#178) (diff) | |
download | ferdium-recipes-bebcc2faf76f199bdf0012b4d16ff045d3f55ed1.tar.gz ferdium-recipes-bebcc2faf76f199bdf0012b4d16ff045d3f55ed1.tar.zst ferdium-recipes-bebcc2faf76f199bdf0012b4d16ff045d3f55ed1.zip |
Add google groups recipes (#207)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/google-groups/webview.js')
-rw-r--r-- | recipes/google-groups/webview.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes/google-groups/webview.js b/recipes/google-groups/webview.js new file mode 100644 index 0000000..7006eef --- /dev/null +++ b/recipes/google-groups/webview.js | |||
@@ -0,0 +1,19 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | let countImportant = 0; | ||
10 | const unReadConversationCount = document.querySelectorAll('.NHlkZc'); | ||
11 | if (unReadConversationCount.length > 0) { | ||
12 | countImportant = Ferdium.safeParseInt(unReadConversationCount[0].textContent); | ||
13 | } | ||
14 | Ferdium.setBadge(countImportant, 0); | ||
15 | }; | ||
16 | Ferdium.loop(getMessages); | ||
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
19 | }; | ||