From bebcc2faf76f199bdf0012b4d16ff045d3f55ed1 Mon Sep 17 00:00:00 2001 From: vijay sundharapandiyan Date: Wed, 19 Oct 2022 07:30:10 +0530 Subject: Add google groups recipes (#207) Co-authored-by: Vijay A --- recipes/google-groups/icon.svg | 1 + recipes/google-groups/index.js | 1 + recipes/google-groups/package.json | 9 +++++++++ recipes/google-groups/webview.js | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 recipes/google-groups/icon.svg create mode 100644 recipes/google-groups/index.js create mode 100644 recipes/google-groups/package.json create mode 100644 recipes/google-groups/webview.js (limited to 'recipes') diff --git a/recipes/google-groups/icon.svg b/recipes/google-groups/icon.svg new file mode 100644 index 0000000..553c8ab --- /dev/null +++ b/recipes/google-groups/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/google-groups/index.js b/recipes/google-groups/index.js new file mode 100644 index 0000000..dd41f72 --- /dev/null +++ b/recipes/google-groups/index.js @@ -0,0 +1 @@ +module.exports = Ferdium => Ferdium; diff --git a/recipes/google-groups/package.json b/recipes/google-groups/package.json new file mode 100644 index 0000000..7628fbf --- /dev/null +++ b/recipes/google-groups/package.json @@ -0,0 +1,9 @@ +{ + "id": "google-groups", + "name": "Google Groups", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://groups.google.com" + } +} 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 @@ +const _path = _interopRequireDefault(require('path')); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +module.exports = Ferdium => { + const getMessages = () => { + let countImportant = 0; + const unReadConversationCount = document.querySelectorAll('.NHlkZc'); + if (unReadConversationCount.length > 0) { + countImportant = Ferdium.safeParseInt(unReadConversationCount[0].textContent); + } + Ferdium.setBadge(countImportant, 0); + }; + Ferdium.loop(getMessages); + + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-54-g00ecf