aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/google-voice/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/google-voice/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/google-voice/webview.js')
-rw-r--r--recipes/google-voice/webview.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/recipes/google-voice/webview.js b/recipes/google-voice/webview.js
index 876ec1d..d589f28 100644
--- a/recipes/google-voice/webview.js
+++ b/recipes/google-voice/webview.js
@@ -1,3 +1,9 @@
1function _interopRequireDefault(obj) {
2 return obj && obj.__esModule ? obj : { default: obj };
3}
4
5const _path = _interopRequireDefault(require('path'));
6
1module.exports = Ferdium => { 7module.exports = Ferdium => {
2 function parseQuery(query) { 8 function parseQuery(query) {
3 const el = document.querySelector(query); 9 const el = document.querySelector(query);
@@ -9,22 +15,24 @@ module.exports = Ferdium => {
9 let count; 15 let count;
10 16
11 if (el && el.textContent) { 17 if (el && el.textContent) {
12 count = Ferdium.safeParseInt(el.textContent.replace(/[ ()]/gi, '')); 18 count = Ferdium.safeParseInt(el.textContent.replaceAll(/[ ()]/gi, ''));
13 } else { 19 } else {
14 const count_messages = parseQuery( 20 const countMessages = parseQuery(
15 'gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]', 21 'gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]',
16 ); 22 );
17 const count_calls = parseQuery( 23 const countCalls = parseQuery(
18 'gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]', 24 'gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]',
19 ); 25 );
20 const count_voicemails = parseQuery( 26 const countVoicemails = parseQuery(
21 'gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]', 27 'gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]',
22 ); 28 );
23 count = count_messages + count_calls + count_voicemails; 29 count = countMessages + countCalls + countVoicemails;
24 } 30 }
25 31
26 Ferdium.setBadge(count); 32 Ferdium.setBadge(count);
27 }; 33 };
28 34
29 Ferdium.loop(getMessages); 35 Ferdium.loop(getMessages);
36
37 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
30}; 38};