aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/google-groups/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/google-groups/webview.js')
-rw-r--r--recipes/google-groups/webview.js19
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 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
6
7module.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};