aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/googlemeet/webview.js
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-07-26 06:29:03 -0600
committerLibravatar GitHub <noreply@github.com>2023-07-26 17:59:03 +0530
commit9b8f01716774a960073e944823ab727cc867a8f6 (patch)
tree732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/googlemeet/webview.js
parentAdd Excalidraw recipe (#393) (diff)
downloadferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.gz
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.zst
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.zip
chore: improve lint setup (#397)
- update eslint config to closely mirror the ones from ferdium-app - add .eslintignore - opt in to eslint `reportUnusedDisableDirectives` config option - remove `trailingComma: all` from `prettier` config which is default in `prettier` v3 - autofix or disable a lot of lint issues throughout codebase - add `volta` configuration to `package.json` to autoload correct `node` and `pnpm` versions - upgrade all `eslint` and `prettier` related dependencies to latest - update lint:fix npm script - reformat touched files with prettier - bumped up minor version for all recipes that have changes - introduced injection of 'service.css' where it was missing in many recipes --------- Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/googlemeet/webview.js')
-rw-r--r--recipes/googlemeet/webview.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/recipes/googlemeet/webview.js b/recipes/googlemeet/webview.js
deleted file mode 100644
index f3c0f46..0000000
--- a/recipes/googlemeet/webview.js
+++ /dev/null
@@ -1,36 +0,0 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
6
7window.addEventListener('load', () => {
8 const title = document.querySelector('.window-title').textContent;
9
10 if (title && title.includes('Google Chrome 36+')) {
11 window.location.reload();
12 }
13});
14
15module.exports = (Ferdium, settings) => {
16 const getMessages = () => {
17 const elements = document.querySelectorAll('.CxUIE, .unread');
18 let count = 0;
19
20 for (const element of elements) {
21 if (element.querySelectorAll('*[data-icon="muted"]').length === 0) {
22 count += 1;
23 }
24 }
25
26 Ferdium.setBadge(count);
27 };
28
29 Ferdium.loop(getMessages);
30
31 window.addEventListener('beforeunload', async () => {
32 Ferdium.clearStorageData(settings.id, { storages: ['serviceworkers'] });
33 });
34
35 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
36};