From 87c6770aba5aee88705c4cf3ea40d31d0d97300d Mon Sep 17 00:00:00 2001 From: Victor B <39555268+victorbnl@users.noreply.github.com> Date: Thu, 27 Apr 2023 23:13:04 +0200 Subject: Add Gather service (#343) --- recipes/gather/icon.svg | 1 + recipes/gather/index.js | 1 + recipes/gather/package.json | 9 +++++++++ recipes/gather/webview.js | 15 +++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 recipes/gather/icon.svg create mode 100644 recipes/gather/index.js create mode 100644 recipes/gather/package.json create mode 100644 recipes/gather/webview.js (limited to 'recipes/gather') diff --git a/recipes/gather/icon.svg b/recipes/gather/icon.svg new file mode 100644 index 0000000..d979ff7 --- /dev/null +++ b/recipes/gather/icon.svg @@ -0,0 +1 @@ + diff --git a/recipes/gather/index.js b/recipes/gather/index.js new file mode 100644 index 0000000..dd41f72 --- /dev/null +++ b/recipes/gather/index.js @@ -0,0 +1 @@ +module.exports = Ferdium => Ferdium; diff --git a/recipes/gather/package.json b/recipes/gather/package.json new file mode 100644 index 0000000..ab59e6b --- /dev/null +++ b/recipes/gather/package.json @@ -0,0 +1,9 @@ +{ + "id": "gather", + "name": "Gather", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://app.gather.town/app" + } +} diff --git a/recipes/gather/webview.js b/recipes/gather/webview.js new file mode 100644 index 0000000..d7d506a --- /dev/null +++ b/recipes/gather/webview.js @@ -0,0 +1,15 @@ +const _path = _interopRequireDefault(require('path')); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +module.exports = Ferdium => { + const getMessages = () => { + const element = document.querySelector("[aria-label='Chat'] > div > div > p"); + Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent) : 0); + } + + Ferdium.loop(getMessages); + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-54-g00ecf