diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-26 06:29:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 17:59:03 +0530 |
commit | 9b8f01716774a960073e944823ab727cc867a8f6 (patch) | |
tree | 732b83770baa78f5cf12776aaa33ce65bebfa418 | |
parent | Add Excalidraw recipe (#393) (diff) | |
download | ferdium-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>
709 files changed, 3422 insertions, 1915 deletions
diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..269424f --- /dev/null +++ b/.eslintignore | |||
@@ -0,0 +1,4 @@ | |||
1 | .devcontainer | ||
2 | .github | ||
3 | .husky | ||
4 | node_modules | ||
diff --git a/.eslintrc.js b/.eslintrc.js index 25e75f3..7c1f725 100644 --- a/.eslintrc.js +++ b/.eslintrc.js | |||
@@ -11,8 +11,23 @@ module.exports = { | |||
11 | jquery: true, | 11 | jquery: true, |
12 | }, | 12 | }, |
13 | extends: ['eslint:recommended', 'plugin:unicorn/recommended'], | 13 | extends: ['eslint:recommended', 'plugin:unicorn/recommended'], |
14 | reportUnusedDisableDirectives: true, | ||
14 | rules: { | 15 | rules: { |
15 | // eslint-plugin-unicorn | 16 | // eslint |
17 | 'array-callback-return': 1, | ||
18 | 'consistent-return': 1, | ||
19 | 'no-await-in-loop': 1, | ||
20 | 'no-return-assign': 1, | ||
21 | 'no-console': [ | ||
22 | 1, | ||
23 | { | ||
24 | allow: ['warn', 'error'], | ||
25 | }, | ||
26 | ], | ||
27 | 'no-param-reassign': 1, | ||
28 | 'prefer-destructuring': 0, | ||
29 | // eslint-plugin-unicorn | ||
30 | 'unicorn/filename-case': 0, | ||
16 | 'unicorn/no-null': 0, | 31 | 'unicorn/no-null': 0, |
17 | 'unicorn/no-useless-undefined': 0, | 32 | 'unicorn/no-useless-undefined': 0, |
18 | 'unicorn/prefer-module': 0, | 33 | 'unicorn/prefer-module': 0, |
@@ -31,5 +46,7 @@ module.exports = { | |||
31 | 'unicorn/consistent-destructuring': 0, | 46 | 'unicorn/consistent-destructuring': 0, |
32 | 'unicorn/no-array-reduce': 0, | 47 | 'unicorn/no-array-reduce': 0, |
33 | 'unicorn/no-nested-ternary': 0, | 48 | 'unicorn/no-nested-ternary': 0, |
49 | 'unicorn/prefer-top-level-await': 0, | ||
50 | 'unicorn/prefer-string-replace-all': 0, | ||
34 | }, | 51 | }, |
35 | }; | 52 | }; |
diff --git a/.prettierrc.js b/.prettierrc.js index 6a0a094..dd8e1aa 100644 --- a/.prettierrc.js +++ b/.prettierrc.js | |||
@@ -1,5 +1,4 @@ | |||
1 | module.exports = { | 1 | module.exports = { |
2 | singleQuote: true, | 2 | singleQuote: true, |
3 | arrowParens: 'avoid', | 3 | arrowParens: 'avoid', |
4 | trailingComma: 'all', | ||
5 | }; | 4 | }; |
diff --git a/package.json b/package.json index 0f7be5f..d310ebd 100644 --- a/package.json +++ b/package.json | |||
@@ -5,6 +5,11 @@ | |||
5 | "doc": "docs" | 5 | "doc": "docs" |
6 | }, | 6 | }, |
7 | "engines": { | 7 | "engines": { |
8 | "node": "18.15.0", | ||
9 | "pnpm": "8.6.2" | ||
10 | }, | ||
11 | "volta": { | ||
12 | "node": "18.15.0", | ||
8 | "pnpm": "8.6.2" | 13 | "pnpm": "8.6.2" |
9 | }, | 14 | }, |
10 | "scripts": { | 15 | "scripts": { |
@@ -13,7 +18,7 @@ | |||
13 | "package": "node scripts/package.js", | 18 | "package": "node scripts/package.js", |
14 | "create": "node scripts/create.js", | 19 | "create": "node scripts/create.js", |
15 | "lint": "eslint \"{recipes,scripts}/**/*.{js,jsx,ts,tsx}\"", | 20 | "lint": "eslint \"{recipes,scripts}/**/*.{js,jsx,ts,tsx}\"", |
16 | "lint:fix": "eslint --fix \"{recipes,scripts}/**/*.{js,jsx,ts,tsx}\"", | 21 | "lint:fix": "pnpm lint --fix", |
17 | "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,json,scss}\"", | 22 | "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,json,scss}\"", |
18 | "contributors": "all-contributors" | 23 | "contributors": "all-contributors" |
19 | }, | 24 | }, |
@@ -34,14 +39,14 @@ | |||
34 | "devDependencies": { | 39 | "devDependencies": { |
35 | "@types/targz": "1.0.1", | 40 | "@types/targz": "1.0.1", |
36 | "all-contributors-cli": "6.26.0", | 41 | "all-contributors-cli": "6.26.0", |
37 | "eslint": "8.39.0", | 42 | "eslint": "8.45.0", |
38 | "eslint-plugin-unicorn": "42.0.0", | 43 | "eslint-plugin-unicorn": "48.0.0", |
39 | "fs-extra": "11.1.1", | 44 | "fs-extra": "11.1.1", |
40 | "husky": "8.0.3", | 45 | "husky": "8.0.3", |
41 | "image-size": "1.0.2", | 46 | "image-size": "1.0.2", |
42 | "is-ci": "3.0.1", | 47 | "is-ci": "3.0.1", |
43 | "open": "8.4.1", | 48 | "open": "8.4.1", |
44 | "prettier": "2.8.8", | 49 | "prettier": "3.0.0", |
45 | "simple-git": "3.19.0", | 50 | "simple-git": "3.19.0", |
46 | "targz": "1.0.1" | 51 | "targz": "1.0.1" |
47 | } | 52 | } |
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e37d28a..3fe2762 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml | |||
@@ -15,11 +15,11 @@ importers: | |||
15 | specifier: 6.26.0 | 15 | specifier: 6.26.0 |
16 | version: 6.26.0 | 16 | version: 6.26.0 |
17 | eslint: | 17 | eslint: |
18 | specifier: 8.39.0 | 18 | specifier: 8.45.0 |
19 | version: 8.39.0 | 19 | version: 8.45.0 |
20 | eslint-plugin-unicorn: | 20 | eslint-plugin-unicorn: |
21 | specifier: 42.0.0 | 21 | specifier: 48.0.0 |
22 | version: 42.0.0(eslint@8.39.0) | 22 | version: 48.0.0(eslint@8.45.0) |
23 | fs-extra: | 23 | fs-extra: |
24 | specifier: 11.1.1 | 24 | specifier: 11.1.1 |
25 | version: 11.1.1 | 25 | version: 11.1.1 |
@@ -36,8 +36,8 @@ importers: | |||
36 | specifier: 8.4.1 | 36 | specifier: 8.4.1 |
37 | version: 8.4.1 | 37 | version: 8.4.1 |
38 | prettier: | 38 | prettier: |
39 | specifier: 2.8.8 | 39 | specifier: 3.0.0 |
40 | version: 2.8.8 | 40 | version: 3.0.0 |
41 | simple-git: | 41 | simple-git: |
42 | specifier: 3.19.0 | 42 | specifier: 3.19.0 |
43 | version: 3.19.0 | 43 | version: 3.19.0 |
@@ -75,6 +75,8 @@ importers: | |||
75 | 75 | ||
76 | recipes/azure-devops: {} | 76 | recipes/azure-devops: {} |
77 | 77 | ||
78 | recipes/bard: {} | ||
79 | |||
78 | recipes/basecamp: {} | 80 | recipes/basecamp: {} |
79 | 81 | ||
80 | recipes/bigbluebutton: {} | 82 | recipes/bigbluebutton: {} |
@@ -93,6 +95,8 @@ importers: | |||
93 | 95 | ||
94 | recipes/brax.me: {} | 96 | recipes/brax.me: {} |
95 | 97 | ||
98 | recipes/bring: {} | ||
99 | |||
96 | recipes/buffer: {} | 100 | recipes/buffer: {} |
97 | 101 | ||
98 | recipes/bugzilla: {} | 102 | recipes/bugzilla: {} |
@@ -171,6 +175,8 @@ importers: | |||
171 | 175 | ||
172 | recipes/evernote: {} | 176 | recipes/evernote: {} |
173 | 177 | ||
178 | recipes/excalidraw: {} | ||
179 | |||
174 | recipes/facebook: {} | 180 | recipes/facebook: {} |
175 | 181 | ||
176 | recipes/facebookpages: {} | 182 | recipes/facebookpages: {} |
@@ -219,16 +225,28 @@ importers: | |||
219 | 225 | ||
220 | recipes/good-reads: {} | 226 | recipes/good-reads: {} |
221 | 227 | ||
228 | recipes/google-calendar: {} | ||
229 | |||
230 | recipes/google-classroom: {} | ||
231 | |||
222 | recipes/google-contacts: {} | 232 | recipes/google-contacts: {} |
223 | 233 | ||
224 | recipes/google-docs: {} | 234 | recipes/google-docs: {} |
225 | 235 | ||
236 | recipes/google-drive: {} | ||
237 | |||
226 | recipes/google-duo: {} | 238 | recipes/google-duo: {} |
227 | 239 | ||
228 | recipes/google-groups: {} | 240 | recipes/google-groups: {} |
229 | 241 | ||
242 | recipes/google-keep: {} | ||
243 | |||
244 | recipes/google-meet: {} | ||
245 | |||
230 | recipes/google-news: {} | 246 | recipes/google-news: {} |
231 | 247 | ||
248 | recipes/google-podcasts: {} | ||
249 | |||
232 | recipes/google-presentation: {} | 250 | recipes/google-presentation: {} |
233 | 251 | ||
234 | recipes/google-spreadsheets: {} | 252 | recipes/google-spreadsheets: {} |
@@ -237,18 +255,6 @@ importers: | |||
237 | 255 | ||
238 | recipes/google-voice: {} | 256 | recipes/google-voice: {} |
239 | 257 | ||
240 | recipes/googlecalendar: {} | ||
241 | |||
242 | recipes/googleclassroom: {} | ||
243 | |||
244 | recipes/googledrive: {} | ||
245 | |||
246 | recipes/googlekeep: {} | ||
247 | |||
248 | recipes/googlemeet: {} | ||
249 | |||
250 | recipes/googlepodcasts: {} | ||
251 | |||
252 | recipes/gotify: {} | 258 | recipes/gotify: {} |
253 | 259 | ||
254 | recipes/goto: {} | 260 | recipes/goto: {} |
@@ -359,6 +365,8 @@ importers: | |||
359 | 365 | ||
360 | recipes/mewe: {} | 366 | recipes/mewe: {} |
361 | 367 | ||
368 | recipes/miro: {} | ||
369 | |||
362 | recipes/mirotalk-bro: {} | 370 | recipes/mirotalk-bro: {} |
363 | 371 | ||
364 | recipes/mirotalk-c2c: {} | 372 | recipes/mirotalk-c2c: {} |
@@ -429,6 +437,8 @@ importers: | |||
429 | 437 | ||
430 | recipes/paymo: {} | 438 | recipes/paymo: {} |
431 | 439 | ||
440 | recipes/perplexity: {} | ||
441 | |||
432 | recipes/pinterest: {} | 442 | recipes/pinterest: {} |
433 | 443 | ||
434 | recipes/pipefy: {} | 444 | recipes/pipefy: {} |
@@ -437,6 +447,8 @@ importers: | |||
437 | 447 | ||
438 | recipes/pixelfed: {} | 448 | recipes/pixelfed: {} |
439 | 449 | ||
450 | recipes/pixieset: {} | ||
451 | |||
440 | recipes/plan: {} | 452 | recipes/plan: {} |
441 | 453 | ||
442 | recipes/planitpoker: {} | 454 | recipes/planitpoker: {} |
@@ -459,15 +471,15 @@ importers: | |||
459 | 471 | ||
460 | recipes/producthunt: {} | 472 | recipes/producthunt: {} |
461 | 473 | ||
462 | recipes/proton-mail: {} | 474 | recipes/proton-calendar: {} |
463 | 475 | ||
464 | recipes/protoncalendar: {} | 476 | recipes/proton-drive: {} |
465 | 477 | ||
466 | recipes/protondrive: {} | 478 | recipes/proton-mail: {} |
467 | 479 | ||
468 | recipes/protonet: {} | 480 | recipes/protonet: {} |
469 | 481 | ||
470 | recipes/pulsesms: {} | 482 | recipes/pulse-sms: {} |
471 | 483 | ||
472 | recipes/pushbullet: {} | 484 | recipes/pushbullet: {} |
473 | 485 | ||
@@ -479,9 +491,9 @@ importers: | |||
479 | 491 | ||
480 | recipes/reddit: {} | 492 | recipes/reddit: {} |
481 | 493 | ||
482 | recipes/redditchat: {} | 494 | recipes/reddit-chat: {} |
483 | 495 | ||
484 | recipes/ringcentral: {} | 496 | recipes/ring-central: {} |
485 | 497 | ||
486 | recipes/riseup: {} | 498 | recipes/riseup: {} |
487 | 499 | ||
@@ -503,6 +515,8 @@ importers: | |||
503 | 515 | ||
504 | recipes/simplenote: {} | 516 | recipes/simplenote: {} |
505 | 517 | ||
518 | recipes/skiff-mail: {} | ||
519 | |||
506 | recipes/skype: {} | 520 | recipes/skype: {} |
507 | 521 | ||
508 | recipes/slack: {} | 522 | recipes/slack: {} |
@@ -653,23 +667,28 @@ importers: | |||
653 | 667 | ||
654 | packages: | 668 | packages: |
655 | 669 | ||
656 | /@babel/code-frame@7.16.7: | 670 | /@aashutoshrathi/word-wrap@1.2.6: |
657 | resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==} | 671 | resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} |
672 | engines: {node: '>=0.10.0'} | ||
673 | dev: true | ||
674 | |||
675 | /@babel/code-frame@7.22.5: | ||
676 | resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} | ||
658 | engines: {node: '>=6.9.0'} | 677 | engines: {node: '>=6.9.0'} |
659 | dependencies: | 678 | dependencies: |
660 | '@babel/highlight': 7.17.12 | 679 | '@babel/highlight': 7.22.5 |
661 | dev: true | 680 | dev: true |
662 | 681 | ||
663 | /@babel/helper-validator-identifier@7.16.7: | 682 | /@babel/helper-validator-identifier@7.22.5: |
664 | resolution: {integrity: sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==} | 683 | resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} |
665 | engines: {node: '>=6.9.0'} | 684 | engines: {node: '>=6.9.0'} |
666 | dev: true | 685 | dev: true |
667 | 686 | ||
668 | /@babel/highlight@7.17.12: | 687 | /@babel/highlight@7.22.5: |
669 | resolution: {integrity: sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==} | 688 | resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} |
670 | engines: {node: '>=6.9.0'} | 689 | engines: {node: '>=6.9.0'} |
671 | dependencies: | 690 | dependencies: |
672 | '@babel/helper-validator-identifier': 7.16.7 | 691 | '@babel/helper-validator-identifier': 7.22.5 |
673 | chalk: 2.4.2 | 692 | chalk: 2.4.2 |
674 | js-tokens: 4.0.0 | 693 | js-tokens: 4.0.0 |
675 | dev: true | 694 | dev: true |
@@ -681,28 +700,28 @@ packages: | |||
681 | regenerator-runtime: 0.13.11 | 700 | regenerator-runtime: 0.13.11 |
682 | dev: true | 701 | dev: true |
683 | 702 | ||
684 | /@eslint-community/eslint-utils@4.4.0(eslint@8.39.0): | 703 | /@eslint-community/eslint-utils@4.4.0(eslint@8.45.0): |
685 | resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} | 704 | resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} |
686 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 705 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
687 | peerDependencies: | 706 | peerDependencies: |
688 | eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 | 707 | eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 |
689 | dependencies: | 708 | dependencies: |
690 | eslint: 8.39.0 | 709 | eslint: 8.45.0 |
691 | eslint-visitor-keys: 3.4.1 | 710 | eslint-visitor-keys: 3.4.1 |
692 | dev: true | 711 | dev: true |
693 | 712 | ||
694 | /@eslint-community/regexpp@4.5.1: | 713 | /@eslint-community/regexpp@4.6.1: |
695 | resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} | 714 | resolution: {integrity: sha512-O7x6dMstWLn2ktjcoiNLDkAGG2EjveHL+Vvc+n0fXumkJYAcSqcVYKtwDU+hDZ0uDUsnUagSYaZrOLAYE8un1A==} |
696 | engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} | 715 | engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} |
697 | dev: true | 716 | dev: true |
698 | 717 | ||
699 | /@eslint/eslintrc@2.0.3: | 718 | /@eslint/eslintrc@2.1.0: |
700 | resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} | 719 | resolution: {integrity: sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==} |
701 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 720 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
702 | dependencies: | 721 | dependencies: |
703 | ajv: 6.12.6 | 722 | ajv: 6.12.6 |
704 | debug: 4.3.4 | 723 | debug: 4.3.4 |
705 | espree: 9.5.2 | 724 | espree: 9.6.1 |
706 | globals: 13.20.0 | 725 | globals: 13.20.0 |
707 | ignore: 5.2.4 | 726 | ignore: 5.2.4 |
708 | import-fresh: 3.3.0 | 727 | import-fresh: 3.3.0 |
@@ -713,13 +732,13 @@ packages: | |||
713 | - supports-color | 732 | - supports-color |
714 | dev: true | 733 | dev: true |
715 | 734 | ||
716 | /@eslint/js@8.39.0: | 735 | /@eslint/js@8.44.0: |
717 | resolution: {integrity: sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==} | 736 | resolution: {integrity: sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==} |
718 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 737 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
719 | dev: true | 738 | dev: true |
720 | 739 | ||
721 | /@humanwhocodes/config-array@0.11.8: | 740 | /@humanwhocodes/config-array@0.11.10: |
722 | resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} | 741 | resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} |
723 | engines: {node: '>=10.10.0'} | 742 | engines: {node: '>=10.10.0'} |
724 | dependencies: | 743 | dependencies: |
725 | '@humanwhocodes/object-schema': 1.2.1 | 744 | '@humanwhocodes/object-schema': 1.2.1 |
@@ -798,16 +817,16 @@ packages: | |||
798 | '@types/tar-fs': 2.0.1 | 817 | '@types/tar-fs': 2.0.1 |
799 | dev: true | 818 | dev: true |
800 | 819 | ||
801 | /acorn-jsx@5.3.2(acorn@8.8.2): | 820 | /acorn-jsx@5.3.2(acorn@8.10.0): |
802 | resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} | 821 | resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} |
803 | peerDependencies: | 822 | peerDependencies: |
804 | acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 | 823 | acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 |
805 | dependencies: | 824 | dependencies: |
806 | acorn: 8.8.2 | 825 | acorn: 8.10.0 |
807 | dev: true | 826 | dev: true |
808 | 827 | ||
809 | /acorn@8.8.2: | 828 | /acorn@8.10.0: |
810 | resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} | 829 | resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} |
811 | engines: {node: '>=0.4.0'} | 830 | engines: {node: '>=0.4.0'} |
812 | hasBin: true | 831 | hasBin: true |
813 | dev: true | 832 | dev: true |
@@ -949,8 +968,9 @@ packages: | |||
949 | resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} | 968 | resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} |
950 | dev: true | 969 | dev: true |
951 | 970 | ||
952 | /ci-info@3.3.2: | 971 | /ci-info@3.8.0: |
953 | resolution: {integrity: sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==} | 972 | resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} |
973 | engines: {node: '>=8'} | ||
954 | dev: true | 974 | dev: true |
955 | 975 | ||
956 | /clean-regexp@1.0.0: | 976 | /clean-regexp@1.0.0: |
@@ -1081,67 +1101,53 @@ packages: | |||
1081 | engines: {node: '>=10'} | 1101 | engines: {node: '>=10'} |
1082 | dev: true | 1102 | dev: true |
1083 | 1103 | ||
1084 | /eslint-plugin-unicorn@42.0.0(eslint@8.39.0): | 1104 | /eslint-plugin-unicorn@48.0.0(eslint@8.45.0): |
1085 | resolution: {integrity: sha512-ixBsbhgWuxVaNlPTT8AyfJMlhyC5flCJFjyK3oKE8TRrwBnaHvUbuIkCM1lqg8ryYrFStL/T557zfKzX4GKSlg==} | 1105 | resolution: {integrity: sha512-8fk/v3p1ro34JSVDBEmtOq6EEQRpMR0iTir79q69KnXFZ6DJyPkT3RAi+ZoTqhQMdDSpGh8BGR68ne1sP5cnAA==} |
1086 | engines: {node: '>=12'} | 1106 | engines: {node: '>=16'} |
1087 | peerDependencies: | 1107 | peerDependencies: |
1088 | eslint: '>=8.8.0' | 1108 | eslint: '>=8.44.0' |
1089 | dependencies: | 1109 | dependencies: |
1090 | '@babel/helper-validator-identifier': 7.16.7 | 1110 | '@babel/helper-validator-identifier': 7.22.5 |
1091 | ci-info: 3.3.2 | 1111 | '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) |
1112 | ci-info: 3.8.0 | ||
1092 | clean-regexp: 1.0.0 | 1113 | clean-regexp: 1.0.0 |
1093 | eslint: 8.39.0 | 1114 | eslint: 8.45.0 |
1094 | eslint-utils: 3.0.0(eslint@8.39.0) | 1115 | esquery: 1.5.0 |
1095 | esquery: 1.4.0 | ||
1096 | indent-string: 4.0.0 | 1116 | indent-string: 4.0.0 |
1097 | is-builtin-module: 3.1.0 | 1117 | is-builtin-module: 3.2.1 |
1118 | jsesc: 3.0.2 | ||
1098 | lodash: 4.17.21 | 1119 | lodash: 4.17.21 |
1099 | pluralize: 8.0.0 | 1120 | pluralize: 8.0.0 |
1100 | read-pkg-up: 7.0.1 | 1121 | read-pkg-up: 7.0.1 |
1101 | regexp-tree: 0.1.24 | 1122 | regexp-tree: 0.1.27 |
1102 | safe-regex: 2.1.1 | 1123 | regjsparser: 0.10.0 |
1103 | semver: 7.3.7 | 1124 | semver: 7.5.4 |
1104 | strip-indent: 3.0.0 | 1125 | strip-indent: 3.0.0 |
1105 | dev: true | 1126 | dev: true |
1106 | 1127 | ||
1107 | /eslint-scope@7.2.0: | 1128 | /eslint-scope@7.2.1: |
1108 | resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} | 1129 | resolution: {integrity: sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==} |
1109 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 1130 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
1110 | dependencies: | 1131 | dependencies: |
1111 | esrecurse: 4.3.0 | 1132 | esrecurse: 4.3.0 |
1112 | estraverse: 5.3.0 | 1133 | estraverse: 5.3.0 |
1113 | dev: true | 1134 | dev: true |
1114 | 1135 | ||
1115 | /eslint-utils@3.0.0(eslint@8.39.0): | ||
1116 | resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} | ||
1117 | engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} | ||
1118 | peerDependencies: | ||
1119 | eslint: '>=5' | ||
1120 | dependencies: | ||
1121 | eslint: 8.39.0 | ||
1122 | eslint-visitor-keys: 2.1.0 | ||
1123 | dev: true | ||
1124 | |||
1125 | /eslint-visitor-keys@2.1.0: | ||
1126 | resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} | ||
1127 | engines: {node: '>=10'} | ||
1128 | dev: true | ||
1129 | |||
1130 | /eslint-visitor-keys@3.4.1: | 1136 | /eslint-visitor-keys@3.4.1: |
1131 | resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} | 1137 | resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} |
1132 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 1138 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
1133 | dev: true | 1139 | dev: true |
1134 | 1140 | ||
1135 | /eslint@8.39.0: | 1141 | /eslint@8.45.0: |
1136 | resolution: {integrity: sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==} | 1142 | resolution: {integrity: sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==} |
1137 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 1143 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
1138 | hasBin: true | 1144 | hasBin: true |
1139 | dependencies: | 1145 | dependencies: |
1140 | '@eslint-community/eslint-utils': 4.4.0(eslint@8.39.0) | 1146 | '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) |
1141 | '@eslint-community/regexpp': 4.5.1 | 1147 | '@eslint-community/regexpp': 4.6.1 |
1142 | '@eslint/eslintrc': 2.0.3 | 1148 | '@eslint/eslintrc': 2.1.0 |
1143 | '@eslint/js': 8.39.0 | 1149 | '@eslint/js': 8.44.0 |
1144 | '@humanwhocodes/config-array': 0.11.8 | 1150 | '@humanwhocodes/config-array': 0.11.10 |
1145 | '@humanwhocodes/module-importer': 1.0.1 | 1151 | '@humanwhocodes/module-importer': 1.0.1 |
1146 | '@nodelib/fs.walk': 1.2.8 | 1152 | '@nodelib/fs.walk': 1.2.8 |
1147 | ajv: 6.12.6 | 1153 | ajv: 6.12.6 |
@@ -1150,9 +1156,9 @@ packages: | |||
1150 | debug: 4.3.4 | 1156 | debug: 4.3.4 |
1151 | doctrine: 3.0.0 | 1157 | doctrine: 3.0.0 |
1152 | escape-string-regexp: 4.0.0 | 1158 | escape-string-regexp: 4.0.0 |
1153 | eslint-scope: 7.2.0 | 1159 | eslint-scope: 7.2.1 |
1154 | eslint-visitor-keys: 3.4.1 | 1160 | eslint-visitor-keys: 3.4.1 |
1155 | espree: 9.5.2 | 1161 | espree: 9.6.1 |
1156 | esquery: 1.5.0 | 1162 | esquery: 1.5.0 |
1157 | esutils: 2.0.3 | 1163 | esutils: 2.0.3 |
1158 | fast-deep-equal: 3.1.3 | 1164 | fast-deep-equal: 3.1.3 |
@@ -1160,43 +1166,33 @@ packages: | |||
1160 | find-up: 5.0.0 | 1166 | find-up: 5.0.0 |
1161 | glob-parent: 6.0.2 | 1167 | glob-parent: 6.0.2 |
1162 | globals: 13.20.0 | 1168 | globals: 13.20.0 |
1163 | grapheme-splitter: 1.0.4 | 1169 | graphemer: 1.4.0 |
1164 | ignore: 5.2.4 | 1170 | ignore: 5.2.4 |
1165 | import-fresh: 3.3.0 | ||
1166 | imurmurhash: 0.1.4 | 1171 | imurmurhash: 0.1.4 |
1167 | is-glob: 4.0.3 | 1172 | is-glob: 4.0.3 |
1168 | is-path-inside: 3.0.3 | 1173 | is-path-inside: 3.0.3 |
1169 | js-sdsl: 4.4.0 | ||
1170 | js-yaml: 4.1.0 | 1174 | js-yaml: 4.1.0 |
1171 | json-stable-stringify-without-jsonify: 1.0.1 | 1175 | json-stable-stringify-without-jsonify: 1.0.1 |
1172 | levn: 0.4.1 | 1176 | levn: 0.4.1 |
1173 | lodash.merge: 4.6.2 | 1177 | lodash.merge: 4.6.2 |
1174 | minimatch: 3.1.2 | 1178 | minimatch: 3.1.2 |
1175 | natural-compare: 1.4.0 | 1179 | natural-compare: 1.4.0 |
1176 | optionator: 0.9.1 | 1180 | optionator: 0.9.3 |
1177 | strip-ansi: 6.0.1 | 1181 | strip-ansi: 6.0.1 |
1178 | strip-json-comments: 3.1.1 | ||
1179 | text-table: 0.2.0 | 1182 | text-table: 0.2.0 |
1180 | transitivePeerDependencies: | 1183 | transitivePeerDependencies: |
1181 | - supports-color | 1184 | - supports-color |
1182 | dev: true | 1185 | dev: true |
1183 | 1186 | ||
1184 | /espree@9.5.2: | 1187 | /espree@9.6.1: |
1185 | resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} | 1188 | resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} |
1186 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 1189 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
1187 | dependencies: | 1190 | dependencies: |
1188 | acorn: 8.8.2 | 1191 | acorn: 8.10.0 |
1189 | acorn-jsx: 5.3.2(acorn@8.8.2) | 1192 | acorn-jsx: 5.3.2(acorn@8.10.0) |
1190 | eslint-visitor-keys: 3.4.1 | 1193 | eslint-visitor-keys: 3.4.1 |
1191 | dev: true | 1194 | dev: true |
1192 | 1195 | ||
1193 | /esquery@1.4.0: | ||
1194 | resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} | ||
1195 | engines: {node: '>=0.10'} | ||
1196 | dependencies: | ||
1197 | estraverse: 5.3.0 | ||
1198 | dev: true | ||
1199 | |||
1200 | /esquery@1.5.0: | 1196 | /esquery@1.5.0: |
1201 | resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} | 1197 | resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} |
1202 | engines: {node: '>=0.10'} | 1198 | engines: {node: '>=0.10'} |
@@ -1345,8 +1341,8 @@ packages: | |||
1345 | resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} | 1341 | resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} |
1346 | dev: true | 1342 | dev: true |
1347 | 1343 | ||
1348 | /grapheme-splitter@1.0.4: | 1344 | /graphemer@1.4.0: |
1349 | resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} | 1345 | resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} |
1350 | dev: true | 1346 | dev: true |
1351 | 1347 | ||
1352 | /has-flag@3.0.0: | 1348 | /has-flag@3.0.0: |
@@ -1448,8 +1444,8 @@ packages: | |||
1448 | resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} | 1444 | resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} |
1449 | dev: true | 1445 | dev: true |
1450 | 1446 | ||
1451 | /is-builtin-module@3.1.0: | 1447 | /is-builtin-module@3.2.1: |
1452 | resolution: {integrity: sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==} | 1448 | resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} |
1453 | engines: {node: '>=6'} | 1449 | engines: {node: '>=6'} |
1454 | dependencies: | 1450 | dependencies: |
1455 | builtin-modules: 3.3.0 | 1451 | builtin-modules: 3.3.0 |
@@ -1459,11 +1455,11 @@ packages: | |||
1459 | resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} | 1455 | resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} |
1460 | hasBin: true | 1456 | hasBin: true |
1461 | dependencies: | 1457 | dependencies: |
1462 | ci-info: 3.3.2 | 1458 | ci-info: 3.8.0 |
1463 | dev: true | 1459 | dev: true |
1464 | 1460 | ||
1465 | /is-core-module@2.9.0: | 1461 | /is-core-module@2.12.1: |
1466 | resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==} | 1462 | resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} |
1467 | dependencies: | 1463 | dependencies: |
1468 | has: 1.0.3 | 1464 | has: 1.0.3 |
1469 | dev: true | 1465 | dev: true |
@@ -1511,10 +1507,6 @@ packages: | |||
1511 | resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} | 1507 | resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} |
1512 | dev: true | 1508 | dev: true |
1513 | 1509 | ||
1514 | /js-sdsl@4.4.0: | ||
1515 | resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} | ||
1516 | dev: true | ||
1517 | |||
1518 | /js-tokens@4.0.0: | 1510 | /js-tokens@4.0.0: |
1519 | resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} | 1511 | resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} |
1520 | dev: true | 1512 | dev: true |
@@ -1526,6 +1518,17 @@ packages: | |||
1526 | argparse: 2.0.1 | 1518 | argparse: 2.0.1 |
1527 | dev: true | 1519 | dev: true |
1528 | 1520 | ||
1521 | /jsesc@0.5.0: | ||
1522 | resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} | ||
1523 | hasBin: true | ||
1524 | dev: true | ||
1525 | |||
1526 | /jsesc@3.0.2: | ||
1527 | resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} | ||
1528 | engines: {node: '>=6'} | ||
1529 | hasBin: true | ||
1530 | dev: true | ||
1531 | |||
1529 | /json-fixer@1.6.15: | 1532 | /json-fixer@1.6.15: |
1530 | resolution: {integrity: sha512-TuDuZ5KrgyjoCIppdPXBMqiGfota55+odM+j2cQ5rt/XKyKmqGB3Whz1F8SN8+60yYGy/Nu5lbRZ+rx8kBIvBw==} | 1533 | resolution: {integrity: sha512-TuDuZ5KrgyjoCIppdPXBMqiGfota55+odM+j2cQ5rt/XKyKmqGB3Whz1F8SN8+60yYGy/Nu5lbRZ+rx8kBIvBw==} |
1531 | engines: {node: '>=10'} | 1534 | engines: {node: '>=10'} |
@@ -1651,8 +1654,8 @@ packages: | |||
1651 | resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} | 1654 | resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} |
1652 | dependencies: | 1655 | dependencies: |
1653 | hosted-git-info: 2.8.9 | 1656 | hosted-git-info: 2.8.9 |
1654 | resolve: 1.22.1 | 1657 | resolve: 1.22.2 |
1655 | semver: 5.7.1 | 1658 | semver: 5.7.2 |
1656 | validate-npm-package-license: 3.0.4 | 1659 | validate-npm-package-license: 3.0.4 |
1657 | dev: true | 1660 | dev: true |
1658 | 1661 | ||
@@ -1678,16 +1681,16 @@ packages: | |||
1678 | is-wsl: 2.2.0 | 1681 | is-wsl: 2.2.0 |
1679 | dev: true | 1682 | dev: true |
1680 | 1683 | ||
1681 | /optionator@0.9.1: | 1684 | /optionator@0.9.3: |
1682 | resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} | 1685 | resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} |
1683 | engines: {node: '>= 0.8.0'} | 1686 | engines: {node: '>= 0.8.0'} |
1684 | dependencies: | 1687 | dependencies: |
1688 | '@aashutoshrathi/word-wrap': 1.2.6 | ||
1685 | deep-is: 0.1.4 | 1689 | deep-is: 0.1.4 |
1686 | fast-levenshtein: 2.0.6 | 1690 | fast-levenshtein: 2.0.6 |
1687 | levn: 0.4.1 | 1691 | levn: 0.4.1 |
1688 | prelude-ls: 1.2.1 | 1692 | prelude-ls: 1.2.1 |
1689 | type-check: 0.4.0 | 1693 | type-check: 0.4.0 |
1690 | word-wrap: 1.2.3 | ||
1691 | dev: true | 1694 | dev: true |
1692 | 1695 | ||
1693 | /os-tmpdir@1.0.2: | 1696 | /os-tmpdir@1.0.2: |
@@ -1739,7 +1742,7 @@ packages: | |||
1739 | resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} | 1742 | resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} |
1740 | engines: {node: '>=8'} | 1743 | engines: {node: '>=8'} |
1741 | dependencies: | 1744 | dependencies: |
1742 | '@babel/code-frame': 7.16.7 | 1745 | '@babel/code-frame': 7.22.5 |
1743 | error-ex: 1.3.2 | 1746 | error-ex: 1.3.2 |
1744 | json-parse-even-better-errors: 2.3.1 | 1747 | json-parse-even-better-errors: 2.3.1 |
1745 | lines-and-columns: 1.2.4 | 1748 | lines-and-columns: 1.2.4 |
@@ -1789,6 +1792,14 @@ packages: | |||
1789 | resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} | 1792 | resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} |
1790 | engines: {node: '>=10.13.0'} | 1793 | engines: {node: '>=10.13.0'} |
1791 | hasBin: true | 1794 | hasBin: true |
1795 | requiresBuild: true | ||
1796 | dev: true | ||
1797 | optional: true | ||
1798 | |||
1799 | /prettier@3.0.0: | ||
1800 | resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} | ||
1801 | engines: {node: '>=14'} | ||
1802 | hasBin: true | ||
1792 | dev: true | 1803 | dev: true |
1793 | 1804 | ||
1794 | /process-nextick-args@2.0.1: | 1805 | /process-nextick-args@2.0.1: |
@@ -1852,9 +1863,16 @@ packages: | |||
1852 | resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} | 1863 | resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} |
1853 | dev: true | 1864 | dev: true |
1854 | 1865 | ||
1855 | /regexp-tree@0.1.24: | 1866 | /regexp-tree@0.1.27: |
1856 | resolution: {integrity: sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==} | 1867 | resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} |
1868 | hasBin: true | ||
1869 | dev: true | ||
1870 | |||
1871 | /regjsparser@0.10.0: | ||
1872 | resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} | ||
1857 | hasBin: true | 1873 | hasBin: true |
1874 | dependencies: | ||
1875 | jsesc: 0.5.0 | ||
1858 | dev: true | 1876 | dev: true |
1859 | 1877 | ||
1860 | /require-directory@2.1.1: | 1878 | /require-directory@2.1.1: |
@@ -1871,11 +1889,11 @@ packages: | |||
1871 | engines: {node: '>=4'} | 1889 | engines: {node: '>=4'} |
1872 | dev: true | 1890 | dev: true |
1873 | 1891 | ||
1874 | /resolve@1.22.1: | 1892 | /resolve@1.22.2: |
1875 | resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} | 1893 | resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} |
1876 | hasBin: true | 1894 | hasBin: true |
1877 | dependencies: | 1895 | dependencies: |
1878 | is-core-module: 2.9.0 | 1896 | is-core-module: 2.12.1 |
1879 | path-parse: 1.0.7 | 1897 | path-parse: 1.0.7 |
1880 | supports-preserve-symlinks-flag: 1.0.0 | 1898 | supports-preserve-symlinks-flag: 1.0.0 |
1881 | dev: true | 1899 | dev: true |
@@ -1926,23 +1944,17 @@ packages: | |||
1926 | resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} | 1944 | resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} |
1927 | dev: true | 1945 | dev: true |
1928 | 1946 | ||
1929 | /safe-regex@2.1.1: | ||
1930 | resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} | ||
1931 | dependencies: | ||
1932 | regexp-tree: 0.1.24 | ||
1933 | dev: true | ||
1934 | |||
1935 | /safer-buffer@2.1.2: | 1947 | /safer-buffer@2.1.2: |
1936 | resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} | 1948 | resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} |
1937 | dev: true | 1949 | dev: true |
1938 | 1950 | ||
1939 | /semver@5.7.1: | 1951 | /semver@5.7.2: |
1940 | resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} | 1952 | resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} |
1941 | hasBin: true | 1953 | hasBin: true |
1942 | dev: true | 1954 | dev: true |
1943 | 1955 | ||
1944 | /semver@7.3.7: | 1956 | /semver@7.5.4: |
1945 | resolution: {integrity: sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==} | 1957 | resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} |
1946 | engines: {node: '>=10'} | 1958 | engines: {node: '>=10'} |
1947 | hasBin: true | 1959 | hasBin: true |
1948 | dependencies: | 1960 | dependencies: |
@@ -1979,11 +1991,11 @@ packages: | |||
1979 | - supports-color | 1991 | - supports-color |
1980 | dev: true | 1992 | dev: true |
1981 | 1993 | ||
1982 | /spdx-correct@3.1.1: | 1994 | /spdx-correct@3.2.0: |
1983 | resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} | 1995 | resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} |
1984 | dependencies: | 1996 | dependencies: |
1985 | spdx-expression-parse: 3.0.1 | 1997 | spdx-expression-parse: 3.0.1 |
1986 | spdx-license-ids: 3.0.11 | 1998 | spdx-license-ids: 3.0.13 |
1987 | dev: true | 1999 | dev: true |
1988 | 2000 | ||
1989 | /spdx-exceptions@2.3.0: | 2001 | /spdx-exceptions@2.3.0: |
@@ -1994,11 +2006,11 @@ packages: | |||
1994 | resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} | 2006 | resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} |
1995 | dependencies: | 2007 | dependencies: |
1996 | spdx-exceptions: 2.3.0 | 2008 | spdx-exceptions: 2.3.0 |
1997 | spdx-license-ids: 3.0.11 | 2009 | spdx-license-ids: 3.0.13 |
1998 | dev: true | 2010 | dev: true |
1999 | 2011 | ||
2000 | /spdx-license-ids@3.0.11: | 2012 | /spdx-license-ids@3.0.13: |
2001 | resolution: {integrity: sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==} | 2013 | resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} |
2002 | dev: true | 2014 | dev: true |
2003 | 2015 | ||
2004 | /string-width@4.2.3: | 2016 | /string-width@4.2.3: |
@@ -2077,7 +2089,7 @@ packages: | |||
2077 | dev: true | 2089 | dev: true |
2078 | 2090 | ||
2079 | /targz@1.0.1: | 2091 | /targz@1.0.1: |
2080 | resolution: {integrity: sha1-j3alI2lM3t+7XWCkB2/27uzFOY8=} | 2092 | resolution: {integrity: sha512-6q4tP9U55mZnRuMTBqnqc3nwYQY3kv+QthCFZuMk+Tn1qYUnMPmL/JZ/mzgXINzFpSqfU+242IFmFU9VPvqaQw==} |
2081 | dependencies: | 2093 | dependencies: |
2082 | tar-fs: 1.16.3 | 2094 | tar-fs: 1.16.3 |
2083 | dev: true | 2095 | dev: true |
@@ -2154,7 +2166,7 @@ packages: | |||
2154 | /validate-npm-package-license@3.0.4: | 2166 | /validate-npm-package-license@3.0.4: |
2155 | resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} | 2167 | resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} |
2156 | dependencies: | 2168 | dependencies: |
2157 | spdx-correct: 3.1.1 | 2169 | spdx-correct: 3.2.0 |
2158 | spdx-expression-parse: 3.0.1 | 2170 | spdx-expression-parse: 3.0.1 |
2159 | dev: true | 2171 | dev: true |
2160 | 2172 | ||
@@ -2181,11 +2193,6 @@ packages: | |||
2181 | isexe: 2.0.0 | 2193 | isexe: 2.0.0 |
2182 | dev: true | 2194 | dev: true |
2183 | 2195 | ||
2184 | /word-wrap@1.2.3: | ||
2185 | resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} | ||
2186 | engines: {node: '>=0.10.0'} | ||
2187 | dev: true | ||
2188 | |||
2189 | /wrap-ansi@6.2.0: | 2196 | /wrap-ansi@6.2.0: |
2190 | resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} | 2197 | resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} |
2191 | engines: {node: '>=8'} | 2198 | engines: {node: '>=8'} |
diff --git a/recipes/BlueBubbles/README.md b/recipes/BlueBubbles/README.md deleted file mode 100644 index 76c7ad8..0000000 --- a/recipes/BlueBubbles/README.md +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | # BlueBubbles for ferdium | ||
2 | This is a ferdium recipe for BlueBubbles | ||
diff --git a/recipes/BlueBubbles/package.json b/recipes/BlueBubbles/package.json index 896abb3..3e86a16 100644 --- a/recipes/BlueBubbles/package.json +++ b/recipes/BlueBubbles/package.json | |||
@@ -1,9 +1,9 @@ | |||
1 | { | 1 | { |
2 | "id": "BlueBubbles", | 2 | "id": "BlueBubbles", |
3 | "name": "BlueBubbles", | 3 | "name": "BlueBubbles", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://bluebubbles.app/web/#/" | 7 | "serviceURL": "https://bluebubbles.app/web/#/" |
8 | } | 8 | } |
9 | } | 9 | } |
diff --git a/recipes/BlueBubbles/webview.js b/recipes/BlueBubbles/webview.js index cf4423b..b09f171 100644 --- a/recipes/BlueBubbles/webview.js +++ b/recipes/BlueBubbles/webview.js | |||
@@ -1,16 +1,16 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | 2 | return obj && obj.__esModule ? obj : { default: obj }; | |
3 | function _interopRequireDefault(obj) { | 3 | } |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 4 | |
5 | } | 5 | const _path = _interopRequireDefault(require('path')); |
6 | 6 | ||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your BlueBubbles service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your BlueBubbles service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
10 | // // TODO: Insert your notification-finding code here | 10 | // // TODO: Insert your notification-finding code here |
11 | // Ferdium.setBadge(0, 0); | 11 | // Ferdium.setBadge(0, 0); |
12 | // }; | 12 | // }; |
13 | // Ferdium.loop(getMessages); | 13 | // Ferdium.loop(getMessages); |
14 | 14 | ||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
16 | }; | 16 | }; |
diff --git a/recipes/NewsBlur/package.json b/recipes/NewsBlur/package.json index 9370992..bb1cfae 100644 --- a/recipes/NewsBlur/package.json +++ b/recipes/NewsBlur/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "NewsBlur", | 2 | "id": "NewsBlur", |
3 | "name": "NewsBlur", | 3 | "name": "NewsBlur", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://newsblur.com", | 7 | "serviceURL": "https://newsblur.com", |
diff --git a/recipes/NewsBlur/webview.js b/recipes/NewsBlur/webview.js index 86bb422..2a81dec 100644 --- a/recipes/NewsBlur/webview.js +++ b/recipes/NewsBlur/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/OVHCloud/package.json b/recipes/OVHCloud/package.json index 5c4851f..02594a6 100644 --- a/recipes/OVHCloud/package.json +++ b/recipes/OVHCloud/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "OVHCloud", | 2 | "id": "OVHCloud", |
3 | "name": "OVH Cloud", | 3 | "name": "OVH Cloud", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.ovh.com/auth" | 7 | "serviceURL": "https://www.ovh.com/auth" |
diff --git a/recipes/OVHCloud/webview.js b/recipes/OVHCloud/webview.js index 86bb422..2a81dec 100644 --- a/recipes/OVHCloud/webview.js +++ b/recipes/OVHCloud/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/TickTick/package.json b/recipes/TickTick/package.json index 3aa41a0..c1c4897 100644 --- a/recipes/TickTick/package.json +++ b/recipes/TickTick/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "TickTick", | 2 | "id": "TickTick", |
3 | "name": "TickTick", | 3 | "name": "TickTick", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.ticktick.com/#p/inbox/tasks" | 7 | "serviceURL": "https://www.ticktick.com/#p/inbox/tasks" |
diff --git a/recipes/TickTick/webview.js b/recipes/TickTick/webview.js index d2c7ef5..35a8ff1 100644 --- a/recipes/TickTick/webview.js +++ b/recipes/TickTick/webview.js | |||
@@ -1,4 +1,10 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // all overdue items are being counted | 9 | // all overdue items are being counted |
4 | const count = document.querySelectorAll('.duedate-overdue').length; | 10 | const count = document.querySelectorAll('.duedate-overdue').length; |
@@ -7,4 +13,6 @@ module.exports = (Ferdium) => { | |||
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/air-droid/package.json b/recipes/air-droid/package.json index a2780a9..15ff253 100644 --- a/recipes/air-droid/package.json +++ b/recipes/air-droid/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "air-droid", | 2 | "id": "air-droid", |
3 | "name": "AirDroid", | 3 | "name": "AirDroid", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "http://web.airdroid.com/", | 7 | "serviceURL": "http://web.airdroid.com/", |
diff --git a/recipes/air-droid/webview.js b/recipes/air-droid/webview.js index a2e350f..b78fd6f 100644 --- a/recipes/air-droid/webview.js +++ b/recipes/air-droid/webview.js | |||
@@ -1,4 +1,10 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const count = {}; | 9 | const count = {}; |
4 | const data = document.querySelector('#FranzMessages').dataset; | 10 | const data = document.querySelector('#FranzMessages').dataset; |
@@ -8,7 +14,9 @@ module.exports = (Ferdium) => { | |||
8 | } | 14 | } |
9 | 15 | ||
10 | Ferdium.setBadge(count); | 16 | Ferdium.setBadge(count); |
11 | } | 17 | }; |
12 | 18 | ||
13 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 22 | }; |
diff --git a/recipes/airmessage/package.json b/recipes/airmessage/package.json index 7d70e14..cc8fcfd 100644 --- a/recipes/airmessage/package.json +++ b/recipes/airmessage/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "airmessage", | 2 | "id": "airmessage", |
3 | "name": "AirMessage", | 3 | "name": "AirMessage", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.airmessage.org/" | 7 | "serviceURL": "https://web.airmessage.org/" |
diff --git a/recipes/airmessage/webview.js b/recipes/airmessage/webview.js index c951482..c492432 100644 --- a/recipes/airmessage/webview.js +++ b/recipes/airmessage/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = () => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | // TODO: If your AirMessage service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your AirMessage service has unread messages, uncomment these lines to implement the logic for updating the badges |
3 | // const getMessages = () => { | 9 | // const getMessages = () => { |
4 | // // TODO: Insert your notification-finding code here | 10 | // // TODO: Insert your notification-finding code here |
5 | // Ferdium.setBadge(0, 0); | 11 | // Ferdium.setBadge(0, 0); |
6 | // }; | 12 | // }; |
7 | // Ferdium.loop(getMessages); | 13 | // Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/airtable/package.json b/recipes/airtable/package.json index 89a015e..66376a5 100644 --- a/recipes/airtable/package.json +++ b/recipes/airtable/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "airtable", | 2 | "id": "airtable", |
3 | "name": "Airtable", | 3 | "name": "Airtable", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/transnat/recipe-airtable", | 6 | "repository": "https://github.com/transnat/recipe-airtable", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/airtable/webview.js b/recipes/airtable/webview.js index 86bb422..2a81dec 100644 --- a/recipes/airtable/webview.js +++ b/recipes/airtable/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/amazon-web-services/package.json b/recipes/amazon-web-services/package.json index b23845e..239a53d 100644 --- a/recipes/amazon-web-services/package.json +++ b/recipes/amazon-web-services/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "amazon-web-services", | 2 | "id": "amazon-web-services", |
3 | "name": "Amazon Web Services", | 3 | "name": "Amazon Web Services", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "aws" | 7 | "aws" |
diff --git a/recipes/amazon-web-services/webview.js b/recipes/amazon-web-services/webview.js index 86bb422..2a81dec 100644 --- a/recipes/amazon-web-services/webview.js +++ b/recipes/amazon-web-services/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/amazon-work-mail/package.json b/recipes/amazon-work-mail/package.json index 4540f22..6266574 100644 --- a/recipes/amazon-work-mail/package.json +++ b/recipes/amazon-work-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "amazon-work-mail", | 2 | "id": "amazon-work-mail", |
3 | "name": "Amazon WorkMail", | 3 | "name": "Amazon WorkMail", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.awsapps.com/mail", | 7 | "serviceURL": "https://{teamId}.awsapps.com/mail", |
diff --git a/recipes/amazon-work-mail/webview.js b/recipes/amazon-work-mail/webview.js index 36967fd..0eeb323 100644 --- a/recipes/amazon-work-mail/webview.js +++ b/recipes/amazon-work-mail/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | const reload = EventType => | 7 | const reload = EventType => |
2 | new Promise((resolve, reject) => { | 8 | new Promise((resolve, reject) => { |
3 | const btn = document.querySelectorAll('.giraffe-hierarchy-node-refresh')[0]; | 9 | const btn = document.querySelectorAll('.giraffe-hierarchy-node-refresh')[0]; |
@@ -30,4 +36,6 @@ module.exports = Ferdium => { | |||
30 | reload('click'); | 36 | reload('click'); |
31 | }, 60_000); | 37 | }, 60_000); |
32 | } | 38 | } |
39 | |||
40 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
33 | }; | 41 | }; |
diff --git a/recipes/android-messages/package.json b/recipes/android-messages/package.json index 6051311..61d8e6a 100644 --- a/recipes/android-messages/package.json +++ b/recipes/android-messages/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "android-messages", | 2 | "id": "android-messages", |
3 | "name": "Android Messages", | 3 | "name": "Android Messages", |
4 | "version": "2.3.1", | 4 | "version": "2.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://messages.google.com/web", | 7 | "serviceURL": "https://messages.google.com/web", |
diff --git a/recipes/android-messages/webview.js b/recipes/android-messages/webview.js index 18d1c90..b2d5a11 100644 --- a/recipes/android-messages/webview.js +++ b/recipes/android-messages/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | setTimeout(() => { | 7 | setTimeout(() => { |
2 | const elem = document.querySelector('#af-error-container'); | 8 | const elem = document.querySelector('#af-error-container'); |
3 | 9 | ||
@@ -39,4 +45,6 @@ module.exports = (Ferdium, settings) => { | |||
39 | } else { | 45 | } else { |
40 | localStorage.setItem('dark_mode_enabled', 'false'); | 46 | localStorage.setItem('dark_mode_enabled', 'false'); |
41 | } | 47 | } |
48 | |||
49 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
42 | }; | 50 | }; |
diff --git a/recipes/anonaddy/package.json b/recipes/anonaddy/package.json index 4ed88f2..f8f31e3 100644 --- a/recipes/anonaddy/package.json +++ b/recipes/anonaddy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "anonaddy", | 2 | "id": "anonaddy", |
3 | "name": "AnonAddy", | 3 | "name": "AnonAddy", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.anonaddy.com/" | 7 | "serviceURL": "https://app.anonaddy.com/" |
diff --git a/recipes/anonaddy/webview.js b/recipes/anonaddy/webview.js index 46366f4..1119219 100644 --- a/recipes/anonaddy/webview.js +++ b/recipes/anonaddy/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/anydo/package.json b/recipes/anydo/package.json index 51a5646..e90adb0 100644 --- a/recipes/anydo/package.json +++ b/recipes/anydo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "anydo", | 2 | "id": "anydo", |
3 | "name": "Any.do", | 3 | "name": "Any.do", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/chappy84/recipe-anydo", | 6 | "repository": "https://github.com/chappy84/recipe-anydo", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/anydo/webview.js b/recipes/anydo/webview.js index 8d0f2ca..3f14c14 100644 --- a/recipes/anydo/webview.js +++ b/recipes/anydo/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | function getTasks() { | 8 | function getTasks() { |
3 | let incompleteCount = 0; | 9 | let incompleteCount = 0; |
@@ -16,4 +22,6 @@ module.exports = Ferdium => { | |||
16 | } | 22 | } |
17 | 23 | ||
18 | Ferdium.loop(getTasks); | 24 | Ferdium.loop(getTasks); |
25 | |||
26 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
19 | }; | 27 | }; |
diff --git a/recipes/asana/package.json b/recipes/asana/package.json index ebe4ce6..70b42b5 100644 --- a/recipes/asana/package.json +++ b/recipes/asana/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "asana", | 2 | "id": "asana", |
3 | "name": "Asana", | 3 | "name": "Asana", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.asana.com", | 7 | "serviceURL": "https://app.asana.com", |
diff --git a/recipes/asana/webview.js b/recipes/asana/webview.js index 8a34c24..b1938ad 100644 --- a/recipes/asana/webview.js +++ b/recipes/asana/webview.js | |||
@@ -1,10 +1,14 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const hasNotification = document.querySelectorAll('.SidebarTopNavLinks-notificationsButton--hasNewNotifications'); | 9 | const hasNotification = document.querySelectorAll( |
10 | '.SidebarTopNavLinks-notificationsButton--hasNewNotifications', | ||
11 | ); | ||
8 | Ferdium.setBadge(hasNotification.length > 0 ? 1 : 0); | 12 | Ferdium.setBadge(hasNotification.length > 0 ? 1 : 0); |
9 | }; | 13 | }; |
10 | 14 | ||
diff --git a/recipes/awork/package.json b/recipes/awork/package.json index fb221cd..1893969 100644 --- a/recipes/awork/package.json +++ b/recipes/awork/package.json | |||
@@ -1,11 +1,11 @@ | |||
1 | { | 1 | { |
2 | "id": "awork", | 2 | "id": "awork", |
3 | "name": "Awork", | 3 | "name": "Awork", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.awork.io", | 7 | "serviceURL": "https://{teamId}.awork.io", |
8 | "hasTeamId": true, | 8 | "hasTeamId": true, |
9 | "urlInputSuffix": ".awork.io" | 9 | "urlInputSuffix": ".awork.io" |
10 | } | 10 | } |
11 | } \ No newline at end of file | 11 | } |
diff --git a/recipes/awork/webview.js b/recipes/awork/webview.js index 46366f4..1119219 100644 --- a/recipes/awork/webview.js +++ b/recipes/awork/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/azure-devops/package.json b/recipes/azure-devops/package.json index b316d64..662668c 100644 --- a/recipes/azure-devops/package.json +++ b/recipes/azure-devops/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "azure-devops", | 2 | "id": "azure-devops", |
3 | "name": "Azure DevOps", | 3 | "name": "Azure DevOps", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "azdo" | 7 | "azdo" |
diff --git a/recipes/azure-devops/webview.js b/recipes/azure-devops/webview.js index 86bb422..2a81dec 100644 --- a/recipes/azure-devops/webview.js +++ b/recipes/azure-devops/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/bard/package.json b/recipes/bard/package.json index 250b49f..f10ebf4 100644 --- a/recipes/bard/package.json +++ b/recipes/bard/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bard", | 2 | "id": "bard", |
3 | "name": "Bard", | 3 | "name": "Bard", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://bard.google.com/" | 7 | "serviceURL": "https://bard.google.com/" |
diff --git a/recipes/bard/webview.js b/recipes/bard/webview.js index 56a20b6..1119219 100644 --- a/recipes/bard/webview.js +++ b/recipes/bard/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/basecamp/package.json b/recipes/basecamp/package.json index 391d338..80a33e1 100644 --- a/recipes/basecamp/package.json +++ b/recipes/basecamp/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "basecamp", | 2 | "id": "basecamp", |
3 | "name": "Basecamp", | 3 | "name": "Basecamp", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://launchpad.37signals.com/" | 7 | "serviceURL": "https://launchpad.37signals.com/" |
diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js index 7d13751..2fe8f7b 100644 --- a/recipes/basecamp/webview.js +++ b/recipes/basecamp/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | function show(element) { | 7 | function show(element) { |
8 | element.style.display = 'inherit'; | 8 | element.style.display = 'inherit'; |
9 | } | 9 | } |
@@ -16,16 +16,16 @@ module.exports = Ferdium => { | |||
16 | const modal = document.createElement('div'); | 16 | const modal = document.createElement('div'); |
17 | 17 | ||
18 | const waitFor = (condition, callback) => { | 18 | const waitFor = (condition, callback) => { |
19 | if (!condition()) { | 19 | if (condition()) { |
20 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
21 | } else { | ||
22 | callback(); | 20 | callback(); |
21 | } else { | ||
22 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
23 | } | 23 | } |
24 | }; | 24 | }; |
25 | function showModal(text) { | 25 | function showModal(text) { |
26 | show(modal); | 26 | show(modal); |
27 | 27 | ||
28 | let p = modal.querySelector('p'); | 28 | const p = modal.querySelector('p'); |
29 | 29 | ||
30 | if (p) { | 30 | if (p) { |
31 | p.textContent = text; | 31 | p.textContent = text; |
@@ -34,7 +34,7 @@ module.exports = Ferdium => { | |||
34 | 34 | ||
35 | function hideModal() { | 35 | function hideModal() { |
36 | hide(modal); | 36 | hide(modal); |
37 | let p = modal.querySelector('p'); | 37 | const p = modal.querySelector('p'); |
38 | 38 | ||
39 | if (p) { | 39 | if (p) { |
40 | p.textContent = ''; | 40 | p.textContent = ''; |
@@ -52,7 +52,7 @@ module.exports = Ferdium => { | |||
52 | modal.textContent = | 52 | modal.textContent = |
53 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; | 53 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; |
54 | 54 | ||
55 | let close = modal.querySelector('.close'); | 55 | const close = modal.querySelector('.close'); |
56 | if (close) { | 56 | if (close) { |
57 | close.addEventListener('click', hideModal); | 57 | close.addEventListener('click', hideModal); |
58 | } | 58 | } |
diff --git a/recipes/bigbluebutton/package.json b/recipes/bigbluebutton/package.json index 934bf3e..e14fb13 100644 --- a/recipes/bigbluebutton/package.json +++ b/recipes/bigbluebutton/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bigbluebutton", | 2 | "id": "bigbluebutton", |
3 | "name": "BigBlueButton", | 3 | "name": "BigBlueButton", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://bigbluebutton.mycompany.com/", | 7 | "serviceURL": "https://bigbluebutton.mycompany.com/", |
diff --git a/recipes/bigbluebutton/webview.js b/recipes/bigbluebutton/webview.js index 86bb422..2a81dec 100644 --- a/recipes/bigbluebutton/webview.js +++ b/recipes/bigbluebutton/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/binance/package.json b/recipes/binance/package.json index c289b4a..3e92f56 100644 --- a/recipes/binance/package.json +++ b/recipes/binance/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "binance", | 2 | "id": "binance", |
3 | "name": "Binance", | 3 | "name": "Binance", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://accounts.binance.com" | 7 | "serviceURL": "https://accounts.binance.com" |
diff --git a/recipes/binance/webview.js b/recipes/binance/webview.js index 86bb422..2a81dec 100644 --- a/recipes/binance/webview.js +++ b/recipes/binance/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/bip/package.json b/recipes/bip/package.json index 18d9f68..9c67a88 100644 --- a/recipes/bip/package.json +++ b/recipes/bip/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bip", | 2 | "id": "bip", |
3 | "name": "BiP", | 3 | "name": "BiP", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.bip.com/", | 7 | "serviceURL": "https://web.bip.com/", |
diff --git a/recipes/bip/webview.js b/recipes/bip/webview.js index 59c51f0..59c9b5b 100644 --- a/recipes/bip/webview.js +++ b/recipes/bip/webview.js | |||
@@ -1,6 +1,14 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const elements = document.querySelectorAll('.contact-list__message__unread-badge-counter'); | 9 | const elements = document.querySelectorAll( |
10 | '.contact-list__message__unread-badge-counter', | ||
11 | ); | ||
4 | let count = 0; | 12 | let count = 0; |
5 | for (const element of elements) { | 13 | for (const element of elements) { |
6 | count += Ferdium.safeParseInt(element.textContent); | 14 | count += Ferdium.safeParseInt(element.textContent); |
@@ -9,4 +17,6 @@ module.exports = Ferdium => { | |||
9 | }; | 17 | }; |
10 | 18 | ||
11 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 22 | }; |
diff --git a/recipes/bitbucket/package.json b/recipes/bitbucket/package.json index aeb0197..fec9034 100644 --- a/recipes/bitbucket/package.json +++ b/recipes/bitbucket/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bitbucket", | 2 | "id": "bitbucket", |
3 | "name": "BitBucket", | 3 | "name": "BitBucket", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://bitbucket.org/dashboard/overview", | 7 | "serviceURL": "https://bitbucket.org/dashboard/overview", |
diff --git a/recipes/bitbucket/webview.js b/recipes/bitbucket/webview.js index 46366f4..1119219 100644 --- a/recipes/bitbucket/webview.js +++ b/recipes/bitbucket/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/bitwarden/package.json b/recipes/bitwarden/package.json index e27308b..7222333 100644 --- a/recipes/bitwarden/package.json +++ b/recipes/bitwarden/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bitwarden", | 2 | "id": "bitwarden", |
3 | "name": "Bitwarden", | 3 | "name": "Bitwarden", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://vault.bitwarden.com/", | 7 | "serviceURL": "https://vault.bitwarden.com/", |
diff --git a/recipes/bitwarden/webview.js b/recipes/bitwarden/webview.js index 86bb422..2a81dec 100644 --- a/recipes/bitwarden/webview.js +++ b/recipes/bitwarden/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/bluesky/package.json b/recipes/bluesky/package.json index 8e045a4..dc10dc5 100644 --- a/recipes/bluesky/package.json +++ b/recipes/bluesky/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bluesky", | 2 | "id": "bluesky", |
3 | "name": "Bluesky", | 3 | "name": "Bluesky", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://staging.bsky.app/" | 7 | "serviceURL": "https://staging.bsky.app/" |
diff --git a/recipes/bluesky/webview.js b/recipes/bluesky/webview.js index 56a20b6..1119219 100644 --- a/recipes/bluesky/webview.js +++ b/recipes/bluesky/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/box/package.json b/recipes/box/package.json index 9dd493f..44ce900 100644 --- a/recipes/box/package.json +++ b/recipes/box/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "box", | 2 | "id": "box", |
3 | "name": "Box", | 3 | "name": "Box", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://account.box.com/login" | 7 | "serviceURL": "https://account.box.com/login" |
diff --git a/recipes/box/webview.js b/recipes/box/webview.js index 86bb422..2a81dec 100644 --- a/recipes/box/webview.js +++ b/recipes/box/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/brax.me/package.json b/recipes/brax.me/package.json index ca123a1..919f3c3 100644 --- a/recipes/brax.me/package.json +++ b/recipes/brax.me/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "brax.me", | 2 | "id": "brax.me", |
3 | "name": "Brax.Me", | 3 | "name": "Brax.Me", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/hafiz-muhammad/ferdium-recipes", | 6 | "repository": "https://github.com/hafiz-muhammad/ferdium-recipes", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/brax.me/webview.js b/recipes/brax.me/webview.js index b83ea5f..6377504 100644 --- a/recipes/brax.me/webview.js +++ b/recipes/brax.me/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your Brax.Me service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your Brax.Me service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/bring/package.json b/recipes/bring/package.json index dc424a6..a33a306 100644 --- a/recipes/bring/package.json +++ b/recipes/bring/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bring", | 2 | "id": "bring", |
3 | "name": "Bring!", | 3 | "name": "Bring!", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.getbring.com" | 7 | "serviceURL": "https://web.getbring.com" |
diff --git a/recipes/bring/webview.js b/recipes/bring/webview.js index 52e1cef..545d98b 100644 --- a/recipes/bring/webview.js +++ b/recipes/bring/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your Bring service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your Bring service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/buffer/package.json b/recipes/buffer/package.json index 6ca5d61..f0ecca5 100644 --- a/recipes/buffer/package.json +++ b/recipes/buffer/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "buffer", | 2 | "id": "buffer", |
3 | "name": "Buffer", | 3 | "name": "Buffer", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "GPL", | 5 | "license": "GPL", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://buffer.com", | 7 | "serviceURL": "https://buffer.com", |
diff --git a/recipes/buffer/webview.js b/recipes/buffer/webview.js index de6c7f2..ffdbcf2 100644 --- a/recipes/buffer/webview.js +++ b/recipes/buffer/webview.js | |||
@@ -1,7 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | Ferdium.injectCSS(_path.default.join(__dirname, 'css', 'franz.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'css', 'franz.css')); |
7 | }; | 9 | }; |
diff --git a/recipes/bugzilla/package.json b/recipes/bugzilla/package.json index b1f7412..792d589 100644 --- a/recipes/bugzilla/package.json +++ b/recipes/bugzilla/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "bugzilla", | 2 | "id": "bugzilla", |
3 | "name": "Bugzilla", | 3 | "name": "Bugzilla", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [], | 6 | "aliases": [], |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/bugzilla/webview.js b/recipes/bugzilla/webview.js index dd41f72..ffdbcf2 100644 --- a/recipes/bugzilla/webview.js +++ b/recipes/bugzilla/webview.js | |||
@@ -1 +1,9 @@ | |||
1 | module.exports = Ferdium => Ferdium; | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'css', 'franz.css')); | ||
9 | }; | ||
diff --git a/recipes/campuswire/package.json b/recipes/campuswire/package.json index e71eaeb..65853b9 100644 --- a/recipes/campuswire/package.json +++ b/recipes/campuswire/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "campuswire", | 2 | "id": "campuswire", |
3 | "name": "Campuswire", | 3 | "name": "Campuswire", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://campuswire.com/c", | 7 | "serviceURL": "https://campuswire.com/c", |
diff --git a/recipes/campuswire/webview.js b/recipes/campuswire/webview.js index d77d162..f3a7e67 100644 --- a/recipes/campuswire/webview.js +++ b/recipes/campuswire/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = document.querySelectorAll( | 9 | let count = document.querySelectorAll( |
@@ -38,4 +44,6 @@ module.exports = Ferdium => { | |||
38 | return notification; | 44 | return notification; |
39 | }); | 45 | }); |
40 | } | 46 | } |
47 | |||
48 | Ferdium.injectCSS(_path.default.join(__dirname, 'css', 'franz.css')); | ||
41 | }; | 49 | }; |
diff --git a/recipes/canvas/package.json b/recipes/canvas/package.json index a79ae39..72a7001 100644 --- a/recipes/canvas/package.json +++ b/recipes/canvas/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "canvas", | 2 | "id": "canvas", |
3 | "name": "Canvas", | 3 | "name": "Canvas", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.instructure.com/", | 7 | "serviceURL": "https://{teamId}.instructure.com/", |
diff --git a/recipes/canvas/webview.js b/recipes/canvas/webview.js index 5294f66..6e35c04 100644 --- a/recipes/canvas/webview.js +++ b/recipes/canvas/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let direct = 0; | 9 | let direct = 0; |
@@ -13,4 +19,6 @@ module.exports = Ferdium => { | |||
13 | }; | 19 | }; |
14 | 20 | ||
15 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
22 | |||
23 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
16 | }; | 24 | }; |
diff --git a/recipes/chatgpt/index.js b/recipes/chatgpt/index.js index 80eaf51..1392dcb 100644 --- a/recipes/chatgpt/index.js +++ b/recipes/chatgpt/index.js | |||
@@ -1,18 +1,23 @@ | |||
1 | module.exports = (Ferdium) => class Messenger extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Messenger extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') | ||
6 | .trim(); | ||
7 | } | ||
5 | 8 | ||
6 | modifyRequestHeaders() { | 9 | modifyRequestHeaders() { |
7 | return [ | 10 | return [ |
8 | { | 11 | { |
9 | headers: { | 12 | headers: { |
10 | 'user-agent': window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(), | 13 | 'user-agent': window.navigator.userAgent |
14 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') | ||
15 | .trim(), | ||
16 | }, | ||
17 | requestFilters: { | ||
18 | urls: ['*://*/*'], | ||
19 | }, | ||
11 | }, | 20 | }, |
12 | requestFilters: { | 21 | ]; |
13 | urls: ['*://*/*'], | 22 | } |
14 | }, | 23 | }; |
15 | }, | ||
16 | ]; | ||
17 | } | ||
18 | }; | ||
diff --git a/recipes/chatgpt/package.json b/recipes/chatgpt/package.json index f5dbfbc..b6f87cc 100644 --- a/recipes/chatgpt/package.json +++ b/recipes/chatgpt/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatgpt", | 2 | "id": "chatgpt", |
3 | "name": "ChatGPT", | 3 | "name": "ChatGPT", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://chat.openai.com/chat" | 7 | "serviceURL": "https://chat.openai.com/chat" |
diff --git a/recipes/chatgpt/webview.js b/recipes/chatgpt/webview.js index 2ebc1f3..a471ad3 100644 --- a/recipes/chatgpt/webview.js +++ b/recipes/chatgpt/webview.js | |||
@@ -1,5 +1,13 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | Ferdium.handleDarkMode(isEnabled => { | 8 | Ferdium.handleDarkMode(isEnabled => { |
3 | localStorage.setItem('theme', isEnabled ? 'dark' : 'light' ); | 9 | localStorage.setItem('theme', isEnabled ? 'dark' : 'light'); |
4 | }); | 10 | }); |
11 | |||
12 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
5 | }; | 13 | }; |
diff --git a/recipes/chatra/package.json b/recipes/chatra/package.json index 22fa8c0..732b00e 100644 --- a/recipes/chatra/package.json +++ b/recipes/chatra/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatra", | 2 | "id": "chatra", |
3 | "name": "Chatra", | 3 | "name": "Chatra", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.chatra.io/", | 7 | "serviceURL": "https://app.chatra.io/", |
diff --git a/recipes/chatra/webview.js b/recipes/chatra/webview.js index c1e6b7f..be4822f 100644 --- a/recipes/chatra/webview.js +++ b/recipes/chatra/webview.js | |||
@@ -1,10 +1,22 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // get new conversations in My Queue | 9 | // get new conversations in My Queue |
4 | const myQueue = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:my"] .count').not('.count--gray').text(); | 10 | const myQueue = $( |
11 | '.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:my"] .count', | ||
12 | ) | ||
13 | .not('.count--gray') | ||
14 | .text(); | ||
5 | 15 | ||
6 | // get all missed conversations | 16 | // get all missed conversations |
7 | const missed = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:missed"] .count').text(); | 17 | const missed = $( |
18 | '.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:missed"] .count', | ||
19 | ).text(); | ||
8 | 20 | ||
9 | // set Ferdium badge | 21 | // set Ferdium badge |
10 | // myQueue => New conversations in My Queue | 22 | // myQueue => New conversations in My Queue |
@@ -13,4 +25,6 @@ module.exports = (Ferdium) => { | |||
13 | }; | 25 | }; |
14 | 26 | ||
15 | Ferdium.loop(getMessages); | 27 | Ferdium.loop(getMessages); |
28 | |||
29 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
16 | }; | 30 | }; |
diff --git a/recipes/chatwithgpt/package.json b/recipes/chatwithgpt/package.json index 42748dc..98207d5 100644 --- a/recipes/chatwithgpt/package.json +++ b/recipes/chatwithgpt/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatwithgpt", | 2 | "id": "chatwithgpt", |
3 | "name": "Chat with GPT", | 3 | "name": "Chat with GPT", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.chatwithgpt.ai/" | 7 | "serviceURL": "https://www.chatwithgpt.ai/" |
diff --git a/recipes/chatwithgpt/webview.js b/recipes/chatwithgpt/webview.js index 56a20b6..1119219 100644 --- a/recipes/chatwithgpt/webview.js +++ b/recipes/chatwithgpt/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/chatwoot/index.js b/recipes/chatwoot/index.js index 244fe33..dd41f72 100644 --- a/recipes/chatwoot/index.js +++ b/recipes/chatwoot/index.js | |||
@@ -1 +1 @@ | |||
module.exports = (Ferdium) => Ferdium; | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/chatwoot/package.json b/recipes/chatwoot/package.json index c3c1a79..7a4af8d 100644 --- a/recipes/chatwoot/package.json +++ b/recipes/chatwoot/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatwoot", | 2 | "id": "chatwoot", |
3 | "name": "Chatwoot", | 3 | "name": "Chatwoot", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/maximeMD/ferdi-chatwoot", | 6 | "repository": "https://github.com/maximeMD/ferdi-chatwoot", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/chatwoot/webview.js b/recipes/chatwoot/webview.js index d61b87f..83b9ea7 100644 --- a/recipes/chatwoot/webview.js +++ b/recipes/chatwoot/webview.js | |||
@@ -1,6 +1,12 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
3 | const unreadBadges = document.querySelectorAll("span.unread"); | 9 | const unreadBadges = document.querySelectorAll('span.unread'); |
4 | const unreadBadgesArray = [...unreadBadges]; | 10 | const unreadBadgesArray = [...unreadBadges]; |
5 | const unreadMessagesCount = unreadBadgesArray.reduce( | 11 | const unreadMessagesCount = unreadBadgesArray.reduce( |
6 | (previousValue, currentBadge) => | 12 | (previousValue, currentBadge) => |
@@ -11,4 +17,6 @@ module.exports = (Ferdium) => { | |||
11 | }; | 17 | }; |
12 | 18 | ||
13 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 22 | }; |
diff --git a/recipes/chatwork/package.json b/recipes/chatwork/package.json index 6dd5b0d..7e7fceb 100644 --- a/recipes/chatwork/package.json +++ b/recipes/chatwork/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatwork", | 2 | "id": "chatwork", |
3 | "name": "Chatwork", | 3 | "name": "Chatwork", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/hideosasaki/recipe-chatwork", | 6 | "repository": "https://github.com/hideosasaki/recipe-chatwork", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/chatwork/webview.js b/recipes/chatwork/webview.js index 6b961ed..f1b5f0d 100644 --- a/recipes/chatwork/webview.js +++ b/recipes/chatwork/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directCount = 0; | 9 | let directCount = 0; |
@@ -16,18 +22,16 @@ module.exports = Ferdium => { | |||
16 | 22 | ||
17 | if (count > 0) { | 23 | if (count > 0) { |
18 | if ( | 24 | if ( |
19 | !room | 25 | room |
20 | .querySelector('img.sc-gqjmRU') | 26 | .querySelector('img.sc-gqjmRU') |
21 | .getAttribute('src') | 27 | .getAttribute('src') |
22 | .includes('avatar') | 28 | .includes('avatar') |
23 | ) { | 29 | ) { |
24 | if (unreadBadgeHasMention) { | 30 | directCount += 1; |
25 | directCount++; | 31 | } else if (unreadBadgeHasMention) { |
26 | } else { | 32 | directCount += 1; |
27 | indirectCount++; | ||
28 | } | ||
29 | } else { | 33 | } else { |
30 | directCount++; | 34 | indirectCount += 1; |
31 | } | 35 | } |
32 | } | 36 | } |
33 | }); | 37 | }); |
@@ -35,4 +39,6 @@ module.exports = Ferdium => { | |||
35 | }; | 39 | }; |
36 | 40 | ||
37 | Ferdium.loop(getMessages); | 41 | Ferdium.loop(getMessages); |
42 | |||
43 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
38 | }; | 44 | }; |
diff --git a/recipes/cinny/package.json b/recipes/cinny/package.json index 511d1f2..f42d794 100644 --- a/recipes/cinny/package.json +++ b/recipes/cinny/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "cinny", | 2 | "id": "cinny", |
3 | "name": "Cinny", | 3 | "name": "Cinny", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "Matrix" | 7 | "Matrix" |
diff --git a/recipes/cinny/webview.js b/recipes/cinny/webview.js index f4fd306..c17cc79 100644 --- a/recipes/cinny/webview.js +++ b/recipes/cinny/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | function getMessages() { | 8 | function getMessages() { |
3 | // Number of messages from rooms which has "All Messages" notifications enabled or when mentionned in a room with "Mentions & Keyword" notifications level. | 9 | // Number of messages from rooms which has "All Messages" notifications enabled or when mentionned in a room with "Mentions & Keyword" notifications level. |
@@ -9,7 +15,7 @@ module.exports = Ferdium => { | |||
9 | const badges = document.querySelectorAll('.sidebar .notification-badge'); | 15 | const badges = document.querySelectorAll('.sidebar .notification-badge'); |
10 | for (const badge of badges) { | 16 | for (const badge of badges) { |
11 | if (badge.childNodes.length === 0) { | 17 | if (badge.childNodes.length === 0) { |
12 | indirectCount++; | 18 | indirectCount += 1; |
13 | } else { | 19 | } else { |
14 | directCount += Ferdium.safeParseInt(badge.childNodes[0].textContent); | 20 | directCount += Ferdium.safeParseInt(badge.childNodes[0].textContent); |
15 | } | 21 | } |
@@ -19,4 +25,6 @@ module.exports = Ferdium => { | |||
19 | Ferdium.setBadge(directCount, indirectCount); | 25 | Ferdium.setBadge(directCount, indirectCount); |
20 | } | 26 | } |
21 | Ferdium.loop(getMessages); | 27 | Ferdium.loop(getMessages); |
28 | |||
29 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | 30 | }; |
diff --git a/recipes/circuit/package.json b/recipes/circuit/package.json index 9f14709..bd986e8 100644 --- a/recipes/circuit/package.json +++ b/recipes/circuit/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "circuit", | 2 | "id": "circuit", |
3 | "name": "Circuit", | 3 | "name": "Circuit", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://eu.yourcircuit.com/" | 7 | "serviceURL": "https://eu.yourcircuit.com/" |
diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js index 62c35fa..43c73fd 100644 --- a/recipes/circuit/webview.js +++ b/recipes/circuit/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // Get value of <title> tag where in case of new messages the number of messages appear | 9 | // Get value of <title> tag where in case of new messages the number of messages appear |
@@ -6,7 +12,7 @@ module.exports = Ferdium => { | |||
6 | const titleValue = title.text; | 12 | const titleValue = title.text; |
7 | // Extract the number from the tag | 13 | // Extract the number from the tag |
8 | const match = titleValue.match(/\d+/); | 14 | const match = titleValue.match(/\d+/); |
9 | const unread = match != null && match.length > 0 ? match[0] : 0; | 15 | const unread = match !== null && match.length > 0 ? match[0] : 0; |
10 | 16 | ||
11 | // Set unread msgs badge | 17 | // Set unread msgs badge |
12 | Ferdium.setBadge(Ferdium.safeParseInt(unread)); | 18 | Ferdium.setBadge(Ferdium.safeParseInt(unread)); |
@@ -14,4 +20,6 @@ module.exports = Ferdium => { | |||
14 | }; | 20 | }; |
15 | 21 | ||
16 | Ferdium.loop(getMessages); | 22 | Ferdium.loop(getMessages); |
23 | |||
24 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
17 | }; | 25 | }; |
diff --git a/recipes/ciscospark/package.json b/recipes/ciscospark/package.json index 8e7b16b..64e0b9d 100644 --- a/recipes/ciscospark/package.json +++ b/recipes/ciscospark/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "ciscospark", | 2 | "id": "ciscospark", |
3 | "name": "Cisco Spark", | 3 | "name": "Cisco Spark", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.ciscospark.com", | 7 | "serviceURL": "https://web.ciscospark.com", |
diff --git a/recipes/ciscospark/webview.js b/recipes/ciscospark/webview.js index 4af8a2d..560bee8 100644 --- a/recipes/ciscospark/webview.js +++ b/recipes/ciscospark/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const UNREAD_BADGE_SELECTOR = '.navigation-item--badgeCount'; | 8 | const UNREAD_BADGE_SELECTOR = '.navigation-item--badgeCount'; |
@@ -9,12 +11,24 @@ module.exports = Ferdium => { | |||
9 | let directCount = 0; | 11 | let directCount = 0; |
10 | let indirectCount = 0; | 12 | let indirectCount = 0; |
11 | 13 | ||
12 | const elements = document.querySelectorAll('.navigation-bar-list .listItemWrapper'); | 14 | const elements = document.querySelectorAll( |
13 | if (elements.length > 0 && elements[1].querySelector(UNREAD_BADGE_SELECTOR)) { | 15 | '.navigation-bar-list .listItemWrapper', |
14 | directCount = Ferdium.safeParseInt(elements[1].querySelector(UNREAD_BADGE_SELECTOR).textContent); | 16 | ); |
17 | if ( | ||
18 | elements.length > 0 && | ||
19 | elements[1].querySelector(UNREAD_BADGE_SELECTOR) | ||
20 | ) { | ||
21 | directCount = Ferdium.safeParseInt( | ||
22 | elements[1].querySelector(UNREAD_BADGE_SELECTOR).textContent, | ||
23 | ); | ||
15 | } | 24 | } |
16 | if (elements.length > 1 && elements[2].querySelector(UNREAD_BADGE_SELECTOR)) { | 25 | if ( |
17 | indirectCount = Ferdium.safeParseInt(elements[2].querySelector(UNREAD_BADGE_SELECTOR).textContent); | 26 | elements.length > 1 && |
27 | elements[2].querySelector(UNREAD_BADGE_SELECTOR) | ||
28 | ) { | ||
29 | indirectCount = Ferdium.safeParseInt( | ||
30 | elements[2].querySelector(UNREAD_BADGE_SELECTOR).textContent, | ||
31 | ); | ||
18 | } | 32 | } |
19 | 33 | ||
20 | Ferdium.setBadge(directCount, indirectCount); | 34 | Ferdium.setBadge(directCount, indirectCount); |
diff --git a/recipes/citrix-workspace/package.json b/recipes/citrix-workspace/package.json index b7f8619..db8d437 100644 --- a/recipes/citrix-workspace/package.json +++ b/recipes/citrix-workspace/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "citrix-workspace", | 2 | "id": "citrix-workspace", |
3 | "name": "Citrix Workspace", | 3 | "name": "Citrix Workspace", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.cloud.com", | 7 | "serviceURL": "https://{teamId}.cloud.com", |
diff --git a/recipes/citrix-workspace/webview.js b/recipes/citrix-workspace/webview.js index 56a20b6..1119219 100644 --- a/recipes/citrix-workspace/webview.js +++ b/recipes/citrix-workspace/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/clickup/package.json b/recipes/clickup/package.json index c55dc7b..db07055 100644 --- a/recipes/clickup/package.json +++ b/recipes/clickup/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "clickup", | 2 | "id": "clickup", |
3 | "name": "ClickUp", | 3 | "name": "ClickUp", |
4 | "version": "2.3.0", | 4 | "version": "2.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.clickup.com", | 7 | "serviceURL": "https://app.clickup.com", |
diff --git a/recipes/clickup/webview.js b/recipes/clickup/webview.js index 55ece28..2cc448e 100644 --- a/recipes/clickup/webview.js +++ b/recipes/clickup/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const unread = document.querySelector('.cu-notification-alert__dot'); | 9 | const unread = document.querySelector('.cu-notification-alert__dot'); |
@@ -5,4 +11,6 @@ module.exports = Ferdium => { | |||
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/cliq/package.json b/recipes/cliq/package.json index 56b2b6e..61e2725 100644 --- a/recipes/cliq/package.json +++ b/recipes/cliq/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "cliq", | 2 | "id": "cliq", |
3 | "name": "Cliq", | 3 | "name": "Cliq", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "repository": "https://github.com/cliqgeek/recipe-cliq", | 5 | "repository": "https://github.com/cliqgeek/recipe-cliq", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.zoho.com/cliq/login.html", | 7 | "serviceURL": "https://www.zoho.com/cliq/login.html", |
diff --git a/recipes/cliq/webview.js b/recipes/cliq/webview.js index 86bb422..2a81dec 100644 --- a/recipes/cliq/webview.js +++ b/recipes/cliq/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/clockify/package.json b/recipes/clockify/package.json index d02c3aa..0eb1cf7 100644 --- a/recipes/clockify/package.json +++ b/recipes/clockify/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "clockify", | 2 | "id": "clockify", |
3 | "name": "Clockify", | 3 | "name": "Clockify", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://clockify.me/tracker", | 7 | "serviceURL": "https://clockify.me/tracker", |
diff --git a/recipes/clockify/webview.js b/recipes/clockify/webview.js index 6908949..de8719e 100644 --- a/recipes/clockify/webview.js +++ b/recipes/clockify/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const notifications = document.querySelectorAll('.notification--number'); | 9 | const notifications = document.querySelectorAll('.notification--number'); |
@@ -5,4 +11,6 @@ module.exports = Ferdium => { | |||
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/clockwise/package.json b/recipes/clockwise/package.json index 859b0fa..352c192 100644 --- a/recipes/clockwise/package.json +++ b/recipes/clockwise/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "clockwise", | 2 | "id": "clockwise", |
3 | "name": "Clockwise", | 3 | "name": "Clockwise", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/TheKevJames/franz-recipe-clockwise", | 6 | "repository": "https://github.com/TheKevJames/franz-recipe-clockwise", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/clockwise/webview.js b/recipes/clockwise/webview.js index 86bb422..2a81dec 100644 --- a/recipes/clockwise/webview.js +++ b/recipes/clockwise/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/clubhouse/package.json b/recipes/clubhouse/package.json index 5c40bf7..b7260e5 100644 --- a/recipes/clubhouse/package.json +++ b/recipes/clubhouse/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "clubhouse", | 2 | "id": "clubhouse", |
3 | "name": "Clubhouse", | 3 | "name": "Clubhouse", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/dnlnrs/ferdi-recipe-clubhouse", | 6 | "repository": "https://github.com/dnlnrs/ferdi-recipe-clubhouse", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/clubhouse/webview.js b/recipes/clubhouse/webview.js index bcb0281..d75dc37 100644 --- a/recipes/clubhouse/webview.js +++ b/recipes/clubhouse/webview.js | |||
@@ -1,8 +1,18 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const hasNotifications = document.querySelector('#notifications-link .badge').classList.contains('visible'); | 9 | const hasNotifications = document |
10 | .querySelector('#notifications-link .badge') | ||
11 | .classList.contains('visible'); | ||
4 | Ferdium.setBadge(0, hasNotifications ? 1 : 0); | 12 | Ferdium.setBadge(0, hasNotifications ? 1 : 0); |
5 | } | 13 | }; |
6 | 14 | ||
7 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 18 | }; |
diff --git a/recipes/coinbase/package.json b/recipes/coinbase/package.json index 12ef269..e188dee 100644 --- a/recipes/coinbase/package.json +++ b/recipes/coinbase/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "coinbase", | 2 | "id": "coinbase", |
3 | "name": "Coinbase", | 3 | "name": "Coinbase", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/gaspergrom/Franz-services", | 6 | "repository": "https://github.com/gaspergrom/Franz-services", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/coinbase/webview.js b/recipes/coinbase/webview.js index be6157e..1119219 100644 --- a/recipes/coinbase/webview.js +++ b/recipes/coinbase/webview.js | |||
@@ -1,7 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
7 | }; | 9 | }; |
diff --git a/recipes/confluence/package.json b/recipes/confluence/package.json index 4d2c8cf..8996280 100644 --- a/recipes/confluence/package.json +++ b/recipes/confluence/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "confluence", | 2 | "id": "confluence", |
3 | "name": "Confluence", | 3 | "name": "Confluence", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/confluence/webview.js b/recipes/confluence/webview.js index e5d319c..04da834 100644 --- a/recipes/confluence/webview.js +++ b/recipes/confluence/webview.js | |||
@@ -1,8 +1,20 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const unreadMessageCountElement = document.querySelector('#notifications-anchor .badge'); | 9 | const unreadMessageCountElement = document.querySelector( |
4 | const unreadMessagesCount = Ferdium.safeParseInt(unreadMessageCountElement.textContent); | 10 | '#notifications-anchor .badge', |
11 | ); | ||
12 | const unreadMessagesCount = Ferdium.safeParseInt( | ||
13 | unreadMessageCountElement.textContent, | ||
14 | ); | ||
5 | Ferdium.setBadge(unreadMessagesCount, 0); | 15 | Ferdium.setBadge(unreadMessagesCount, 0); |
6 | }; | 16 | }; |
7 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 20 | }; |
diff --git a/recipes/crowdin/package.json b/recipes/crowdin/package.json index c3437d6..6ccb492 100644 --- a/recipes/crowdin/package.json +++ b/recipes/crowdin/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "crowdin", | 2 | "id": "crowdin", |
3 | "name": "Crowdin", | 3 | "name": "Crowdin", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://crowdin.com/profile" | 7 | "serviceURL": "https://crowdin.com/profile" |
diff --git a/recipes/crowdin/webview.js b/recipes/crowdin/webview.js index 56a20b6..1119219 100644 --- a/recipes/crowdin/webview.js +++ b/recipes/crowdin/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/deepl/package.json b/recipes/deepl/package.json index 329e61a..b10a603 100644 --- a/recipes/deepl/package.json +++ b/recipes/deepl/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "deepl", | 2 | "id": "deepl", |
3 | "name": "DeepL", | 3 | "name": "DeepL", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.deepl.com/translator" | 7 | "serviceURL": "https://www.deepl.com/translator" |
diff --git a/recipes/deepl/webview.js b/recipes/deepl/webview.js index 56a20b6..1119219 100644 --- a/recipes/deepl/webview.js +++ b/recipes/deepl/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/dev-community/package.json b/recipes/dev-community/package.json index 0dd7e7f..c3640b7 100644 --- a/recipes/dev-community/package.json +++ b/recipes/dev-community/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "dev-community", | 2 | "id": "dev-community", |
3 | "name": "Dev Community", | 3 | "name": "Dev Community", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://dev.to" | 7 | "serviceURL": "https://dev.to" |
diff --git a/recipes/dev-community/webview.js b/recipes/dev-community/webview.js index 56a20b6..1119219 100644 --- a/recipes/dev-community/webview.js +++ b/recipes/dev-community/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/devRant/package.json b/recipes/devRant/package.json index edb0c40..e1b65ff 100644 --- a/recipes/devRant/package.json +++ b/recipes/devRant/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "devRant", | 2 | "id": "devRant", |
3 | "name": "devRant", | 3 | "name": "devRant", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/emamut/recipe-devrant", | 6 | "repository": "https://github.com/emamut/recipe-devrant", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/devRant/webview.js b/recipes/devRant/webview.js index efe0d71..1a5cbb8 100644 --- a/recipes/devRant/webview.js +++ b/recipes/devRant/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | setTimeout(() => { | 7 | setTimeout(() => { |
8 | const elem = document.querySelector('.landing-title.version-title'); | 8 | const elem = document.querySelector('.landing-title.version-title'); |
9 | if ( | 9 | if ( |
@@ -45,5 +45,6 @@ module.exports = (Ferdium, settings) => { | |||
45 | }); | 45 | }); |
46 | 46 | ||
47 | Ferdium.loop(getMessages); | 47 | Ferdium.loop(getMessages); |
48 | |||
48 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 49 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
49 | }; | 50 | }; |
diff --git a/recipes/devdocs/package.json b/recipes/devdocs/package.json index ab3a25b..df85cb0 100644 --- a/recipes/devdocs/package.json +++ b/recipes/devdocs/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "devdocs", | 2 | "id": "devdocs", |
3 | "name": "DevDocs", | 3 | "name": "DevDocs", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://devdocs.io" | 7 | "serviceURL": "https://devdocs.io" |
diff --git a/recipes/devdocs/webview.js b/recipes/devdocs/webview.js index 86bb422..2a81dec 100644 --- a/recipes/devdocs/webview.js +++ b/recipes/devdocs/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/dialpad/package.json b/recipes/dialpad/package.json index 18f8561..b72f1b5 100644 --- a/recipes/dialpad/package.json +++ b/recipes/dialpad/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "dialpad", | 2 | "id": "dialpad", |
3 | "name": "Dialpad", | 3 | "name": "Dialpad", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/TheKevJames/franz-recipe-dialpad", | 6 | "repository": "https://github.com/TheKevJames/franz-recipe-dialpad", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/dialpad/webview.js b/recipes/dialpad/webview.js index 75b53d6..2a03cde 100644 --- a/recipes/dialpad/webview.js +++ b/recipes/dialpad/webview.js | |||
@@ -1,14 +1,22 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | var unreadCount = 0; | 9 | let unreadCount = 0; |
8 | $.each($('[data-qa-has-unreads]'), (idx, item) => unreadCount += Ferdium.safeParseInt(item.attributes["data-qa-has-unreads"].value)); | 10 | $.each( |
11 | $('[data-qa-has-unreads]'), | ||
12 | (idx, item) => | ||
13 | (unreadCount += Ferdium.safeParseInt( | ||
14 | item.attributes['data-qa-has-unreads'].value, | ||
15 | )), | ||
16 | ); | ||
9 | 17 | ||
10 | Ferdium.setBadge(unreadCount); | 18 | Ferdium.setBadge(unreadCount); |
11 | } | 19 | }; |
12 | 20 | ||
13 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
14 | 22 | ||
diff --git a/recipes/dingtalk/package.json b/recipes/dingtalk/package.json index 9657e25..2e3b455 100644 --- a/recipes/dingtalk/package.json +++ b/recipes/dingtalk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "dingtalk", | 2 | "id": "dingtalk", |
3 | "name": "Dingtalk", | 3 | "name": "Dingtalk", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://im.dingtalk.com/", | 7 | "serviceURL": "https://im.dingtalk.com/", |
diff --git a/recipes/dingtalk/webview.js b/recipes/dingtalk/webview.js index 621285c..b18cc59 100644 --- a/recipes/dingtalk/webview.js +++ b/recipes/dingtalk/webview.js | |||
@@ -1,22 +1,22 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | let checkIsRun = false; | 8 | let checkIsRun = false; |
9 | const checkHeightAction = () => { | 9 | const checkHeightAction = () => { |
10 | checkIsRun = true; | 10 | checkIsRun = true; |
11 | let checkHeight = setInterval(() => { | 11 | const checkHeight = setInterval(() => { |
12 | let menuPanel = document.querySelector('#menu-pannel'); | 12 | const menuPanel = document.querySelector('#menu-pannel'); |
13 | if (!menuPanel) { | 13 | if (!menuPanel) { |
14 | return; | 14 | return; |
15 | } | 15 | } |
16 | if (menuPanel.parentElement) { | 16 | if (menuPanel.parentElement) { |
17 | menuPanel.parentElement.setAttribute( | 17 | menuPanel.parentElement.setAttribute( |
18 | 'style', | 18 | 'style', |
19 | 'height:' + (window.outerHeight - 60) + 'px', | 19 | `height:${window.outerHeight - 60}px`, |
20 | ); | 20 | ); |
21 | } | 21 | } |
22 | clearInterval(checkHeight); | 22 | clearInterval(checkHeight); |
diff --git a/recipes/discord/index.js b/recipes/discord/index.js index cd65352..e47dd76 100644 --- a/recipes/discord/index.js +++ b/recipes/discord/index.js | |||
@@ -1,8 +1,10 @@ | |||
1 | module.exports = Ferdium => class Discord extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Discord extends Ferdium { |
3 | return window.navigator.userAgent.replace('(KHTML, like Gecko)', '(KHTML, like Gecko) discord/0.0.250') | 3 | overrideUserAgent() { |
4 | .replace('Electron', 'Discord') | 4 | return window.navigator.userAgent |
5 | .replace('Ferdium', 'Discord') | 5 | .replace('(KHTML, like Gecko)', '(KHTML, like Gecko) discord/0.0.250') |
6 | .replace('Apple Mac OS X', 'Intel Mac OS X'); | 6 | .replace('Electron', 'Discord') |
7 | } | 7 | .replace('Ferdium', 'Discord') |
8 | }; | 8 | .replace('Apple Mac OS X', 'Intel Mac OS X'); |
9 | } | ||
10 | }; | ||
diff --git a/recipes/discord/package.json b/recipes/discord/package.json index 59cf22a..aed5e15 100644 --- a/recipes/discord/package.json +++ b/recipes/discord/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "discord", | 2 | "id": "discord", |
3 | "name": "Discord", | 3 | "name": "Discord", |
4 | "version": "1.7.10", | 4 | "version": "1.8.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://discord.com/login", | 7 | "serviceURL": "https://discord.com/login", |
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js index c0c764d..ef56336 100644 --- a/recipes/discord/webview.js +++ b/recipes/discord/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let directCount = 0; | 9 | let directCount = 0; |
@@ -27,30 +27,39 @@ module.exports = (Ferdium, settings) => { | |||
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
28 | 28 | ||
29 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences | 29 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences |
30 | document.addEventListener('click', event => { | 30 | document.addEventListener( |
31 | const link = event.target.closest('a[href^="http"]'); | 31 | 'click', |
32 | const button = event.target.closest('button[title^="http"]'); | 32 | event => { |
33 | 33 | const link = event.target.closest('a[href^="http"]'); | |
34 | if (link || button) { | 34 | const button = event.target.closest('button[title^="http"]'); |
35 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); | 35 | |
36 | const skipDomains = [/^https:\/\/discordapp\.com\/channels\//i, /^https:\/\/discord\.com\/channels\//i]; | 36 | if (link || button) { |
37 | 37 | const url = link | |
38 | let stayInsideDiscord; | 38 | ? link.getAttribute('href') |
39 | skipDomains.every(skipDomain => { | 39 | : button.getAttribute('title'); |
40 | stayInsideDiscord = skipDomain.test(url); | 40 | const skipDomains = [ |
41 | return !stayInsideDiscord; | 41 | /^https:\/\/discordapp\.com\/channels\//i, |
42 | }); | 42 | /^https:\/\/discord\.com\/channels\//i, |
43 | 43 | ]; | |
44 | if (!Ferdium.isImage(link) && !stayInsideDiscord) { | 44 | |
45 | event.preventDefault(); | 45 | let stayInsideDiscord; |
46 | event.stopPropagation(); | 46 | skipDomains.every(skipDomain => { |
47 | 47 | stayInsideDiscord = skipDomain.test(url); | |
48 | if (settings.trapLinkClicks === true) { | 48 | return !stayInsideDiscord; |
49 | window.location.href = url; | 49 | }); |
50 | } else { | 50 | |
51 | Ferdium.openNewWindow(url); | 51 | if (!Ferdium.isImage(link) && !stayInsideDiscord) { |
52 | event.preventDefault(); | ||
53 | event.stopPropagation(); | ||
54 | |||
55 | if (settings.trapLinkClicks === true) { | ||
56 | window.location.href = url; | ||
57 | } else { | ||
58 | Ferdium.openNewWindow(url); | ||
59 | } | ||
52 | } | 60 | } |
53 | } | 61 | } |
54 | } | 62 | }, |
55 | }, true); | 63 | true, |
64 | ); | ||
56 | }; | 65 | }; |
diff --git a/recipes/discourse/package.json b/recipes/discourse/package.json index 2b33d15..ca87773 100644 --- a/recipes/discourse/package.json +++ b/recipes/discourse/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "discourse", | 2 | "id": "discourse", |
3 | "name": "Discourse", | 3 | "name": "Discourse", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [], | 6 | "aliases": [], |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/discourse/webview.js b/recipes/discourse/webview.js index dd41f72..1119219 100644 --- a/recipes/discourse/webview.js +++ b/recipes/discourse/webview.js | |||
@@ -1 +1,9 @@ | |||
1 | module.exports = Ferdium => Ferdium; | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | ||
diff --git a/recipes/disqus/package.json b/recipes/disqus/package.json index 6ac125a..9d19d39 100644 --- a/recipes/disqus/package.json +++ b/recipes/disqus/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "disqus", | 2 | "id": "disqus", |
3 | "name": "Disqus", | 3 | "name": "Disqus", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://disqus.com/home/" | 7 | "serviceURL": "https://disqus.com/home/" |
diff --git a/recipes/disqus/webview.js b/recipes/disqus/webview.js index 2de4b43..ce8d79e 100644 --- a/recipes/disqus/webview.js +++ b/recipes/disqus/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getInnerInt = selector => { | 8 | const getInnerInt = selector => { |
3 | const element = document.querySelector(selector); | 9 | const element = document.querySelector(selector); |
@@ -14,4 +20,6 @@ module.exports = Ferdium => { | |||
14 | }; | 20 | }; |
15 | 21 | ||
16 | Ferdium.loop(getMessages); | 22 | Ferdium.loop(getMessages); |
23 | |||
24 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
17 | }; | 25 | }; |
diff --git a/recipes/dockerhub/package.json b/recipes/dockerhub/package.json index 58aaf06..a0ae429 100644 --- a/recipes/dockerhub/package.json +++ b/recipes/dockerhub/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "dockerhub", | 2 | "id": "dockerhub", |
3 | "name": "Docker Hub", | 3 | "name": "Docker Hub", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://hub.docker.com" | 7 | "serviceURL": "https://hub.docker.com" |
diff --git a/recipes/dockerhub/webview.js b/recipes/dockerhub/webview.js index 86bb422..2a81dec 100644 --- a/recipes/dockerhub/webview.js +++ b/recipes/dockerhub/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/dropbox/package.json b/recipes/dropbox/package.json index 26d54f4..1fbb2e8 100644 --- a/recipes/dropbox/package.json +++ b/recipes/dropbox/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "dropbox", | 2 | "id": "dropbox", |
3 | "name": "Dropbox", | 3 | "name": "Dropbox", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.dropbox.com/home", | 7 | "serviceURL": "https://www.dropbox.com/home", |
diff --git a/recipes/dropbox/webview.js b/recipes/dropbox/webview.js index 12478d3..f8b38f6 100644 --- a/recipes/dropbox/webview.js +++ b/recipes/dropbox/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const hasNotifications = document.querySelector(".dig-NotificationBadge"); | 9 | const hasNotifications = document.querySelector('.dig-NotificationBadge'); |
4 | 10 | ||
5 | Ferdium.setBadge(0, hasNotifications ? 1 : 0); | 11 | Ferdium.setBadge(0, hasNotifications ? 1 : 0); |
6 | }; | 12 | }; |
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/easy-redmine/package.json b/recipes/easy-redmine/package.json index 718c665..b560754 100644 --- a/recipes/easy-redmine/package.json +++ b/recipes/easy-redmine/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "easy-redmine", | 2 | "id": "easy-redmine", |
3 | "name": "Easy Redmine", | 3 | "name": "Easy Redmine", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamID}.easyredmine.com", | 7 | "serviceURL": "https://{teamID}.easyredmine.com", |
diff --git a/recipes/easy-redmine/webview.js b/recipes/easy-redmine/webview.js index 86bb422..2a81dec 100644 --- a/recipes/easy-redmine/webview.js +++ b/recipes/easy-redmine/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/element/package.json b/recipes/element/package.json index 982fb3c..c0e03fc 100644 --- a/recipes/element/package.json +++ b/recipes/element/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "element", | 2 | "id": "element", |
3 | "name": "Element", | 3 | "name": "Element", |
4 | "version": "1.3.4", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "Riot.im", | 7 | "Riot.im", |
diff --git a/recipes/element/webview.js b/recipes/element/webview.js index f88baac..e00ff0e 100644 --- a/recipes/element/webview.js +++ b/recipes/element/webview.js | |||
@@ -1,13 +1,22 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | function getMessages() { | 8 | function getMessages() { |
3 | const matches = document.querySelector('title').textContent | 9 | const matches = document |
4 | .match('(?<=\\[)\\d+(?=])'); | 10 | .querySelector('title') |
5 | const directCount = Ferdium.safeParseInt(matches !== null ? matches[0] : 0); | 11 | .textContent.match('(?<=\\[)\\d+(?=])'); |
6 | const indirectCount = document.querySelector('.mx_SpaceTreeLevel') | 12 | const directCount = Ferdium.safeParseInt(matches === null ? 0 : matches[0]); |
7 | .querySelectorAll('.mx_NotificationBadge_dot') | 13 | const indirectCount = document |
8 | .length; | 14 | .querySelector('.mx_SpaceTreeLevel') |
15 | .querySelectorAll('.mx_NotificationBadge_dot').length; | ||
9 | Ferdium.setBadge(directCount, indirectCount); | 16 | Ferdium.setBadge(directCount, indirectCount); |
10 | } | 17 | } |
11 | 18 | ||
12 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 22 | }; |
diff --git a/recipes/elevate/package.json b/recipes/elevate/package.json index 25d4eb1..68f6d7b 100644 --- a/recipes/elevate/package.json +++ b/recipes/elevate/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "elevate", | 2 | "id": "elevate", |
3 | "name": "Elevate", | 3 | "name": "Elevate", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://elevate.serverdata.net" | 7 | "serviceURL": "https://elevate.serverdata.net" |
diff --git a/recipes/elevate/webview.js b/recipes/elevate/webview.js index 56a20b6..1119219 100644 --- a/recipes/elevate/webview.js +++ b/recipes/elevate/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/elk/package.json b/recipes/elk/package.json index 3f6c001..f853707 100644 --- a/recipes/elk/package.json +++ b/recipes/elk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "elk", | 2 | "id": "elk", |
3 | "name": "Elk", | 3 | "name": "Elk", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/jalil-salame/ferdium-elk-recipe", | 6 | "repository": "https://github.com/jalil-salame/ferdium-elk-recipe", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/elk/webview.js b/recipes/elk/webview.js index f284fd3..8388f60 100644 --- a/recipes/elk/webview.js +++ b/recipes/elk/webview.js | |||
@@ -1,23 +1,25 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
7 | module.exports = (Ferdium) => { | 5 | const _path = _interopRequireDefault(require('path')); |
6 | |||
7 | module.exports = Ferdium => { | ||
8 | // Inject css | 8 | // Inject css |
9 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 9 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
10 | 10 | ||
11 | // Get notifications | 11 | // Get notifications |
12 | Ferdium.loop(() => { | 12 | Ferdium.loop(() => { |
13 | const notifications = document.querySelectorAll("[href$=notifications]").item(0); | 13 | const notifications = document |
14 | .querySelectorAll('[href$=notifications]') | ||
15 | .item(0); | ||
14 | // Null if not present | 16 | // Null if not present |
15 | if (!notifications) { | 17 | if (!notifications) { |
16 | return; | 18 | return; |
17 | } | 19 | } |
18 | // Assume first element contains the number of notifications | 20 | // Assume first element contains the number of notifications |
19 | let parsedValue = Ferdium.safeParseInt(notifications.outerText); | 21 | const parsedValue = Ferdium.safeParseInt(notifications.outerText); |
20 | // Set to parsed value | 22 | // Set to parsed value |
21 | Ferdium.setBadge(parsedValue); | 23 | Ferdium.setBadge(parsedValue); |
22 | }); | 24 | }); |
23 | } | 25 | }; |
diff --git a/recipes/epicgames/package.json b/recipes/epicgames/package.json index 5025b41..fe9dfa3 100644 --- a/recipes/epicgames/package.json +++ b/recipes/epicgames/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "epicgames", | 2 | "id": "epicgames", |
3 | "name": "Epic Games Store", | 3 | "name": "Epic Games Store", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.epicgames.com/id/login?lang=en_US&redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fstore%2Fen-US%2F&noHostRedirect=true" | 7 | "serviceURL": "https://www.epicgames.com/id/login?lang=en_US&redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fstore%2Fen-US%2F&noHostRedirect=true" |
diff --git a/recipes/epicgames/webview.js b/recipes/epicgames/webview.js index 46366f4..1119219 100644 --- a/recipes/epicgames/webview.js +++ b/recipes/epicgames/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/erepublik/package.json b/recipes/erepublik/package.json index 9e88f35..975583f 100644 --- a/recipes/erepublik/package.json +++ b/recipes/erepublik/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "erepublik", | 2 | "id": "erepublik", |
3 | "name": "eRepublik", | 3 | "name": "eRepublik", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://erepublik.com" | 7 | "serviceURL": "https://erepublik.com" |
diff --git a/recipes/erepublik/webview.js b/recipes/erepublik/webview.js index 2f5bc9f..f2e2bde 100644 --- a/recipes/erepublik/webview.js +++ b/recipes/erepublik/webview.js | |||
@@ -1,11 +1,15 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const elementNotify = document.querySelectorAll('.notify'); | 9 | const elementNotify = document.querySelectorAll('.notify'); |
8 | const elementFeed = document.querySelectorAll('.unreadCounter.ng-binding.ng-scope'); | 10 | const elementFeed = document.querySelectorAll( |
11 | '.unreadCounter.ng-binding.ng-scope', | ||
12 | ); | ||
9 | 13 | ||
10 | let countNotify = 0; | 14 | let countNotify = 0; |
11 | let countFeed = 0; | 15 | let countFeed = 0; |
diff --git a/recipes/evernote/package.json b/recipes/evernote/package.json index 1b56d41..c7cca5f 100644 --- a/recipes/evernote/package.json +++ b/recipes/evernote/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "evernote", | 2 | "id": "evernote", |
3 | "name": "Evernote", | 3 | "name": "Evernote", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.evernote.com/Login.action" | 7 | "serviceURL": "https://www.evernote.com/Login.action" |
diff --git a/recipes/evernote/webview.js b/recipes/evernote/webview.js index 8178443..913d867 100644 --- a/recipes/evernote/webview.js +++ b/recipes/evernote/webview.js | |||
@@ -1,10 +1,14 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const inbox = document.querySelector('.topbar-notificationsButton.has-newNotifications'); | 9 | const inbox = document.querySelector( |
10 | '.topbar-notificationsButton.has-newNotifications', | ||
11 | ); | ||
8 | const passiveCount = inbox === null ? 0 : 1; | 12 | const passiveCount = inbox === null ? 0 : 1; |
9 | Ferdium.setBadge(0, passiveCount); | 13 | Ferdium.setBadge(0, passiveCount); |
10 | }; | 14 | }; |
diff --git a/recipes/facebook/package.json b/recipes/facebook/package.json index 238f422..65990a2 100755 --- a/recipes/facebook/package.json +++ b/recipes/facebook/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "facebook", | 2 | "id": "facebook", |
3 | "name": "Facebook", | 3 | "name": "Facebook", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.facebook.com/login" | 7 | "serviceURL": "https://www.facebook.com/login" |
diff --git a/recipes/facebook/webview.js b/recipes/facebook/webview.js index 1ff8558..f3ba1b6 100755 --- a/recipes/facebook/webview.js +++ b/recipes/facebook/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getNotifications = function getNotifications() { | 8 | const getNotifications = function getNotifications() { |
3 | let count = 0; | 9 | let count = 0; |
4 | 10 | ||
5 | const queryList = document.querySelectorAll('.bp9cbjyn.bwm1u5wc.pq6dq46d.datstx6m.taijpn5t.jb3vyjys.jxrgncrl.qt6c0cv9.qnrpqo6b.k4urcfbm'); | 11 | const queryList = document.querySelectorAll( |
12 | '.bp9cbjyn.bwm1u5wc.pq6dq46d.datstx6m.taijpn5t.jb3vyjys.jxrgncrl.qt6c0cv9.qnrpqo6b.k4urcfbm', | ||
13 | ); | ||
6 | for (const element of queryList) { | 14 | for (const element of queryList) { |
7 | count += Ferdium.safeParseInt(element.textContent); | 15 | count += Ferdium.safeParseInt(element.textContent); |
8 | } | 16 | } |
@@ -29,4 +37,6 @@ module.exports = Ferdium => { | |||
29 | }; | 37 | }; |
30 | 38 | ||
31 | Ferdium.loop(loopFunc); | 39 | Ferdium.loop(loopFunc); |
40 | |||
41 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
32 | }; | 42 | }; |
diff --git a/recipes/facebookpages/package.json b/recipes/facebookpages/package.json index 750264a..1727384 100644 --- a/recipes/facebookpages/package.json +++ b/recipes/facebookpages/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "facebookpages", | 2 | "id": "facebookpages", |
3 | "name": "Facebook Pages", | 3 | "name": "Facebook Pages", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://facebook.com/{teamId}/", | 7 | "serviceURL": "https://facebook.com/{teamId}/", |
diff --git a/recipes/facebookpages/webview.js b/recipes/facebookpages/webview.js index d624017..f1310e9 100644 --- a/recipes/facebookpages/webview.js +++ b/recipes/facebookpages/webview.js | |||
@@ -1,7 +1,15 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = (Ferdium, options) => { | 7 | module.exports = (Ferdium, options) => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let messages = 0; | 9 | let messages = 0; |
4 | const element = document.querySelector('[data-testid="message_count"] span'); | 10 | const element = document.querySelector( |
11 | '[data-testid="message_count"] span', | ||
12 | ); | ||
5 | 13 | ||
6 | if (element) { | 14 | if (element) { |
7 | messages = Ferdium.safeParseInt(element.textContent); | 15 | messages = Ferdium.safeParseInt(element.textContent); |
@@ -13,7 +21,10 @@ module.exports = (Ferdium, options) => { | |||
13 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
14 | 22 | ||
15 | setTimeout(() => { | 23 | setTimeout(() => { |
16 | if (document.body && !document.body.classList.contains('UIPage_LoggedOut')) { | 24 | if ( |
25 | document.body && | ||
26 | !document.body.classList.contains('UIPage_LoggedOut') | ||
27 | ) { | ||
17 | if (localStorage.getItem('franz-needsRedirect')) { | 28 | if (localStorage.getItem('franz-needsRedirect')) { |
18 | window.location.href = `https://facebook.com/${options.team}/inbox`; | 29 | window.location.href = `https://facebook.com/${options.team}/inbox`; |
19 | localStorage.removeItem('franz-needsRedirect'); | 30 | localStorage.removeItem('franz-needsRedirect'); |
@@ -22,4 +33,6 @@ module.exports = (Ferdium, options) => { | |||
22 | localStorage.setItem('franz-needsRedirect', 'true'); | 33 | localStorage.setItem('franz-needsRedirect', 'true'); |
23 | } | 34 | } |
24 | }, 500); | 35 | }, 500); |
36 | |||
37 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
25 | }; | 38 | }; |
diff --git a/recipes/fastmail/package.json b/recipes/fastmail/package.json index 425fb6b..afde16a 100644 --- a/recipes/fastmail/package.json +++ b/recipes/fastmail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "fastmail", | 2 | "id": "fastmail", |
3 | "name": "FastMail", | 3 | "name": "FastMail", |
4 | "version": "2.3.0", | 4 | "version": "2.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.fastmail.com/mail/", | 7 | "serviceURL": "https://www.fastmail.com/mail/", |
diff --git a/recipes/fastmail/webview.js b/recipes/fastmail/webview.js index 81127fb..84734c1 100644 --- a/recipes/fastmail/webview.js +++ b/recipes/fastmail/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const inbox = document.querySelector( | 9 | const inbox = document.querySelector( |
diff --git a/recipes/feedbin/package.json b/recipes/feedbin/package.json index 154fc12..206af02 100644 --- a/recipes/feedbin/package.json +++ b/recipes/feedbin/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "feedbin", | 2 | "id": "feedbin", |
3 | "name": "Feedbin", | 3 | "name": "Feedbin", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://feedbin.com/login", | 7 | "serviceURL": "https://feedbin.com/login", |
diff --git a/recipes/feedbin/webview.js b/recipes/feedbin/webview.js index f905e40..bb94366 100644 --- a/recipes/feedbin/webview.js +++ b/recipes/feedbin/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // eslint-disable-next-line no-undef | 9 | // eslint-disable-next-line no-undef |
@@ -6,4 +12,6 @@ module.exports = Ferdium => { | |||
6 | }; | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 17 | }; |
diff --git a/recipes/feedly/package.json b/recipes/feedly/package.json index 3e9a2bf..97ba54d 100644 --- a/recipes/feedly/package.json +++ b/recipes/feedly/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "feedly", | 2 | "id": "feedly", |
3 | "name": "Feedly", | 3 | "name": "Feedly", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://feedly.com" | 7 | "serviceURL": "https://feedly.com" |
diff --git a/recipes/feedly/webview.js b/recipes/feedly/webview.js index b4887bc..6f46d8e 100644 --- a/recipes/feedly/webview.js +++ b/recipes/feedly/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const newsDOM = document.querySelectorAll( | 9 | const newsDOM = document.querySelectorAll( |
@@ -7,13 +13,18 @@ module.exports = Ferdium => { | |||
7 | let counter = 0; | 13 | let counter = 0; |
8 | 14 | ||
9 | if (newsDOM && newsDOM.length > 0) { | 15 | if (newsDOM && newsDOM.length > 0) { |
10 | const textContent = newsDOM[0].textContent; | 16 | const { textContent } = newsDOM[0]; |
11 | 17 | ||
12 | counter = textContent.includes('K') || textContent.includes('+') ? `${textContent.slice(0, Math.max(0, textContent.indexOf('K')))}000` : Ferdium.safeParseInt(textContent); | 18 | counter = |
19 | textContent.includes('K') || textContent.includes('+') | ||
20 | ? `${textContent.slice(0, Math.max(0, textContent.indexOf('K')))}000` | ||
21 | : Ferdium.safeParseInt(textContent); | ||
13 | } | 22 | } |
14 | 23 | ||
15 | Ferdium.setBadge(counter); | 24 | Ferdium.setBadge(counter); |
16 | }; | 25 | }; |
17 | 26 | ||
18 | Ferdium.loop(getMessages); | 27 | Ferdium.loop(getMessages); |
28 | |||
29 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
19 | }; | 30 | }; |
diff --git a/recipes/figma/package.json b/recipes/figma/package.json index 64ff87f..8bc39ef 100644 --- a/recipes/figma/package.json +++ b/recipes/figma/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "figma", | 2 | "id": "figma", |
3 | "name": "Figma", | 3 | "name": "Figma", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://figma.com" | 7 | "serviceURL": "https://figma.com" |
diff --git a/recipes/figma/webview.js b/recipes/figma/webview.js index 86bb422..2a81dec 100644 --- a/recipes/figma/webview.js +++ b/recipes/figma/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/fleep/package.json b/recipes/fleep/package.json index 7cb338b..abcc913 100644 --- a/recipes/fleep/package.json +++ b/recipes/fleep/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "fleep", | 2 | "id": "fleep", |
3 | "name": "Fleep", | 3 | "name": "Fleep", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://fleep.io/chat" | 7 | "serviceURL": "https://fleep.io/chat" |
diff --git a/recipes/fleep/webview.js b/recipes/fleep/webview.js index 65c8133..1b42b59 100644 --- a/recipes/fleep/webview.js +++ b/recipes/fleep/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // Count number of conversations or teams with unread messages | 9 | // Count number of conversations or teams with unread messages |
@@ -6,4 +12,6 @@ module.exports = Ferdium => { | |||
6 | }; | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 17 | }; |
diff --git a/recipes/flock/package.json b/recipes/flock/package.json index 11932cf..ad7d192 100644 --- a/recipes/flock/package.json +++ b/recipes/flock/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "flock", | 2 | "id": "flock", |
3 | "name": "Flock", | 3 | "name": "Flock", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/jereddowden/franz-recipe-flock", | 6 | "repository": "https://github.com/jereddowden/franz-recipe-flock", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/flock/webview.js b/recipes/flock/webview.js index 1a74734..8bcc61f 100644 --- a/recipes/flock/webview.js +++ b/recipes/flock/webview.js | |||
@@ -1,7 +1,17 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const allMessages = Ferdium.safeParseInt(document.querySelector('.team-counter').textContent); | 9 | const allMessages = Ferdium.safeParseInt( |
10 | document.querySelector('.team-counter').textContent, | ||
11 | ); | ||
4 | Ferdium.setBadge(allMessages); | 12 | Ferdium.setBadge(allMessages); |
5 | }; | 13 | }; |
6 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
7 | }; | 17 | }; |
diff --git a/recipes/flowdock/package.json b/recipes/flowdock/package.json index db89ead..f36875e 100644 --- a/recipes/flowdock/package.json +++ b/recipes/flowdock/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "flowdock", | 2 | "id": "flowdock", |
3 | "name": "Flowdock", | 3 | "name": "Flowdock", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.flowdock.com/app/", | 7 | "serviceURL": "https://www.flowdock.com/app/", |
diff --git a/recipes/flowdock/webview.js b/recipes/flowdock/webview.js index 498424f..bff5b41 100644 --- a/recipes/flowdock/webview.js +++ b/recipes/flowdock/webview.js | |||
@@ -1,11 +1,23 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directMessages = document.querySelectorAll('.activity-indicator-mentions').length; | 9 | const directMessages = document.querySelectorAll( |
4 | const indirectMessages = document.querySelectorAll('.activity-indicator-chat').length; | 10 | '.activity-indicator-mentions', |
11 | ).length; | ||
12 | const indirectMessages = document.querySelectorAll( | ||
13 | '.activity-indicator-chat', | ||
14 | ).length; | ||
5 | 15 | ||
6 | // set Ferdium badge | 16 | // set Ferdium badge |
7 | Ferdium.setBadge(directMessages, indirectMessages); | 17 | Ferdium.setBadge(directMessages, indirectMessages); |
8 | }; | 18 | }; |
9 | 19 | ||
10 | Ferdium.loop(getMessages); | 20 | Ferdium.loop(getMessages); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 23 | }; |
diff --git a/recipes/franz-custom-website/package.json b/recipes/franz-custom-website/package.json index d3dcbba..775d9aa 100644 --- a/recipes/franz-custom-website/package.json +++ b/recipes/franz-custom-website/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "franz-custom-website", | 2 | "id": "franz-custom-website", |
3 | "name": "Custom Website", | 3 | "name": "Custom Website", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/meetfranz/recipe-custom-website", | 6 | "repository": "https://github.com/meetfranz/recipe-custom-website", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/franz-custom-website/webview.js b/recipes/franz-custom-website/webview.js index 072fed5..18f16a3 100644 --- a/recipes/franz-custom-website/webview.js +++ b/recipes/franz-custom-website/webview.js | |||
@@ -1,30 +1,36 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'style.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'style.css')); |
9 | 9 | ||
10 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences | 10 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences |
11 | document.addEventListener('click', event => { | 11 | document.addEventListener( |
12 | const link = event.target.closest('a[href^="http"]'); | 12 | 'click', |
13 | const button = event.target.closest('button[title^="http"]'); | 13 | event => { |
14 | const link = event.target.closest('a[href^="http"]'); | ||
15 | const button = event.target.closest('button[title^="http"]'); | ||
14 | 16 | ||
15 | if (link || button) { | 17 | if (link || button) { |
16 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); | 18 | const url = link |
19 | ? link.getAttribute('href') | ||
20 | : button.getAttribute('title'); | ||
17 | 21 | ||
18 | if (!Ferdium.isImage(link)) { | 22 | if (!Ferdium.isImage(link)) { |
19 | event.preventDefault(); | 23 | event.preventDefault(); |
20 | event.stopPropagation(); | 24 | event.stopPropagation(); |
21 | 25 | ||
22 | if (settings.trapLinkClicks === true) { | 26 | if (settings.trapLinkClicks === true) { |
23 | window.location.href = url; | 27 | window.location.href = url; |
24 | } else { | 28 | } else { |
25 | Ferdium.openNewWindow(url); | 29 | Ferdium.openNewWindow(url); |
30 | } | ||
26 | } | 31 | } |
27 | } | 32 | } |
28 | } | 33 | }, |
29 | }, true); | 34 | true, |
35 | ); | ||
30 | }; | 36 | }; |
diff --git a/recipes/freshdesk/package.json b/recipes/freshdesk/package.json index 376ee0c..924ada1 100644 --- a/recipes/freshdesk/package.json +++ b/recipes/freshdesk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "freshdesk", | 2 | "id": "freshdesk", |
3 | "name": "Freshdesk", | 3 | "name": "Freshdesk", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/fisknils/recipe-freshdesk", | 6 | "repository": "https://github.com/fisknils/recipe-freshdesk", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/freshdesk/webview.js b/recipes/freshdesk/webview.js index 3e0a201..023e2cd 100644 --- a/recipes/freshdesk/webview.js +++ b/recipes/freshdesk/webview.js | |||
@@ -1,14 +1,23 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | $.get('/api/_/tickets?filter=unresolved', (data) => { | 9 | $.get('/api/_/tickets?filter=unresolved', data => { |
4 | Ferdium.setBadge(data.tickets.length); | 10 | Ferdium.setBadge(data.tickets.length); |
5 | }); | 11 | }); |
6 | }; | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
9 | 15 | ||
10 | /* block popups (prevents freshconnect from opening in a new window) */ | 16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
11 | window.open = (function(url, name) { | 17 | |
18 | /* block popups (prevents freshconnect from opening in a new window) */ | ||
19 | window.open = function (url, name) { | ||
20 | // eslint-disable-next-line no-console | ||
12 | console.log(`blocked window.open(${url}, ${name})`); | 21 | console.log(`blocked window.open(${url}, ${name})`); |
13 | }); | 22 | }; |
14 | }; | 23 | }; |
diff --git a/recipes/freshrss/README.md b/recipes/freshrss/README.md deleted file mode 100644 index 3f50e87..0000000 --- a/recipes/freshrss/README.md +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # FreshRSS for Ferdium | ||
2 | |||
3 | Unofficial Ferdium recipe for [FeshRSS](https://freshrss.org/) | ||
diff --git a/recipes/freshrss/index.js b/recipes/freshrss/index.js index ede7c6d..6e9d311 100644 --- a/recipes/freshrss/index.js +++ b/recipes/freshrss/index.js | |||
@@ -1,5 +1,3 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | // just pass through ferdium | 1 | // just pass through ferdium |
4 | 2 | ||
5 | module.exports = Ferdium => Ferdium; | 3 | module.exports = Ferdium => Ferdium; |
diff --git a/recipes/freshrss/package.json b/recipes/freshrss/package.json index b0396d3..c893180 100644 --- a/recipes/freshrss/package.json +++ b/recipes/freshrss/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "freshrss", | 2 | "id": "freshrss", |
3 | "name": "FreshRSS", | 3 | "name": "FreshRSS", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/freshrss/webview.js b/recipes/freshrss/webview.js index cdc6e55..9740b08 100644 --- a/recipes/freshrss/webview.js +++ b/recipes/freshrss/webview.js | |||
@@ -1,18 +1,22 @@ | |||
1 | "use strict"; | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
2 | 6 | ||
3 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
4 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
5 | // Initialize empty vars | 9 | // Initialize empty vars |
6 | var unread = 0; | 10 | let unread = 0; |
7 | var match = []; | 11 | let match = []; |
8 | // Define RegExp to replace occasionally   | 12 | // Define RegExp to replace occasionally   |
9 | var re = new RegExp(String.fromCodePoint(160), "g"); | 13 | const re = new RegExp(String.fromCodePoint(160), 'g'); |
10 | // Get value of <title> tag where in case of new feed elements the number of elements appear | 14 | // Get value of <title> tag where in case of new feed elements the number of elements appear |
11 | const titleValue = document.querySelector('title').text.replace(re, ""); | 15 | const titleValue = document.querySelector('title').text.replaceAll(re, ''); |
12 | // Extract the number from the tag | 16 | // Extract the number from the tag |
13 | match = titleValue.match(/[\d\s]+/); | 17 | match = titleValue.match(/[\d\s]+/); |
14 | // Some logic to handle the match groups | 18 | // Some logic to handle the match groups |
15 | unread = match != null && match.length > 0 ? match[0] : 0; | 19 | unread = match !== null && match.length > 0 ? match[0] : 0; |
16 | // Set unread msgs badge | 20 | // Set unread msgs badge |
17 | Ferdium.setBadge(Number.parseInt(unread, 10)); | 21 | Ferdium.setBadge(Number.parseInt(unread, 10)); |
18 | }; | 22 | }; |
@@ -22,4 +26,6 @@ module.exports = Ferdium => { | |||
22 | }; | 26 | }; |
23 | 27 | ||
24 | Ferdium.loop(loopFunc); | 28 | Ferdium.loop(loopFunc); |
29 | |||
30 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
25 | }; | 31 | }; |
diff --git a/recipes/freshservice/package.json b/recipes/freshservice/package.json index 8c3da32..745c9d4 100644 --- a/recipes/freshservice/package.json +++ b/recipes/freshservice/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "freshservice", | 2 | "id": "freshservice", |
3 | "name": "Freshservice", | 3 | "name": "Freshservice", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://freshservice.com" | 7 | "serviceURL": "https://freshservice.com" |
diff --git a/recipes/freshservice/webview.js b/recipes/freshservice/webview.js index 56a20b6..1119219 100644 --- a/recipes/freshservice/webview.js +++ b/recipes/freshservice/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/gadugadu/package.json b/recipes/gadugadu/package.json index 2fb3b6b..3b390f1 100644 --- a/recipes/gadugadu/package.json +++ b/recipes/gadugadu/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gadugadu", | 2 | "id": "gadugadu", |
3 | "name": "Gadu-Gadu", | 3 | "name": "Gadu-Gadu", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.gg.pl", | 7 | "serviceURL": "https://www.gg.pl", |
diff --git a/recipes/gadugadu/webview.js b/recipes/gadugadu/webview.js index 8891628..47bdf23 100644 --- a/recipes/gadugadu/webview.js +++ b/recipes/gadugadu/webview.js | |||
@@ -1,10 +1,14 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const updates = Ferdium.safeParseInt(document.querySelector('i#sr-last-counter').textContent); | 9 | const updates = Ferdium.safeParseInt( |
10 | document.querySelector('i#sr-last-counter').textContent, | ||
11 | ); | ||
8 | let messages = 0; | 12 | let messages = 0; |
9 | const elements = document.querySelectorAll('.chat-counter:not(.d-none)'); | 13 | const elements = document.querySelectorAll('.chat-counter:not(.d-none)'); |
10 | for (const element of elements) { | 14 | for (const element of elements) { |
diff --git a/recipes/gaming-on-linux/package.json b/recipes/gaming-on-linux/package.json index 69eff9f..6f82b31 100644 --- a/recipes/gaming-on-linux/package.json +++ b/recipes/gaming-on-linux/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gaming-on-linux", | 2 | "id": "gaming-on-linux", |
3 | "name": "GamingOnLinux", | 3 | "name": "GamingOnLinux", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.gamingonlinux.com" | 7 | "serviceURL": "https://www.gamingonlinux.com" |
diff --git a/recipes/gaming-on-linux/webview.js b/recipes/gaming-on-linux/webview.js index 86bb422..2a81dec 100644 --- a/recipes/gaming-on-linux/webview.js +++ b/recipes/gaming-on-linux/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/gather/package.json b/recipes/gather/package.json index ab59e6b..3621e99 100644 --- a/recipes/gather/package.json +++ b/recipes/gather/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gather", | 2 | "id": "gather", |
3 | "name": "Gather", | 3 | "name": "Gather", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.gather.town/app" | 7 | "serviceURL": "https://app.gather.town/app" |
diff --git a/recipes/gather/webview.js b/recipes/gather/webview.js index d7d506a..d0654c9 100644 --- a/recipes/gather/webview.js +++ b/recipes/gather/webview.js | |||
@@ -1,14 +1,16 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const element = document.querySelector("[aria-label='Chat'] > div > div > p"); | 9 | const element = document.querySelector( |
10 | "[aria-label='Chat'] > div > div > p", | ||
11 | ); | ||
10 | Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent) : 0); | 12 | Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent) : 0); |
11 | } | 13 | }; |
12 | 14 | ||
13 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
14 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
diff --git a/recipes/gettr/package.json b/recipes/gettr/package.json index e222c2f..71ed43d 100644 --- a/recipes/gettr/package.json +++ b/recipes/gettr/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gettr", | 2 | "id": "gettr", |
3 | "name": "Gettr", | 3 | "name": "Gettr", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://gettr.com" | 7 | "serviceURL": "https://gettr.com" |
diff --git a/recipes/gettr/webview.js b/recipes/gettr/webview.js index 56a20b6..1119219 100644 --- a/recipes/gettr/webview.js +++ b/recipes/gettr/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/gitea/package.json b/recipes/gitea/package.json index 7856503..9ae5137 100755 --- a/recipes/gitea/package.json +++ b/recipes/gitea/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gitea", | 2 | "id": "gitea", |
3 | "name": "Gitea", | 3 | "name": "Gitea", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/gitea/webview.js b/recipes/gitea/webview.js index 3deaedf..7929c35 100755 --- a/recipes/gitea/webview.js +++ b/recipes/gitea/webview.js | |||
@@ -1,6 +1,12 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directCountElement = document.querySelector('.notification_count',); | 9 | const directCountElement = document.querySelector('.notification_count'); |
4 | let directCount = 0; | 10 | let directCount = 0; |
5 | if (directCountElement) { | 11 | if (directCountElement) { |
6 | directCount = Ferdium.safeParseInt(directCountElement.textContent); | 12 | directCount = Ferdium.safeParseInt(directCountElement.textContent); |
@@ -10,4 +16,6 @@ module.exports = Ferdium => { | |||
10 | }; | 16 | }; |
11 | 17 | ||
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/github/package.json b/recipes/github/package.json index fa734c7..8788aad 100644 --- a/recipes/github/package.json +++ b/recipes/github/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "github", | 2 | "id": "github", |
3 | "name": "GitHub", | 3 | "name": "GitHub", |
4 | "version": "2.5.3", | 4 | "version": "2.6.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://github.com/notifications", | 7 | "serviceURL": "https://github.com/notifications", |
diff --git a/recipes/github/webview.js b/recipes/github/webview.js index b73e96e..3068b80 100644 --- a/recipes/github/webview.js +++ b/recipes/github/webview.js | |||
@@ -1,5 +1,11 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const _parseNewCount = (text) => { | 8 | const _parseNewCount = text => { |
3 | const match = text.match(/\d+/); | 9 | const match = text.match(/\d+/); |
4 | return match ? Ferdium.safeParseInt(match[0]) : 0; | 10 | return match ? Ferdium.safeParseInt(match[0]) : 0; |
5 | }; | 11 | }; |
@@ -11,17 +17,24 @@ module.exports = Ferdium => { | |||
11 | let directCount = directCountElement | 17 | let directCount = directCountElement |
12 | ? Ferdium.safeParseInt(directCountElement.textContent) | 18 | ? Ferdium.safeParseInt(directCountElement.textContent) |
13 | : 0; | 19 | : 0; |
14 | 20 | ||
15 | const newCountElement = document.querySelector('a.h6[href="/notifications?query="]'); | 21 | const newCountElement = document.querySelector( |
16 | const newCount = newCountElement ? | 22 | 'a.h6[href="/notifications?query="]', |
17 | _parseNewCount(newCountElement.textContent) : 0; | 23 | ); |
24 | const newCount = newCountElement | ||
25 | ? _parseNewCount(newCountElement.textContent) | ||
26 | : 0; | ||
18 | directCount += newCount; | 27 | directCount += newCount; |
19 | 28 | ||
20 | const indirectCount = document.querySelector( | 29 | const indirectCount = document.querySelector( |
21 | '[class*="mail-status unread"]:not([hidden])', | 30 | '[class*="mail-status unread"]:not([hidden])', |
22 | ) ? 1 : 0; | 31 | ) |
32 | ? 1 | ||
33 | : 0; | ||
23 | Ferdium.setBadge(directCount, indirectCount); | 34 | Ferdium.setBadge(directCount, indirectCount); |
24 | }; | 35 | }; |
25 | 36 | ||
26 | Ferdium.loop(getMessages); | 37 | Ferdium.loop(getMessages); |
38 | |||
39 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
27 | }; | 40 | }; |
diff --git a/recipes/gitlab/package.json b/recipes/gitlab/package.json index 008b1c7..706c72b 100644 --- a/recipes/gitlab/package.json +++ b/recipes/gitlab/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gitlab", | 2 | "id": "gitlab", |
3 | "name": "GitLab", | 3 | "name": "GitLab", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://gitlab.com/users/sign_in", | 7 | "serviceURL": "https://gitlab.com/users/sign_in", |
diff --git a/recipes/gitlab/webview.js b/recipes/gitlab/webview.js index 46366f4..1119219 100644 --- a/recipes/gitlab/webview.js +++ b/recipes/gitlab/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/gitter/package.json b/recipes/gitter/package.json index 36e64c6..a743d24 100644 --- a/recipes/gitter/package.json +++ b/recipes/gitter/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gitter", | 2 | "id": "gitter", |
3 | "name": "Gitter", | 3 | "name": "Gitter", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://gitter.im", | 7 | "serviceURL": "https://gitter.im", |
diff --git a/recipes/gitter/webview.js b/recipes/gitter/webview.js index 9dbd7e5..b40549a 100644 --- a/recipes/gitter/webview.js +++ b/recipes/gitter/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | // get unread messages | 9 | // get unread messages |
diff --git a/recipes/glowing-bear/package.json b/recipes/glowing-bear/package.json index 1bc2794..37b71a2 100644 --- a/recipes/glowing-bear/package.json +++ b/recipes/glowing-bear/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "glowing-bear", | 2 | "id": "glowing-bear", |
3 | "name": "Glowing Bear", | 3 | "name": "Glowing Bear", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.glowing-bear.org", | 7 | "serviceURL": "https://www.glowing-bear.org", |
diff --git a/recipes/glowing-bear/webview.js b/recipes/glowing-bear/webview.js index b20796f..57934eb 100644 --- a/recipes/glowing-bear/webview.js +++ b/recipes/glowing-bear/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const indirectElements = document.querySelectorAll('.badge:not(.danger)'); | 9 | const indirectElements = document.querySelectorAll('.badge:not(.danger)'); |
@@ -8,11 +14,13 @@ module.exports = Ferdium => { | |||
8 | indirectElement.textContent && | 14 | indirectElement.textContent && |
9 | indirectElement.textContent.length > 0 | 15 | indirectElement.textContent.length > 0 |
10 | ) { | 16 | ) { |
11 | indirect++; | 17 | indirect += 1; |
12 | } | 18 | } |
13 | } | 19 | } |
14 | Ferdium.setBadge(direct, indirect); | 20 | Ferdium.setBadge(direct, indirect); |
15 | }; | 21 | }; |
16 | 22 | ||
17 | Ferdium.loop(getMessages); | 23 | Ferdium.loop(getMessages); |
24 | |||
25 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | 26 | }; |
diff --git a/recipes/gmail/package.json b/recipes/gmail/package.json index 518f856..ffb7757 100644 --- a/recipes/gmail/package.json +++ b/recipes/gmail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gmail", | 2 | "id": "gmail", |
3 | "name": "Gmail", | 3 | "name": "Gmail", |
4 | "version": "1.5.1", | 4 | "version": "1.6.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.google.com" | 7 | "serviceURL": "https://mail.google.com" |
diff --git a/recipes/gmail/webview.js b/recipes/gmail/webview.js index fb8cf76..dead877 100644 --- a/recipes/gmail/webview.js +++ b/recipes/gmail/webview.js | |||
@@ -1,13 +1,13 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // if the user is on gmail's landing page, go to the login page. | 8 | // if the user is on gmail's landing page, go to the login page. |
9 | if ( | 9 | if ( |
10 | location.hostname == 'www.google.com' && | 10 | location.hostname === 'www.google.com' && |
11 | location.href.includes('gmail/about/') | 11 | location.href.includes('gmail/about/') |
12 | ) { | 12 | ) { |
13 | location.href = | 13 | location.href = |
@@ -19,22 +19,22 @@ module.exports = Ferdium => { | |||
19 | let countNonImportant = 0; | 19 | let countNonImportant = 0; |
20 | const inboxLinks = document.querySelectorAll('.J-Ke.n0'); | 20 | const inboxLinks = document.querySelectorAll('.J-Ke.n0'); |
21 | if (inboxLinks.length > 0) { | 21 | if (inboxLinks.length > 0) { |
22 | let parentNode = inboxLinks[0].parentNode; | 22 | const { parentNode } = inboxLinks[0]; |
23 | if (parentNode) { | 23 | if (parentNode) { |
24 | let parentNodeOfParentNode = parentNode.parentNode; | 24 | const parentNodeOfParentNode = parentNode.parentNode; |
25 | if (parentNodeOfParentNode) { | 25 | if (parentNodeOfParentNode) { |
26 | const unreadCounts = parentNodeOfParentNode.querySelectorAll('.bsU'); | 26 | const unreadCounts = parentNodeOfParentNode.querySelectorAll('.bsU'); |
27 | if (unreadCounts.length > 0) { | 27 | if (unreadCounts.length > 0) { |
28 | let unreadCount = unreadCounts[0].textContent; | 28 | const unreadCount = unreadCounts[0].textContent; |
29 | if (unreadCount.includes(':')) { | 29 | if (unreadCount.includes(':')) { |
30 | let counts = unreadCount | 30 | const counts = unreadCount |
31 | .split(':') | 31 | .split(':') |
32 | .map(s => Ferdium.safeParseInt(s.replace(/[^\p{N}]/gu, ''))); | 32 | .map(s => Ferdium.safeParseInt(s.replaceAll(/[^\p{N}]/gu, ''))); |
33 | countImportant = counts[0]; | 33 | countImportant = counts[0]; |
34 | countNonImportant = counts[1] - counts[0]; | 34 | countNonImportant = counts[1] - counts[0]; |
35 | } else { | 35 | } else { |
36 | countImportant = Ferdium.safeParseInt( | 36 | countImportant = Ferdium.safeParseInt( |
37 | unreadCount.replace(/[^\p{N}]/gu, ''), | 37 | unreadCount.replaceAll(/[^\p{N}]/gu, ''), |
38 | ); | 38 | ); |
39 | } | 39 | } |
40 | } | 40 | } |
diff --git a/recipes/good-reads/package.json b/recipes/good-reads/package.json index 8337a6d..1c22e5e 100644 --- a/recipes/good-reads/package.json +++ b/recipes/good-reads/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "good-reads", | 2 | "id": "good-reads", |
3 | "name": "Good Reads", | 3 | "name": "Good Reads", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.goodreads.com/" | 7 | "serviceURL": "https://www.goodreads.com/" |
diff --git a/recipes/good-reads/webview.js b/recipes/good-reads/webview.js index a178ae1..2b2a4fa 100644 --- a/recipes/good-reads/webview.js +++ b/recipes/good-reads/webview.js | |||
@@ -1,13 +1,21 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const notificationBadge = document.querySelector( | 9 | const notificationBadge = document.querySelector( |
4 | ".siteHeader__topLevelItem--profileIcon .headerPersonalNav .modalTrigger .headerPersonalNav__icon .headerPersonalNav__flag" | 10 | '.siteHeader__topLevelItem--profileIcon .headerPersonalNav .modalTrigger .headerPersonalNav__icon .headerPersonalNav__flag', |
5 | ); | 11 | ); |
6 | let notification = notificationBadge | 12 | const notification = notificationBadge |
7 | ? Ferdium.safeParseInt(notificationBadge.textContent) | 13 | ? Ferdium.safeParseInt(notificationBadge.textContent) |
8 | : 0; | 14 | : 0; |
9 | 15 | ||
10 | Ferdium.setBadge(notification); | 16 | Ferdium.setBadge(notification); |
11 | }; | 17 | }; |
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/googlecalendar/LICENSE b/recipes/google-calendar/LICENSE index 4608c00..4608c00 100644 --- a/recipes/googlecalendar/LICENSE +++ b/recipes/google-calendar/LICENSE | |||
diff --git a/recipes/googlecalendar/calendar.css b/recipes/google-calendar/calendar.css index 7cd726b..7cd726b 100644 --- a/recipes/googlecalendar/calendar.css +++ b/recipes/google-calendar/calendar.css | |||
diff --git a/recipes/googlecalendar/darkmode.css b/recipes/google-calendar/darkmode.css index aab4f78..aab4f78 100644 --- a/recipes/googlecalendar/darkmode.css +++ b/recipes/google-calendar/darkmode.css | |||
diff --git a/recipes/googlecalendar/icon.svg b/recipes/google-calendar/icon.svg index c71fa08..c71fa08 100644 --- a/recipes/googlecalendar/icon.svg +++ b/recipes/google-calendar/icon.svg | |||
diff --git a/recipes/googlecalendar/index.js b/recipes/google-calendar/index.js index dd41f72..dd41f72 100644 --- a/recipes/googlecalendar/index.js +++ b/recipes/google-calendar/index.js | |||
diff --git a/recipes/googlecalendar/package.json b/recipes/google-calendar/package.json index f6232cb..79e94fe 100644 --- a/recipes/googlecalendar/package.json +++ b/recipes/google-calendar/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "googlecalendar", | 2 | "id": "google-calendar", |
3 | "name": "Google Calendar", | 3 | "name": "Google Calendar", |
4 | "version": "2.3.2", | 4 | "version": "2.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "google-calendar", | 7 | "google-calendar", |
diff --git a/recipes/googlecalendar/webview-unsafe.js b/recipes/google-calendar/webview-unsafe.js index 7840600..0f4833e 100644 --- a/recipes/googlecalendar/webview-unsafe.js +++ b/recipes/google-calendar/webview-unsafe.js | |||
@@ -2,10 +2,10 @@ let modal; | |||
2 | let updates = 0; | 2 | let updates = 0; |
3 | 3 | ||
4 | const waitFor = (condition, callback) => { | 4 | const waitFor = (condition, callback) => { |
5 | if (!condition()) { | 5 | if (condition()) { |
6 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
7 | } else { | ||
8 | callback(); | 6 | callback(); |
7 | } else { | ||
8 | window.setTimeout(waitFor.bind(null, condition, callback), 100); | ||
9 | } | 9 | } |
10 | }; | 10 | }; |
11 | 11 | ||
diff --git a/recipes/googlecalendar/webview.js b/recipes/google-calendar/webview.js index 9937bec..3921dea 100644 --- a/recipes/googlecalendar/webview.js +++ b/recipes/google-calendar/webview.js | |||
@@ -1,11 +1,13 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | // if the user is on googlecalendar landing page, go to the login page. | 8 | // if the user is on googlecalendar landing page, go to the login page. |
7 | if ( | 9 | if ( |
8 | location.hostname == 'workspace.google.com' && | 10 | location.hostname === 'workspace.google.com' && |
9 | location.href.includes('products/calendar/') | 11 | location.href.includes('products/calendar/') |
10 | ) { | 12 | ) { |
11 | location.href = | 13 | location.href = |
diff --git a/recipes/googleclassroom/LICENSE b/recipes/google-classroom/LICENSE index 516df99..516df99 100644 --- a/recipes/googleclassroom/LICENSE +++ b/recipes/google-classroom/LICENSE | |||
diff --git a/recipes/googleclassroom/darkmode.css b/recipes/google-classroom/darkmode.css index 0e47715..0e47715 100644 --- a/recipes/googleclassroom/darkmode.css +++ b/recipes/google-classroom/darkmode.css | |||
diff --git a/recipes/googleclassroom/icon.svg b/recipes/google-classroom/icon.svg index 3a48ab5..3a48ab5 100644 --- a/recipes/googleclassroom/icon.svg +++ b/recipes/google-classroom/icon.svg | |||
diff --git a/recipes/googleclassroom/index.js b/recipes/google-classroom/index.js index dd41f72..dd41f72 100644 --- a/recipes/googleclassroom/index.js +++ b/recipes/google-classroom/index.js | |||
diff --git a/recipes/googleclassroom/package.json b/recipes/google-classroom/package.json index 8680db8..3fcb079 100644 --- a/recipes/googleclassroom/package.json +++ b/recipes/google-classroom/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "googleclassroom", | 2 | "id": "google-classroom", |
3 | "name": "Google Classroom", | 3 | "name": "Google Classroom", |
4 | "version": "1.2.2", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/TanZng/ferdi-googleclassroom", | 6 | "repository": "https://github.com/TanZng/ferdi-googleclassroom", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/googleclassroom/webview.js b/recipes/google-classroom/webview.js index 5035417..47bfe80 100644 --- a/recipes/googleclassroom/webview.js +++ b/recipes/google-classroom/webview.js | |||
@@ -1,7 +1,13 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | // if the user is on googleclassroom landing page, go to the login page. | 8 | // if the user is on googleclassroom landing page, go to the login page. |
3 | if ( | 9 | if ( |
4 | location.hostname == 'edu.google.com' && | 10 | location.hostname === 'edu.google.com' && |
5 | location.href.includes('workspace-for-education/classroom/') | 11 | location.href.includes('workspace-for-education/classroom/') |
6 | ) { | 12 | ) { |
7 | location.href = | 13 | location.href = |
@@ -10,10 +16,12 @@ module.exports = Ferdium => { | |||
10 | 16 | ||
11 | const getMessages = () => { | 17 | const getMessages = () => { |
12 | let homework = 0; | 18 | let homework = 0; |
13 | const upcomingAssignment = document.querySelectorAll('.hrUpcomingAssignmentGroup'); | 19 | const upcomingAssignment = document.querySelectorAll( |
20 | '.hrUpcomingAssignmentGroup', | ||
21 | ); | ||
14 | if (upcomingAssignment.length > 0) { | 22 | if (upcomingAssignment.length > 0) { |
15 | let i; | 23 | let i; |
16 | for (i = 0; i < upcomingAssignment.length; i++) { | 24 | for (i = 0; i < upcomingAssignment.length; i += 1) { |
17 | homework += upcomingAssignment[i].childElementCount; | 25 | homework += upcomingAssignment[i].childElementCount; |
18 | } | 26 | } |
19 | } | 27 | } |
@@ -21,4 +29,6 @@ module.exports = Ferdium => { | |||
21 | }; | 29 | }; |
22 | 30 | ||
23 | Ferdium.loop(getMessages); | 31 | Ferdium.loop(getMessages); |
32 | |||
33 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
24 | }; | 34 | }; |
diff --git a/recipes/google-contacts/package.json b/recipes/google-contacts/package.json index 5bcae2d..1a336e6 100644 --- a/recipes/google-contacts/package.json +++ b/recipes/google-contacts/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-contacts", | 2 | "id": "google-contacts", |
3 | "name": "Google Contacts", | 3 | "name": "Google Contacts", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://contacts.google.com/u/0/" | 7 | "serviceURL": "https://contacts.google.com/u/0/" |
diff --git a/recipes/google-contacts/webview.js b/recipes/google-contacts/webview.js index 86bb422..2a81dec 100644 --- a/recipes/google-contacts/webview.js +++ b/recipes/google-contacts/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/google-docs/package.json b/recipes/google-docs/package.json index 8afbd1a..19504af 100644 --- a/recipes/google-docs/package.json +++ b/recipes/google-docs/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-docs", | 2 | "id": "google-docs", |
3 | "name": "Google Docs", | 3 | "name": "Google Docs", |
4 | "version": "2.2.0", | 4 | "version": "2.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://docs.google.com/document/u/0/" | 7 | "serviceURL": "https://docs.google.com/document/u/0/" |
diff --git a/recipes/google-docs/webview.js b/recipes/google-docs/webview.js index 56a20b6..1119219 100644 --- a/recipes/google-docs/webview.js +++ b/recipes/google-docs/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/googledrive/icon.svg b/recipes/google-drive/icon.svg index c430a62..c430a62 100644 --- a/recipes/googledrive/icon.svg +++ b/recipes/google-drive/icon.svg | |||
diff --git a/recipes/googledrive/index.js b/recipes/google-drive/index.js index dd41f72..dd41f72 100644 --- a/recipes/googledrive/index.js +++ b/recipes/google-drive/index.js | |||
diff --git a/recipes/googledrive/package.json b/recipes/google-drive/package.json index 5dd53a6..e9b328d 100644 --- a/recipes/googledrive/package.json +++ b/recipes/google-drive/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "googledrive", | 2 | "id": "google-drive", |
3 | "name": "Google Drive", | 3 | "name": "Google Drive", |
4 | "version": "2.2.0", | 4 | "version": "2.3.0", |
5 | "repository": "https://github.com/BrianGilbert/franz-recipe-tawk", | 5 | "repository": "https://github.com/BrianGilbert/franz-recipe-tawk", |
6 | "license": "MIT", | 6 | "license": "MIT", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/googledrive/service.css b/recipes/google-drive/service.css index 2d8c1a6..2d8c1a6 100644 --- a/recipes/googledrive/service.css +++ b/recipes/google-drive/service.css | |||
diff --git a/recipes/googledrive/webview-unsafe.js b/recipes/google-drive/webview-unsafe.js index 9198ac5..9198ac5 100644 --- a/recipes/googledrive/webview-unsafe.js +++ b/recipes/google-drive/webview-unsafe.js | |||
diff --git a/recipes/googledrive/webview.js b/recipes/google-drive/webview.js index aba811f..c27c226 100644 --- a/recipes/googledrive/webview.js +++ b/recipes/google-drive/webview.js | |||
@@ -1,8 +1,10 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
7 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 9 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
8 | }; | 10 | }; |
diff --git a/recipes/google-duo/package.json b/recipes/google-duo/package.json index 9f45a5f..d6b27d8 100644 --- a/recipes/google-duo/package.json +++ b/recipes/google-duo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-duo", | 2 | "id": "google-duo", |
3 | "name": "Google Duo", | 3 | "name": "Google Duo", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/AnalogCyan/recipe-franz-googleduo", | 6 | "repository": "https://github.com/AnalogCyan/recipe-franz-googleduo", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/google-duo/webview.js b/recipes/google-duo/webview.js index 86bb422..2a81dec 100644 --- a/recipes/google-duo/webview.js +++ b/recipes/google-duo/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/google-groups/package.json b/recipes/google-groups/package.json index f1ff58d..38c3470 100644 --- a/recipes/google-groups/package.json +++ b/recipes/google-groups/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-groups", | 2 | "id": "google-groups", |
3 | "name": "Google Groups", | 3 | "name": "Google Groups", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://groups.google.com/u/0/" | 7 | "serviceURL": "https://groups.google.com/u/0/" |
diff --git a/recipes/google-groups/webview.js b/recipes/google-groups/webview.js index 7006eef..c13334a 100644 --- a/recipes/google-groups/webview.js +++ b/recipes/google-groups/webview.js | |||
@@ -1,15 +1,17 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let countImportant = 0; | 9 | let countImportant = 0; |
10 | const unReadConversationCount = document.querySelectorAll('.NHlkZc'); | 10 | const unReadConversationCount = document.querySelectorAll('.NHlkZc'); |
11 | if (unReadConversationCount.length > 0) { | 11 | if (unReadConversationCount.length > 0) { |
12 | countImportant = Ferdium.safeParseInt(unReadConversationCount[0].textContent); | 12 | countImportant = Ferdium.safeParseInt( |
13 | unReadConversationCount[0].textContent, | ||
14 | ); | ||
13 | } | 15 | } |
14 | Ferdium.setBadge(countImportant, 0); | 16 | Ferdium.setBadge(countImportant, 0); |
15 | }; | 17 | }; |
diff --git a/recipes/googlekeep/LICENSE b/recipes/google-keep/LICENSE index 8d55d49..8d55d49 100644 --- a/recipes/googlekeep/LICENSE +++ b/recipes/google-keep/LICENSE | |||
diff --git a/recipes/googlekeep/icon.svg b/recipes/google-keep/icon.svg index 20c040f..20c040f 100644 --- a/recipes/googlekeep/icon.svg +++ b/recipes/google-keep/icon.svg | |||
diff --git a/recipes/googlekeep/index.js b/recipes/google-keep/index.js index dd41f72..dd41f72 100644 --- a/recipes/googlekeep/index.js +++ b/recipes/google-keep/index.js | |||
diff --git a/recipes/googlekeep/package.json b/recipes/google-keep/package.json index 6b949ca..97aaa7c 100644 --- a/recipes/googlekeep/package.json +++ b/recipes/google-keep/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "googlekeep", | 2 | "id": "google-keep", |
3 | "name": "Google Keep", | 3 | "name": "Google Keep", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://keep.google.com/u/0/" | 7 | "serviceURL": "https://keep.google.com/u/0/" |
diff --git a/recipes/protoncalendar/webview.js b/recipes/google-keep/webview.js index 86bb422..2a81dec 100644 --- a/recipes/protoncalendar/webview.js +++ b/recipes/google-keep/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/googlemeet/icon.svg b/recipes/google-meet/icon.svg index 4b5a0d3..4b5a0d3 100644 --- a/recipes/googlemeet/icon.svg +++ b/recipes/google-meet/icon.svg | |||
diff --git a/recipes/googlemeet/index.js b/recipes/google-meet/index.js index dd41f72..dd41f72 100644 --- a/recipes/googlemeet/index.js +++ b/recipes/google-meet/index.js | |||
diff --git a/recipes/googlemeet/package.json b/recipes/google-meet/package.json index 637e722..93f2f33 100644 --- a/recipes/googlemeet/package.json +++ b/recipes/google-meet/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "googlemeet", | 2 | "id": "google-meet", |
3 | "name": "Google Meet", | 3 | "name": "Google Meet", |
4 | "version": "2.3.1", | 4 | "version": "2.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://meet.google.com/u/0/", | 7 | "serviceURL": "https://meet.google.com/u/0/", |
diff --git a/recipes/googlemeet/service.css b/recipes/google-meet/service.css index b453fd4..b453fd4 100644 --- a/recipes/googlemeet/service.css +++ b/recipes/google-meet/service.css | |||
diff --git a/recipes/googlemeet/webview.js b/recipes/google-meet/webview.js index f3c0f46..e4694ef 100644 --- a/recipes/googlemeet/webview.js +++ b/recipes/google-meet/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | window.addEventListener('load', () => { | 7 | window.addEventListener('load', () => { |
8 | const title = document.querySelector('.window-title').textContent; | 8 | const title = document.querySelector('.window-title').textContent; |
9 | 9 | ||
diff --git a/recipes/google-news/package.json b/recipes/google-news/package.json index 4db1d40..1c2a675 100644 --- a/recipes/google-news/package.json +++ b/recipes/google-news/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-news", | 2 | "id": "google-news", |
3 | "name": "Google News", | 3 | "name": "Google News", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://news.google.com/u/0/" | 7 | "serviceURL": "https://news.google.com/u/0/" |
diff --git a/recipes/google-news/webview.js b/recipes/google-news/webview.js index 86bb422..2a81dec 100644 --- a/recipes/google-news/webview.js +++ b/recipes/google-news/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/googlepodcasts/icon.svg b/recipes/google-podcasts/icon.svg index f1da8b9..f1da8b9 100644 --- a/recipes/googlepodcasts/icon.svg +++ b/recipes/google-podcasts/icon.svg | |||
diff --git a/recipes/googlepodcasts/index.js b/recipes/google-podcasts/index.js index dd41f72..dd41f72 100644 --- a/recipes/googlepodcasts/index.js +++ b/recipes/google-podcasts/index.js | |||
diff --git a/recipes/googlepodcasts/package.json b/recipes/google-podcasts/package.json index dd2ea9e..91258da 100644 --- a/recipes/googlepodcasts/package.json +++ b/recipes/google-podcasts/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "googlepodcasts", | 2 | "id": "google-podcasts", |
3 | "name": "Google Podcasts", | 3 | "name": "Google Podcasts", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://podcasts.google.com/u/0/" | 7 | "serviceURL": "https://podcasts.google.com/u/0/" |
diff --git a/recipes/googlekeep/webview.js b/recipes/google-podcasts/webview.js index 86bb422..2a81dec 100644 --- a/recipes/googlekeep/webview.js +++ b/recipes/google-podcasts/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/google-presentation/package.json b/recipes/google-presentation/package.json index 6861390..01f7598 100644 --- a/recipes/google-presentation/package.json +++ b/recipes/google-presentation/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-presentation", | 2 | "id": "google-presentation", |
3 | "name": "Google Presentation", | 3 | "name": "Google Presentation", |
4 | "version": "2.2.0", | 4 | "version": "2.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://docs.google.com/presentation/u/0/" | 7 | "serviceURL": "https://docs.google.com/presentation/u/0/" |
diff --git a/recipes/google-presentation/webview.js b/recipes/google-presentation/webview.js index 56a20b6..1119219 100644 --- a/recipes/google-presentation/webview.js +++ b/recipes/google-presentation/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/google-spreadsheets/package.json b/recipes/google-spreadsheets/package.json index a35438b..d27f357 100644 --- a/recipes/google-spreadsheets/package.json +++ b/recipes/google-spreadsheets/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-spreadsheets", | 2 | "id": "google-spreadsheets", |
3 | "name": "Google Spreadsheets", | 3 | "name": "Google Spreadsheets", |
4 | "version": "2.2.0", | 4 | "version": "2.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://docs.google.com/spreadsheets/u/0/" | 7 | "serviceURL": "https://docs.google.com/spreadsheets/u/0/" |
diff --git a/recipes/google-spreadsheets/webview.js b/recipes/google-spreadsheets/webview.js index 56a20b6..1119219 100644 --- a/recipes/google-spreadsheets/webview.js +++ b/recipes/google-spreadsheets/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/google-translate/package.json b/recipes/google-translate/package.json index 41b1f1b..1063b69 100644 --- a/recipes/google-translate/package.json +++ b/recipes/google-translate/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-translate", | 2 | "id": "google-translate", |
3 | "name": "Google Translate", | 3 | "name": "Google Translate", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://translate.google.com/u/0/" | 7 | "serviceURL": "https://translate.google.com/u/0/" |
diff --git a/recipes/google-translate/webview.js b/recipes/google-translate/webview.js index 86bb422..2a81dec 100644 --- a/recipes/google-translate/webview.js +++ b/recipes/google-translate/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/google-voice/package.json b/recipes/google-voice/package.json index 7d02660..9ddade7 100644 --- a/recipes/google-voice/package.json +++ b/recipes/google-voice/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-voice", | 2 | "id": "google-voice", |
3 | "name": "Google Voice", | 3 | "name": "Google Voice", |
4 | "version": "0.5.1", | 4 | "version": "0.6.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/BehindTheMath/franz-recipe-google-voice", | 6 | "repository": "https://github.com/BehindTheMath/franz-recipe-google-voice", |
7 | "config": { | 7 | "config": { |
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 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.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 | }; |
diff --git a/recipes/gotify/package.json b/recipes/gotify/package.json index c52a308..00ef370 100644 --- a/recipes/gotify/package.json +++ b/recipes/gotify/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gotify", | 2 | "id": "gotify", |
3 | "name": "Gotify", | 3 | "name": "Gotify", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasNotificationSound": true, | 7 | "hasNotificationSound": true, |
diff --git a/recipes/gotify/webview.js b/recipes/gotify/webview.js index 46762ed..420275a 100644 --- a/recipes/gotify/webview.js +++ b/recipes/gotify/webview.js | |||
@@ -1,12 +1,12 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let count = document.querySelectorAll('#messages').length; | 9 | const count = document.querySelectorAll('#messages').length; |
10 | 10 | ||
11 | Ferdium.setBadge(count); | 11 | Ferdium.setBadge(count); |
12 | }; | 12 | }; |
diff --git a/recipes/goto/package.json b/recipes/goto/package.json index b583578..7455e9e 100644 --- a/recipes/goto/package.json +++ b/recipes/goto/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "goto", | 2 | "id": "goto", |
3 | "name": "GoTo", | 3 | "name": "GoTo", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.goto.com/" | 7 | "serviceURL": "https://app.goto.com/" |
diff --git a/recipes/goto/webview.js b/recipes/goto/webview.js index 56a20b6..1119219 100644 --- a/recipes/goto/webview.js +++ b/recipes/goto/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/gotomeeting/index.js b/recipes/gotomeeting/index.js index fa15a16..ec47fa5 100644 --- a/recipes/gotomeeting/index.js +++ b/recipes/gotomeeting/index.js | |||
@@ -1,5 +1,9 @@ | |||
1 | module.exports = Ferdium => class Gotomeeting extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Gotomeeting extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, ''); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent.replaceAll( |
5 | }; | 5 | /(Ferdium|Electron)\/\S+ \([^)]+\)/g, |
6 | '', | ||
7 | ); | ||
8 | } | ||
9 | }; | ||
diff --git a/recipes/gotomeeting/package.json b/recipes/gotomeeting/package.json index 73d3792..a0aee2f 100644 --- a/recipes/gotomeeting/package.json +++ b/recipes/gotomeeting/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gotomeeting", | 2 | "id": "gotomeeting", |
3 | "name": "Go To Meeting", | 3 | "name": "Go To Meeting", |
4 | "version": "0.4.0", | 4 | "version": "0.5.0", |
5 | "repository": "https://github.com/tristanplouz/ferdi-recipe-gotomeeting.git", | 5 | "repository": "https://github.com/tristanplouz/ferdi-recipe-gotomeeting.git", |
6 | "license": "MIT", | 6 | "license": "MIT", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/gotomeeting/webview.js b/recipes/gotomeeting/webview.js index 0ff41ad..ab5f07c 100644 --- a/recipes/gotomeeting/webview.js +++ b/recipes/gotomeeting/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
diff --git a/recipes/grammarly/package.json b/recipes/grammarly/package.json index ee2d3b4..24990d8 100644 --- a/recipes/grammarly/package.json +++ b/recipes/grammarly/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "grammarly", | 2 | "id": "grammarly", |
3 | "name": "Grammarly", | 3 | "name": "Grammarly", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.grammarly.com/" | 7 | "serviceURL": "https://app.grammarly.com/" |
diff --git a/recipes/grammarly/webview.js b/recipes/grammarly/webview.js index afe3605..b9d0570 100644 --- a/recipes/grammarly/webview.js +++ b/recipes/grammarly/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'style.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'style.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/grape/index.js b/recipes/grape/index.js index 593f026..1e2a187 100644 --- a/recipes/grape/index.js +++ b/recipes/grape/index.js | |||
@@ -1,18 +1,48 @@ | |||
1 | function _asyncToGenerator(fn) { return function () { const gen = Reflect.apply(fn, this, arguments); return new Promise((resolve, reject) => { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then((value) => { step('next', value); }, (error) => { step('throw', error); }); } } return step('next'); }); }; } | 1 | function _asyncToGenerator(fn) { |
2 | 2 | return function () { | |
3 | module.exports = Ferdium => class Grape extends Ferdium { | 3 | const gen = Reflect.apply(fn, this, arguments); |
4 | validateUrl(url) { | 4 | return new Promise((resolve, reject) => { |
5 | return _asyncToGenerator(function* () { | 5 | function step(key, arg) { |
6 | try { | 6 | try { |
7 | const resp = yield window.fetch(url, { | 7 | var info = gen[key](arg); |
8 | method: 'GET', | 8 | var value = info.value; |
9 | }); | 9 | } catch (error) { |
10 | return resp.status === 200; | 10 | reject(error); |
11 | } catch (error) { | 11 | return; |
12 | console.error(error); | 12 | } |
13 | if (info.done) { | ||
14 | resolve(value); | ||
15 | } else { | ||
16 | // eslint-disable-next-line consistent-return | ||
17 | return Promise.resolve(value).then( | ||
18 | value => { | ||
19 | step('next', value); | ||
20 | }, | ||
21 | error => { | ||
22 | step('throw', error); | ||
23 | }, | ||
24 | ); | ||
25 | } | ||
13 | } | 26 | } |
27 | return step('next'); | ||
28 | }); | ||
29 | }; | ||
30 | } | ||
31 | |||
32 | module.exports = Ferdium => | ||
33 | class Grape extends Ferdium { | ||
34 | validateUrl(url) { | ||
35 | return _asyncToGenerator(function* () { | ||
36 | try { | ||
37 | const resp = yield window.fetch(url, { | ||
38 | method: 'GET', | ||
39 | }); | ||
40 | return resp.status === 200; | ||
41 | } catch (error) { | ||
42 | console.error(error); | ||
43 | } | ||
14 | 44 | ||
15 | return false; | 45 | return false; |
16 | })(); | 46 | })(); |
17 | } | 47 | } |
18 | }; | 48 | }; |
diff --git a/recipes/grape/package.json b/recipes/grape/package.json index 9fe40ab..6b09778 100644 --- a/recipes/grape/package.json +++ b/recipes/grape/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "grape", | 2 | "id": "grape", |
3 | "name": "Grape", | 3 | "name": "Grape", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.chatgrape.com/chat", | 7 | "serviceURL": "https://{teamId}.chatgrape.com/chat", |
diff --git a/recipes/grape/webview.js b/recipes/grape/webview.js index 6349bd0..0115205 100644 --- a/recipes/grape/webview.js +++ b/recipes/grape/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directMessages = document.querySelectorAll('.c0120').length; | 9 | const directMessages = document.querySelectorAll('.c0120').length; |
@@ -7,4 +13,6 @@ module.exports = Ferdium => { | |||
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/groupme/package.json b/recipes/groupme/package.json index 0fa12ad..f282c9a 100644 --- a/recipes/groupme/package.json +++ b/recipes/groupme/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "groupme", | 2 | "id": "groupme", |
3 | "name": "GroupMe", | 3 | "name": "GroupMe", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.groupme.com", | 7 | "serviceURL": "https://web.groupme.com", |
diff --git a/recipes/groupme/webview.js b/recipes/groupme/webview.js index 0d5afc3..0f0d3a6 100644 --- a/recipes/groupme/webview.js +++ b/recipes/groupme/webview.js | |||
@@ -1,12 +1,21 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | |||
4 | // array-ify the list of conversations | 9 | // array-ify the list of conversations |
5 | const allConversations = [...document.querySelectorAll('#tray .tray-list .list-item')] | 10 | const allConversations = [ |
11 | ...document.querySelectorAll('#tray .tray-list .list-item'), | ||
12 | ]; | ||
6 | // for each conversation on the list... | 13 | // for each conversation on the list... |
7 | const filteredConversations = allConversations.filter(e => { | 14 | const filteredConversations = allConversations.filter(e => { |
8 | // keep it on the list if [1] it has unread messages (not .ng-hide), and [2] it isn't muted (not .overlay) | 15 | // keep it on the list if [1] it has unread messages (not .ng-hide), and [2] it isn't muted (not .overlay) |
9 | return (!e.innerHTML.includes('ng-hide') && !e.innerHTML.includes('overlay')) | 16 | return ( |
17 | !e.innerHTML.includes('ng-hide') && !e.innerHTML.includes('overlay') | ||
18 | ); | ||
10 | }); | 19 | }); |
11 | const unreadConversations = filteredConversations.length; | 20 | const unreadConversations = filteredConversations.length; |
12 | 21 | ||
@@ -15,4 +24,6 @@ module.exports = Ferdium => { | |||
15 | }; | 24 | }; |
16 | 25 | ||
17 | Ferdium.loop(getMessages); | 26 | Ferdium.loop(getMessages); |
27 | |||
28 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | 29 | }; |
diff --git a/recipes/guilded/package.json b/recipes/guilded/package.json index 6bfcd7c..d041afa 100644 --- a/recipes/guilded/package.json +++ b/recipes/guilded/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "guilded", | 2 | "id": "guilded", |
3 | "name": "Guilded", | 3 | "name": "Guilded", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.guilded.gg/", | 7 | "serviceURL": "https://www.guilded.gg/", |
diff --git a/recipes/guilded/webview.js b/recipes/guilded/webview.js index a573790..eedbf8a 100644 --- a/recipes/guilded/webview.js +++ b/recipes/guilded/webview.js | |||
@@ -1,10 +1,16 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let unread = 0; | 9 | let unread = 0; |
4 | const notificationBadge = document.querySelectorAll( | 10 | const notificationBadge = document.querySelectorAll( |
5 | '.NavSelectorItem-unread-badge', | 11 | '.NavSelectorItem-unread-badge', |
6 | )[0]; | 12 | )[0]; |
7 | if (notificationBadge != undefined) { | 13 | if (notificationBadge !== undefined) { |
8 | const innerBadge = | 14 | const innerBadge = |
9 | notificationBadge.querySelectorAll('.BadgeV2-count')[0]; | 15 | notificationBadge.querySelectorAll('.BadgeV2-count')[0]; |
10 | unread = Ferdium.safeParseInt(innerBadge.textContent); | 16 | unread = Ferdium.safeParseInt(innerBadge.textContent); |
@@ -13,4 +19,6 @@ module.exports = Ferdium => { | |||
13 | }; | 19 | }; |
14 | 20 | ||
15 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
22 | |||
23 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
16 | }; | 24 | }; |
diff --git a/recipes/habitica/package.json b/recipes/habitica/package.json index bda128e..9480daf 100755 --- a/recipes/habitica/package.json +++ b/recipes/habitica/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "habitica", | 2 | "id": "habitica", |
3 | "name": "Habitica", | 3 | "name": "Habitica", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/lmnet/franz-recipe-notion", | 6 | "repository": "https://github.com/lmnet/franz-recipe-notion", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/habitica/webview.js b/recipes/habitica/webview.js index 202822f..7e7abfd 100755 --- a/recipes/habitica/webview.js +++ b/recipes/habitica/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -9,4 +15,6 @@ module.exports = Ferdium => { | |||
9 | }; | 15 | }; |
10 | 16 | ||
11 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 20 | }; |
diff --git a/recipes/hackmd/package.json b/recipes/hackmd/package.json index 24b790d..03734a7 100644 --- a/recipes/hackmd/package.json +++ b/recipes/hackmd/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hackmd", | 2 | "id": "hackmd", |
3 | "name": "HackMd", | 3 | "name": "HackMd", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://hackmd.io", | 7 | "serviceURL": "https://hackmd.io", |
diff --git a/recipes/hackmd/webview.js b/recipes/hackmd/webview.js index dbd4746..5c472fb 100644 --- a/recipes/hackmd/webview.js +++ b/recipes/hackmd/webview.js | |||
@@ -1,8 +1,10 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | // get unread messages | 9 | // get unread messages |
8 | const count = document.querySelectorAll('.guilds-wrapper .badge').length; | 10 | const count = document.querySelectorAll('.guilds-wrapper .badge').length; |
diff --git a/recipes/hangouts/package.json b/recipes/hangouts/package.json index bb76e4b..fbc012b 100644 --- a/recipes/hangouts/package.json +++ b/recipes/hangouts/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hangouts", | 2 | "id": "hangouts", |
3 | "name": "Hangouts", | 3 | "name": "Hangouts", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://hangouts.google.com", | 7 | "serviceURL": "https://hangouts.google.com", |
diff --git a/recipes/hangouts/webview.js b/recipes/hangouts/webview.js index 02ded41..624f6ae 100644 --- a/recipes/hangouts/webview.js +++ b/recipes/hangouts/webview.js | |||
@@ -1,12 +1,21 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // get unread messages | 9 | // get unread messages |
4 | let count = 0; | 10 | let count = 0; |
5 | for (const span of document.querySelectorAll('span[jsname=DW2nlb]')) count += Ferdium.safeParseInt(span.textContent); | 11 | for (const span of document.querySelectorAll('span[jsname=DW2nlb]')) |
12 | count += Ferdium.safeParseInt(span.textContent); | ||
6 | 13 | ||
7 | // set Ferdium badge | 14 | // set Ferdium badge |
8 | Ferdium.setBadge(count); | 15 | Ferdium.setBadge(count); |
9 | }; | 16 | }; |
10 | 17 | ||
11 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 21 | }; |
diff --git a/recipes/hangoutschat/package.json b/recipes/hangoutschat/package.json index 1af0ff3..614cf90 100644 --- a/recipes/hangoutschat/package.json +++ b/recipes/hangoutschat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hangoutschat", | 2 | "id": "hangoutschat", |
3 | "name": "Hangouts Chat", | 3 | "name": "Hangouts Chat", |
4 | "version": "1.6.0", | 4 | "version": "1.7.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "google-chat", | 7 | "google-chat", |
diff --git a/recipes/hangoutschat/webview.js b/recipes/hangoutschat/webview.js index 98309fb..75c53d0 100644 --- a/recipes/hangoutschat/webview.js +++ b/recipes/hangoutschat/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | // class corresponding to the red badge that is visible for direct messages | 8 | // class corresponding to the red badge that is visible for direct messages |
3 | const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU'; | 9 | const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU'; |
@@ -29,8 +35,10 @@ module.exports = Ferdium => { | |||
29 | 35 | ||
30 | Ferdium.loop(getMessages); | 36 | Ferdium.loop(getMessages); |
31 | 37 | ||
38 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
39 | |||
32 | document.addEventListener('click', e => { | 40 | document.addEventListener('click', e => { |
33 | // @ts-ignore | 41 | // @ts-expect-error |
34 | const { tagName, target, href } = e.target; | 42 | const { tagName, target, href } = e.target; |
35 | 43 | ||
36 | if (tagName === 'A' && target === '_blank') { | 44 | if (tagName === 'A' && target === '_blank') { |
diff --git a/recipes/harvest/package.json b/recipes/harvest/package.json index 1913855..fbb7279 100644 --- a/recipes/harvest/package.json +++ b/recipes/harvest/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "harvest", | 2 | "id": "harvest", |
3 | "name": "Harvest", | 3 | "name": "Harvest", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.harvestapp.com", | 7 | "serviceURL": "https://{teamId}.harvestapp.com", |
diff --git a/recipes/harvest/webview.js b/recipes/harvest/webview.js index 86bb422..2a81dec 100644 --- a/recipes/harvest/webview.js +++ b/recipes/harvest/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/help-scout/package.json b/recipes/help-scout/package.json index 9048edc..0ff08a3 100644 --- a/recipes/help-scout/package.json +++ b/recipes/help-scout/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "help-scout", | 2 | "id": "help-scout", |
3 | "name": "Help Scout", | 3 | "name": "Help Scout", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.helpscout.com" | 7 | "serviceURL": "https://www.helpscout.com" |
diff --git a/recipes/help-scout/webview.js b/recipes/help-scout/webview.js index bd84dd7..c7f7c94 100644 --- a/recipes/help-scout/webview.js +++ b/recipes/help-scout/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | /** | 7 | /** |
8 | * Help Scout integration plugin for Ferdium | 8 | * Help Scout integration plugin for Ferdium |
9 | * | 9 | * |
@@ -11,110 +11,112 @@ function _interopRequireDefault(obj) { | |||
11 | * @since 1.2.0 | 11 | * @since 1.2.0 |
12 | */ | 12 | */ |
13 | 13 | ||
14 | |||
15 | /** | 14 | /** |
16 | * Scripts specific to ticket pages | 15 | * Scripts specific to ticket pages |
17 | * | 16 | * |
18 | * @since 1.2.0 | 17 | * @since 1.2.0 |
19 | */ | 18 | */ |
20 | let ticketScripts = { | 19 | const ticketScripts = { |
21 | init : function() { | 20 | init() { |
22 | this.processCopy(); | 21 | this.processCopy(); |
23 | }, | 22 | }, |
24 | /** | 23 | /** |
25 | * Handles clicking the copy link | 24 | * Handles clicking the copy link |
26 | * | 25 | * |
27 | * @since 1.2.0 | 26 | * @since 1.2.0 |
28 | * @return {void} | 27 | * @return {void} |
29 | */ | 28 | */ |
30 | processCopy : function() { | 29 | processCopy() { |
31 | $('#copyLink').on('click', function(e) { | 30 | $('#copyLink').on('click', function (e) { |
32 | e.preventDefault(); | 31 | e.preventDefault(); |
33 | 32 | ||
34 | copyToClipboard(); | 33 | copyToClipboard(); |
35 | 34 | ||
36 | $('.link-copied').fadeIn('fast').css('display', 'block'); | 35 | $('.link-copied').fadeIn('fast').css('display', 'block'); |
37 | }); | 36 | }); |
38 | 37 | ||
39 | $('#closeLink').on('click', function(e) { | 38 | $('#closeLink').on('click', function (e) { |
40 | e.preventDefault(); | 39 | e.preventDefault(); |
41 | 40 | ||
42 | $('.link-copied').fadeOut('fast', function () { | 41 | $('.link-copied').fadeOut('fast', function () { |
43 | $(this).css('display', 'none'); | 42 | $(this).css('display', 'none'); |
44 | }); | 43 | }); |
45 | }); | 44 | }); |
46 | } | 45 | }, |
47 | }; | 46 | }; |
48 | 47 | ||
49 | |||
50 | /** | 48 | /** |
51 | * The core Ferdium message handler | 49 | * The core Ferdium message handler |
52 | * | 50 | * |
53 | * @since 1.0.0 | 51 | * @since 1.0.0 |
54 | */ | 52 | */ |
55 | module.exports = (Ferdium) => { | 53 | module.exports = Ferdium => { |
56 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 54 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
57 | 55 | ||
58 | /** | 56 | /** |
59 | * Get messages for the Ferdium loop | 57 | * Get messages for the Ferdium loop |
60 | * | 58 | * |
61 | * @since 1.0.0 | 59 | * @since 1.0.0 |
62 | * @return {void} | 60 | * @return {void} |
63 | */ | 61 | */ |
64 | function getMessages() { | 62 | function getMessages() { |
65 | let mine = ''; | 63 | let mine = ''; |
66 | let unassigned = ''; | 64 | let unassigned = ''; |
67 | let total = '0'; | 65 | let total = '0'; |
68 | 66 | ||
69 | /** | 67 | /** |
70 | * Since Help Scout loads things asyncronously, | 68 | * Since Help Scout loads things asyncronously, |
71 | * we have to trigger everything in the loop for | 69 | * we have to trigger everything in the loop for |
72 | * it to get recognized. | 70 | * it to get recognized. |
73 | */ | 71 | */ |
74 | addCopyLink(); | 72 | addCopyLink(); |
75 | ticketScripts.init(); | 73 | ticketScripts.init(); |
76 | 74 | ||
77 | if ($('.dropdown.mailboxes').length > 0 && $('.dropdown.mailboxes a').hasClass('active')) { | 75 | if ( |
78 | // Individual tickets | 76 | $('.dropdown.mailboxes').length > 0 && |
79 | mine = $('li.mine a .badge').text(); | 77 | $('.dropdown.mailboxes a').hasClass('active') |
80 | unassigned = $('li.unassigned a .badge').text(); | 78 | ) { |
81 | } else if (window.location.href === 'https://secure.helpscout.net/dashboard/') { | 79 | // Individual tickets |
82 | // Main dashboard | 80 | mine = $('li.mine a .badge').text(); |
83 | mine = 0; | 81 | unassigned = $('li.unassigned a .badge').text(); |
84 | unassigned = 0; | 82 | } else if ( |
85 | 83 | window.location.href === 'https://secure.helpscout.net/dashboard/' | |
86 | $('.card.mailbox .c-list').each(function() { | 84 | ) { |
87 | let m = $(this).find('a:nth-child(2)').find('.count').text(); | 85 | // Main dashboard |
88 | let u = $(this).find('a:first-child').find('.count').text(); | 86 | mine = 0; |
89 | 87 | unassigned = 0; | |
90 | if ($.isNumeric(m)) { | 88 | |
91 | mine += Number.parseInt(m); | 89 | $('.card.mailbox .c-list').each(function () { |
92 | } | 90 | const m = $(this).find('a:nth-child(2)').find('.count').text(); |
93 | 91 | const u = $(this).find('a:first-child').find('.count').text(); | |
94 | if ($.isNumeric(u)) { | 92 | |
95 | unassigned += Number.parseInt(u); | 93 | if ($.isNumeric(m)) { |
96 | } | 94 | mine += Number.parseInt(m); |
97 | }); | 95 | } |
98 | 96 | ||
99 | mine = mine.toString(); | 97 | if ($.isNumeric(u)) { |
100 | unassigned = unassigned.toString(); | 98 | unassigned += Number.parseInt(u); |
101 | } | 99 | } |
102 | 100 | }); | |
103 | if (mine !== '') { | 101 | |
104 | total = mine; | 102 | mine = mine.toString(); |
105 | } | 103 | unassigned = unassigned.toString(); |
106 | 104 | } | |
107 | if (unassigned !== '') { | 105 | |
108 | total = total + '/' + unassigned; | 106 | if (mine !== '') { |
109 | } | 107 | total = mine; |
110 | 108 | } | |
111 | Ferdium.setBadge(total); | 109 | |
112 | } | 110 | if (unassigned !== '') { |
113 | 111 | total = `${total}/${unassigned}`; | |
114 | Ferdium.loop(getMessages); | 112 | } |
113 | |||
114 | Ferdium.setBadge(total); | ||
115 | } | ||
116 | |||
117 | Ferdium.loop(getMessages); | ||
115 | }; | 118 | }; |
116 | 119 | ||
117 | |||
118 | /** | 120 | /** |
119 | * Add copy link to the conversation toolbar | 121 | * Add copy link to the conversation toolbar |
120 | * | 122 | * |
@@ -122,13 +124,16 @@ module.exports = (Ferdium) => { | |||
122 | * @return {void} | 124 | * @return {void} |
123 | */ | 125 | */ |
124 | function addCopyLink() { | 126 | function addCopyLink() { |
125 | if ($('.convo-toolbar').length > 0 && $('#copyLink').length === 0) { | 127 | if ($('.convo-toolbar').length > 0 && $('#copyLink').length === 0) { |
126 | $('#actions-dd .more').append('<li class="actions-dd"><a id="copyLink" class="actions-dd">Copy Link</a></li>'); | 128 | $('#actions-dd .more').append( |
127 | $('.c-convo-toolbar').after('<div class="link-copied" style="display: none">Ticket URL copied to clipboard!<a id="closeLink">x</a></div>'); | 129 | '<li class="actions-dd"><a id="copyLink" class="actions-dd">Copy Link</a></li>', |
128 | } | 130 | ); |
131 | $('.c-convo-toolbar').after( | ||
132 | '<div class="link-copied" style="display: none">Ticket URL copied to clipboard!<a id="closeLink">x</a></div>', | ||
133 | ); | ||
134 | } | ||
129 | } | 135 | } |
130 | 136 | ||
131 | |||
132 | /** | 137 | /** |
133 | * Process copying URLs to clipboard | 138 | * Process copying URLs to clipboard |
134 | * | 139 | * |
@@ -136,28 +141,28 @@ function addCopyLink() { | |||
136 | * @return {void} | 141 | * @return {void} |
137 | */ | 142 | */ |
138 | function copyToClipboard() { | 143 | function copyToClipboard() { |
139 | let targetId = '_hiddenURLField'; | 144 | const targetId = '_hiddenURLField'; |
140 | let target = document.querySelector(targetId); | 145 | let target = document.querySelector(targetId); |
141 | 146 | ||
142 | if(!target) { | 147 | if (!target) { |
143 | target = document.createElement('textarea'); | 148 | target = document.createElement('textarea'); |
144 | target.style.position = 'absolute'; | 149 | target.style.position = 'absolute'; |
145 | target.style.left = '-9999px'; | 150 | target.style.left = '-9999px'; |
146 | target.style.top = '0'; | 151 | target.style.top = '0'; |
147 | target.id = targetId; | 152 | target.id = targetId; |
148 | document.body.append(target); | 153 | document.body.append(target); |
149 | } | 154 | } |
150 | 155 | ||
151 | target.textContent = window.location.href; | 156 | target.textContent = window.location.href; |
152 | 157 | ||
153 | let currentFocus = document.activeElement; | 158 | const currentFocus = document.activeElement; |
154 | 159 | ||
155 | target.focus(); | 160 | target.focus(); |
156 | target.setSelectionRange(0, target.value.length); | 161 | target.setSelectionRange(0, target.value.length); |
157 | 162 | ||
158 | document.execCommand('copy'); | 163 | document.execCommand('copy'); |
159 | 164 | ||
160 | if(currentFocus && typeof currentFocus.focus === 'function') { | 165 | if (currentFocus && typeof currentFocus.focus === 'function') { |
161 | currentFocus.focus(); | 166 | currentFocus.focus(); |
162 | } | 167 | } |
163 | } | 168 | } |
diff --git a/recipes/hey/package.json b/recipes/hey/package.json index 090dbaa..b7fb950 100644 --- a/recipes/hey/package.json +++ b/recipes/hey/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hey", | 2 | "id": "hey", |
3 | "name": "Hey", | 3 | "name": "Hey", |
4 | "version": "1.1.1", | 4 | "version": "1.2.0", |
5 | "repository": "https://github.com/cpwood/recipe-hey", | 5 | "repository": "https://github.com/cpwood/recipe-hey", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.hey.com", | 7 | "serviceURL": "https://app.hey.com", |
diff --git a/recipes/hey/webview.js b/recipes/hey/webview.js index d0b885a..40d8a6e 100644 --- a/recipes/hey/webview.js +++ b/recipes/hey/webview.js | |||
@@ -1,11 +1,17 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | if (document.location.href == 'https://app.hey.com/') { | 9 | if (document.location.href === 'https://app.hey.com/') { |
4 | let screener = 0; | 10 | let screener = 0; |
5 | let unread = 0; | 11 | let unread = 0; |
6 | 12 | ||
7 | if (document.querySelectorAll('.btn--icon-screener').length > 0) { | 13 | if (document.querySelectorAll('.btn--icon-screener').length > 0) { |
8 | let text = document.querySelectorAll('.btn--icon-screener')[0] | 14 | const text = document.querySelectorAll('.btn--icon-screener')[0] |
9 | .textContent; | 15 | .textContent; |
10 | if (text) { | 16 | if (text) { |
11 | const parsedText = Ferdium.safeParseInt(/\d+/.exec(text)); | 17 | const parsedText = Ferdium.safeParseInt(/\d+/.exec(text)); |
@@ -13,15 +19,12 @@ module.exports = Ferdium => { | |||
13 | } | 19 | } |
14 | } | 20 | } |
15 | 21 | ||
16 | let postings = document.querySelectorAll('.posting'); | 22 | const postings = document.querySelectorAll('.posting'); |
17 | 23 | ||
18 | if (postings.length > 0) { | 24 | if (postings.length > 0) { |
19 | for (const p of postings) { | 25 | for (const p of postings) { |
20 | if ( | 26 | if (p.nodeName === 'ARTICLE' && p.dataset.seen !== 'true') { |
21 | p.nodeName == 'ARTICLE' && | 27 | unread += 1; |
22 | p.dataset.seen !== 'true' | ||
23 | ) { | ||
24 | unread++; | ||
25 | } | 28 | } |
26 | } | 29 | } |
27 | } | 30 | } |
@@ -31,4 +34,6 @@ module.exports = Ferdium => { | |||
31 | }; | 34 | }; |
32 | 35 | ||
33 | Ferdium.loop(getMessages); | 36 | Ferdium.loop(getMessages); |
37 | |||
38 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
34 | }; | 39 | }; |
diff --git a/recipes/hipchat/index.js b/recipes/hipchat/index.js index ce3256b..e786bcb 100644 --- a/recipes/hipchat/index.js +++ b/recipes/hipchat/index.js | |||
@@ -1,27 +1,57 @@ | |||
1 | function _asyncToGenerator(fn) { return function () { const gen = Reflect.apply(fn, this, arguments); return new Promise((resolve, reject) => { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then((value) => { step('next', value); }, (error) => { step('throw', error); }); } } return step('next'); }); }; } | 1 | function _asyncToGenerator(fn) { |
2 | return function () { | ||
3 | const gen = Reflect.apply(fn, this, arguments); | ||
4 | return new Promise((resolve, reject) => { | ||
5 | function step(key, arg) { | ||
6 | try { | ||
7 | var info = gen[key](arg); | ||
8 | var value = info.value; | ||
9 | } catch (error) { | ||
10 | reject(error); | ||
11 | return; | ||
12 | } | ||
13 | if (info.done) { | ||
14 | resolve(value); | ||
15 | } else { | ||
16 | // eslint-disable-next-line consistent-return | ||
17 | return Promise.resolve(value).then( | ||
18 | value => { | ||
19 | step('next', value); | ||
20 | }, | ||
21 | error => { | ||
22 | step('throw', error); | ||
23 | }, | ||
24 | ); | ||
25 | } | ||
26 | } | ||
27 | return step('next'); | ||
28 | }); | ||
29 | }; | ||
30 | } | ||
2 | 31 | ||
3 | module.exports = Ferdium => class HipChat extends Ferdium { | 32 | module.exports = Ferdium => |
4 | validateUrl(url) { | 33 | class HipChat extends Ferdium { |
5 | return _asyncToGenerator(function* () { | 34 | validateUrl(url) { |
6 | try { | 35 | return _asyncToGenerator(function* () { |
7 | const resp = yield window.fetch(`${url}/api/features`, { | 36 | try { |
8 | method: 'GET', | 37 | const resp = yield window.fetch(`${url}/api/features`, { |
9 | headers: { | 38 | method: 'GET', |
10 | 'Content-Type': 'application/json', | 39 | headers: { |
11 | }, | 40 | 'Content-Type': 'application/json', |
12 | }); | 41 | }, |
13 | const data = yield resp.json(); | 42 | }); |
43 | const data = yield resp.json(); | ||
14 | 44 | ||
15 | return Object.hasOwnProperty.call(data, 'features'); | 45 | return Object.hasOwnProperty.call(data, 'features'); |
16 | } catch (error) { | 46 | } catch (error) { |
17 | console.error(error); | 47 | console.error(error); |
18 | } | 48 | } |
19 | 49 | ||
20 | return false; | 50 | return false; |
21 | })(); | 51 | })(); |
22 | } | 52 | } |
23 | 53 | ||
24 | buildUrl(url) { | 54 | buildUrl(url) { |
25 | return `${url}/chat`; | 55 | return `${url}/chat`; |
26 | } | 56 | } |
27 | }; | 57 | }; |
diff --git a/recipes/hipchat/package.json b/recipes/hipchat/package.json index 0be97cc..0f9f3f0 100644 --- a/recipes/hipchat/package.json +++ b/recipes/hipchat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hipchat", | 2 | "id": "hipchat", |
3 | "name": "HipChat", | 3 | "name": "HipChat", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.hipchat.com/chat", | 7 | "serviceURL": "https://{teamId}.hipchat.com/chat", |
diff --git a/recipes/hipchat/webview.js b/recipes/hipchat/webview.js index 229b376..6871fbb 100644 --- a/recipes/hipchat/webview.js +++ b/recipes/hipchat/webview.js | |||
@@ -1,11 +1,21 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directMessages = document.querySelectorAll('.hc-mention').length; | 9 | const directMessages = document.querySelectorAll('.hc-mention').length; |
4 | const allMessages = document.querySelectorAll('.aui-badge:not(.hc-mention)').length - directMessages; | 10 | const allMessages = |
11 | document.querySelectorAll('.aui-badge:not(.hc-mention)').length - | ||
12 | directMessages; | ||
5 | 13 | ||
6 | // set Ferdium badge | 14 | // set Ferdium badge |
7 | Ferdium.setBadge(directMessages, allMessages); | 15 | Ferdium.setBadge(directMessages, allMessages); |
8 | }; | 16 | }; |
9 | 17 | ||
10 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 21 | }; |
diff --git a/recipes/home-assistant/package.json b/recipes/home-assistant/package.json index 0a8ad6a..1613ed4 100644 --- a/recipes/home-assistant/package.json +++ b/recipes/home-assistant/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "home-assistant", | 2 | "id": "home-assistant", |
3 | "name": "Home Assistant", | 3 | "name": "Home Assistant", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true, | 7 | "hasCustomUrl": true, |
diff --git a/recipes/home-assistant/webview.js b/recipes/home-assistant/webview.js index 7a0ab47..aee42c0 100644 --- a/recipes/home-assistant/webview.js +++ b/recipes/home-assistant/webview.js | |||
@@ -1,12 +1,26 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const badges = document.querySelector("home-assistant").shadowRoot.querySelector("home-assistant-main").shadowRoot.querySelector("ha-sidebar").shadowRoot.querySelectorAll(".notification-badge"); | 9 | const badges = document |
10 | .querySelector('home-assistant') | ||
11 | .shadowRoot.querySelector('home-assistant-main') | ||
12 | .shadowRoot.querySelector('ha-sidebar') | ||
13 | .shadowRoot.querySelectorAll('.notification-badge'); | ||
4 | if (badges.length > 0) { | 14 | if (badges.length > 0) { |
5 | var count = Ferdium.safeParseInt(badges[0].textContent.replace(/[^\p{N}]/gu, '')); | 15 | const count = Ferdium.safeParseInt( |
6 | Ferdium.setBadge(count) | 16 | badges[0].textContent.replaceAll(/[^\p{N}]/gu, ''), |
17 | ); | ||
18 | Ferdium.setBadge(count); | ||
7 | } else { | 19 | } else { |
8 | Ferdium.setBadge(0) | 20 | Ferdium.setBadge(0); |
9 | } | 21 | } |
10 | }; | 22 | }; |
11 | Ferdium.loop(getMessages); | 23 | Ferdium.loop(getMessages); |
24 | |||
25 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 26 | }; |
diff --git a/recipes/hostnet/package.json b/recipes/hostnet/package.json index 24487b8..f9391ab 100644 --- a/recipes/hostnet/package.json +++ b/recipes/hostnet/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hostnet", | 2 | "id": "hostnet", |
3 | "name": "Hostnet", | 3 | "name": "Hostnet", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://appsuite.hostnet.nl/appsuite/" | 7 | "serviceURL": "https://appsuite.hostnet.nl/appsuite/" |
diff --git a/recipes/hostnet/webview.js b/recipes/hostnet/webview.js index 9a1266f..a2149d7 100644 --- a/recipes/hostnet/webview.js +++ b/recipes/hostnet/webview.js | |||
@@ -1,7 +1,20 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | Ferdium.setBadge(Ferdium.safeParseInt(document.querySelectorAll('.badge.topbar-launcherbadge')[0].firstChild.data)); | 9 | Ferdium.setBadge( |
10 | Ferdium.safeParseInt( | ||
11 | document.querySelectorAll('.badge.topbar-launcherbadge')[0].firstChild | ||
12 | .data, | ||
13 | ), | ||
14 | ); | ||
4 | }; | 15 | }; |
5 | 16 | ||
6 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
7 | }; | 20 | }; |
diff --git a/recipes/hubstaff/package.json b/recipes/hubstaff/package.json index 36a3d87..289ba18 100644 --- a/recipes/hubstaff/package.json +++ b/recipes/hubstaff/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hubstaff", | 2 | "id": "hubstaff", |
3 | "name": "HubStaff", | 3 | "name": "HubStaff", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.hubstaff.com/login_now", | 7 | "serviceURL": "https://app.hubstaff.com/login_now", |
diff --git a/recipes/hubstaff/webview.js b/recipes/hubstaff/webview.js index c925f18..8527a4d 100644 --- a/recipes/hubstaff/webview.js +++ b/recipes/hubstaff/webview.js | |||
@@ -1,15 +1,29 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | // TODO: If your hubstaff service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your hubstaff service has unread messages, uncomment these lines to implement the logic for updating the badges |
3 | const getMessages = () => { | 9 | const getMessages = () => { |
4 | // TODO: Insert your notification-finding code here | 10 | // TODO: Insert your notification-finding code here |
5 | let directMessages = 0; | 11 | let directMessages = 0; |
6 | let indirectMessages = 0; | 12 | let indirectMessages = 0; |
7 | const notificationContainers = document.querySelectorAll('.notifications-number'); | 13 | const notificationContainers = document.querySelectorAll( |
8 | if (notificationContainers){ | 14 | '.notifications-number', |
9 | directMessages = Ferdium.safeParseInt(notificationContainers[0].textContent); | 15 | ); |
10 | indirectMessages = Ferdium.safeParseInt(notificationContainers[1].textContent); | 16 | if (notificationContainers) { |
17 | directMessages = Ferdium.safeParseInt( | ||
18 | notificationContainers[0].textContent, | ||
19 | ); | ||
20 | indirectMessages = Ferdium.safeParseInt( | ||
21 | notificationContainers[1].textContent, | ||
22 | ); | ||
11 | } | 23 | } |
12 | Ferdium.setBadge(directMessages, indirectMessages); | 24 | Ferdium.setBadge(directMessages, indirectMessages); |
13 | }; | 25 | }; |
14 | Ferdium.loop(getMessages); | 26 | Ferdium.loop(getMessages); |
27 | |||
28 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
15 | }; | 29 | }; |
diff --git a/recipes/iCloud/package.json b/recipes/iCloud/package.json index 836e92a..997b575 100644 --- a/recipes/iCloud/package.json +++ b/recipes/iCloud/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "iCloud", | 2 | "id": "iCloud", |
3 | "name": "iCloud", | 3 | "name": "iCloud", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.icloud.com/" | 7 | "serviceURL": "https://www.icloud.com/" |
diff --git a/recipes/iCloud/webview.js b/recipes/iCloud/webview.js index 86bb422..2a81dec 100644 --- a/recipes/iCloud/webview.js +++ b/recipes/iCloud/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/iberbox/package.json b/recipes/iberbox/package.json index 13e43c5..7f51810 100644 --- a/recipes/iberbox/package.json +++ b/recipes/iberbox/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "iberbox", | 2 | "id": "iberbox", |
3 | "name": "IberBox", | 3 | "name": "IberBox", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://iberbox.com/login" | 7 | "serviceURL": "https://iberbox.com/login" |
diff --git a/recipes/iberbox/webview.js b/recipes/iberbox/webview.js index 56a20b6..1119219 100644 --- a/recipes/iberbox/webview.js +++ b/recipes/iberbox/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/icloud-reminders/package.json b/recipes/icloud-reminders/package.json index 96d5dbd..7f8ff7c 100644 --- a/recipes/icloud-reminders/package.json +++ b/recipes/icloud-reminders/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "icloud-reminders", | 2 | "id": "icloud-reminders", |
3 | "name": "iCloud Reminders", | 3 | "name": "iCloud Reminders", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.icloud.com/reminders" | 7 | "serviceURL": "https://www.icloud.com/reminders" |
diff --git a/recipes/icloud-reminders/webview.js b/recipes/icloud-reminders/webview.js index 86bb422..2a81dec 100644 --- a/recipes/icloud-reminders/webview.js +++ b/recipes/icloud-reminders/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/icq/package.json b/recipes/icq/package.json index 463711d..d3f5878 100644 --- a/recipes/icq/package.json +++ b/recipes/icq/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "icq", | 2 | "id": "icq", |
3 | "name": "ICQ", | 3 | "name": "ICQ", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/meetfranz/recipe-icq", | 6 | "repository": "https://github.com/meetfranz/recipe-icq", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/icq/webview.js b/recipes/icq/webview.js index c0ba8e9..e5b4e60 100644 --- a/recipes/icq/webview.js +++ b/recipes/icq/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directs = 0; | 9 | let directs = 0; |
@@ -7,7 +13,7 @@ module.exports = Ferdium => { | |||
7 | for (const element of elements) { | 13 | for (const element of elements) { |
8 | if ( | 14 | if ( |
9 | Ferdium.safeParseInt( | 15 | Ferdium.safeParseInt( |
10 | element.textContent && element.textContent.replace(/[^\d.]/g, ''), | 16 | element.textContent && element.textContent.replaceAll(/[^\d.]/g, ''), |
11 | ) > 0 | 17 | ) > 0 |
12 | ) { | 18 | ) { |
13 | directs += 1; // count 1 per channel with messages | 19 | directs += 1; // count 1 per channel with messages |
@@ -18,4 +24,6 @@ module.exports = Ferdium => { | |||
18 | }; | 24 | }; |
19 | 25 | ||
20 | Ferdium.loop(getMessages); | 26 | Ferdium.loop(getMessages); |
27 | |||
28 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
21 | }; | 29 | }; |
diff --git a/recipes/idobata/package.json b/recipes/idobata/package.json index 17d488d..7421705 100644 --- a/recipes/idobata/package.json +++ b/recipes/idobata/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "idobata", | 2 | "id": "idobata", |
3 | "name": "Idobata", | 3 | "name": "Idobata", |
4 | "version": "0.3.0", | 4 | "version": "0.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://idobata.io", | 7 | "serviceURL": "https://idobata.io", |
diff --git a/recipes/idobata/webview.js b/recipes/idobata/webview.js index b6cbbe7..352b012 100644 --- a/recipes/idobata/webview.js +++ b/recipes/idobata/webview.js | |||
@@ -1,10 +1,18 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const title = document.querySelector('title').textContent.match(/\d+/); | 9 | const title = document.querySelector('title').textContent.match(/\d+/); |
4 | const count = title !== null ? title[0] : 0; | 10 | const count = title === null ? 0 : title[0]; |
5 | 11 | ||
6 | Ferdium.setBadge(count); | 12 | Ferdium.setBadge(count); |
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/infomaniak-mail/package.json b/recipes/infomaniak-mail/package.json index a90ce82..b3925f3 100644 --- a/recipes/infomaniak-mail/package.json +++ b/recipes/infomaniak-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "infomaniak-mail", | 2 | "id": "infomaniak-mail", |
3 | "name": "Infomaniak Mail", | 3 | "name": "Infomaniak Mail", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.infomaniak.com/" | 7 | "serviceURL": "https://mail.infomaniak.com/" |
diff --git a/recipes/infomaniak-mail/webview.js b/recipes/infomaniak-mail/webview.js index 23516b2..5af4d25 100644 --- a/recipes/infomaniak-mail/webview.js +++ b/recipes/infomaniak-mail/webview.js | |||
@@ -1,10 +1,18 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // This selects the first folder (the inbox and reads its unread messages count) | 9 | // This selects the first folder (the inbox and reads its unread messages count) |
4 | const inboxField = document.querySelector('.ws-tree-node-content') | 10 | const inboxField = document.querySelector('.ws-tree-node-content'); |
5 | const inboxCountField = inboxField.querySelector('.ws-tree-node-badge'); | 11 | const inboxCountField = inboxField.querySelector('.ws-tree-node-badge'); |
6 | const inboxCountText = inboxCountField ? inboxCountField.textContent : null; | 12 | const inboxCountText = inboxCountField ? inboxCountField.textContent : null; |
7 | const inboxCount = inboxCountText ? Ferdium.safeParseInt(inboxCountText) : 0; | 13 | const inboxCount = inboxCountText |
14 | ? Ferdium.safeParseInt(inboxCountText) | ||
15 | : 0; | ||
8 | 16 | ||
9 | let unimportantCount = 0; | 17 | let unimportantCount = 0; |
10 | 18 | ||
@@ -12,12 +20,18 @@ module.exports = Ferdium => { | |||
12 | // This selects the first folder with an unread message count. | 20 | // This selects the first folder with an unread message count. |
13 | // The actaul count and the total of all other folders is not needed as the badge has no number. | 21 | // The actaul count and the total of all other folders is not needed as the badge has no number. |
14 | const totalCountField = document.querySelector('.ws-tree-node-badge'); | 22 | const totalCountField = document.querySelector('.ws-tree-node-badge'); |
15 | const totalCountText = totalCountField ? totalCountField.textContent : null; | 23 | const totalCountText = totalCountField |
16 | unimportantCount = totalCountText ? Ferdium.safeParseInt(totalCountText) : 0; | 24 | ? totalCountField.textContent |
25 | : null; | ||
26 | unimportantCount = totalCountText | ||
27 | ? Ferdium.safeParseInt(totalCountText) | ||
28 | : 0; | ||
17 | } | 29 | } |
18 | 30 | ||
19 | Ferdium.setBadge(inboxCount, unimportantCount); | 31 | Ferdium.setBadge(inboxCount, unimportantCount); |
20 | }; | 32 | }; |
21 | 33 | ||
22 | Ferdium.loop(getMessages); | 34 | Ferdium.loop(getMessages); |
35 | |||
36 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
23 | }; | 37 | }; |
diff --git a/recipes/inoreader/package.json b/recipes/inoreader/package.json index 7010ec2..9031b12 100644 --- a/recipes/inoreader/package.json +++ b/recipes/inoreader/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "inoreader", | 2 | "id": "inoreader", |
3 | "name": "Inoreader", | 3 | "name": "Inoreader", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/annagrram/recipe-inoreader", | 6 | "repository": "https://github.com/annagrram/recipe-inoreader", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/inoreader/webview.js b/recipes/inoreader/webview.js index a6b2232..295d22b 100644 --- a/recipes/inoreader/webview.js +++ b/recipes/inoreader/webview.js | |||
@@ -1,4 +1,10 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const all_articles = document.querySelector('#unread_cnt_all_items'); | 9 | const all_articles = document.querySelector('#unread_cnt_all_items'); |
4 | if (!all_articles) return; | 10 | if (!all_articles) return; |
@@ -8,4 +14,6 @@ module.exports = (Ferdium) => { | |||
8 | }; | 14 | }; |
9 | 15 | ||
10 | Ferdium.loop(getMessages); | 16 | Ferdium.loop(getMessages); |
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 19 | }; |
diff --git a/recipes/instagram-direct-messages/index.js b/recipes/instagram-direct-messages/index.js index bfa1949..f0ebebe 100644 --- a/recipes/instagram-direct-messages/index.js +++ b/recipes/instagram-direct-messages/index.js | |||
@@ -1,7 +1,9 @@ | |||
1 | "use strict"; | 1 | module.exports = Ferdium => |
2 | 2 | class Messenger extends Ferdium { | |
3 | module.exports = Ferdium => class Messenger extends Ferdium { | 3 | overrideUserAgent() { |
4 | overrideUserAgent() { | 4 | return window.navigator.userAgent.replaceAll( |
5 | return window.navigator.userAgent.replace(/(Ferdium|Electron)(\S+\s)/g, ''); | 5 | /(Ferdium|Electron)(\S+\s)/g, |
6 | } | 6 | '', |
7 | }; | 7 | ); |
8 | } | ||
9 | }; | ||
diff --git a/recipes/instagram-direct-messages/package.json b/recipes/instagram-direct-messages/package.json index 927a92a..20ea5b5 100644 --- a/recipes/instagram-direct-messages/package.json +++ b/recipes/instagram-direct-messages/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "instagram-direct-messages", | 2 | "id": "instagram-direct-messages", |
3 | "name": "Instagram Direct Messages", | 3 | "name": "Instagram Direct Messages", |
4 | "version": "1.0.2", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.instagram.com/direct/inbox/", | 7 | "serviceURL": "https://www.instagram.com/direct/inbox/", |
diff --git a/recipes/instagram-direct-messages/webview.js b/recipes/instagram-direct-messages/webview.js index a59013a..01187b8 100644 --- a/recipes/instagram-direct-messages/webview.js +++ b/recipes/instagram-direct-messages/webview.js | |||
@@ -1,21 +1,21 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 3 | } |
8 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
9 | setInterval(() => { | 7 | setInterval(() => { |
10 | document.querySelector("._lz6s.Hz2lF").style.display = "none"; | 8 | document.querySelector('._lz6s.Hz2lF').style.display = 'none'; |
11 | document.querySelector(".t30g8.L1C6I").style.paddingTop = 0; | 9 | document.querySelector('.t30g8.L1C6I').style.paddingTop = 0; |
12 | document.querySelector(".i0EQd").style.maxWidth = 'unset !important'; | 10 | document.querySelector('.i0EQd').style.maxWidth = 'unset !important'; |
13 | }, 3000); | 11 | }, 3000); |
14 | 12 | ||
15 | module.exports = (Ferdium) => { | 13 | module.exports = Ferdium => { |
16 | const getMessages = () => { | 14 | const getMessages = () => { |
17 | const element = document.querySelector('a[href^="/direct/inbox"]'); | 15 | const element = document.querySelector('a[href^="/direct/inbox"]'); |
18 | Ferdium.setBadge(element.textContent ? Ferdium.safeParseInt(element.textContent) : 0); | 16 | Ferdium.setBadge( |
17 | element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, | ||
18 | ); | ||
19 | }; | 19 | }; |
20 | 20 | ||
21 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
diff --git a/recipes/instagram/index.js b/recipes/instagram/index.js index d8beaa5..17de727 100644 --- a/recipes/instagram/index.js +++ b/recipes/instagram/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = Ferdium => class Instagram extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Instagram extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/instagram/package.json b/recipes/instagram/package.json index beb7ce0..5c798f3 100644 --- a/recipes/instagram/package.json +++ b/recipes/instagram/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "instagram", | 2 | "id": "instagram", |
3 | "name": "Instagram", | 3 | "name": "Instagram", |
4 | "version": "2.4.2", | 4 | "version": "2.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://instagram.com/direct/inbox", | 7 | "serviceURL": "https://instagram.com/direct/inbox", |
diff --git a/recipes/instagram/webview.js b/recipes/instagram/webview.js index c2a8433..a4a5a8a 100644 --- a/recipes/instagram/webview.js +++ b/recipes/instagram/webview.js | |||
@@ -1,48 +1,41 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const element = document.querySelector('a[href^="/direct/inbox"]'); | 9 | const element = document.querySelector('a[href^="/direct/inbox"]'); |
10 | Ferdium.setBadge(element.textContent ? Ferdium.safeParseInt(element.textContent) : 0); | 10 | Ferdium.setBadge( |
11 | element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, | ||
12 | ); | ||
11 | }; | 13 | }; |
12 | 14 | ||
13 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
14 | 16 | ||
15 | // https://github.com/ferdium/ferdium-recipes/blob/9d715597a600710c20f75412d3dcd8cdb7b3c39e/docs/frontend_api.md#usage-4 | 17 | // https://github.com/ferdium/ferdium-recipes/blob/9d715597a600710c20f75412d3dcd8cdb7b3c39e/docs/frontend_api.md#usage-4 |
16 | // Helper that activates DarkReader and injects your darkmode.css at the same time | 18 | // Helper that activates DarkReader and injects your darkmode.css at the same time |
17 | Ferdium.handleDarkMode((isEnabled) => { | 19 | Ferdium.handleDarkMode(isEnabled => { |
18 | 20 | const url = new URL(window.location.href); | |
19 | var url = new URL(window.location.href); | 21 | const { searchParams } = url; |
20 | var searchParams = url.searchParams; | 22 | const isDarkModeParam = searchParams.get('theme'); |
21 | var isDarkModeParam = searchParams.get('theme'); | 23 | let changedParams = false; |
22 | var changedParams = false; | ||
23 | 24 | ||
24 | if (isEnabled) { | 25 | if (isEnabled) { |
25 | isDarkModeParam ? null : | 26 | isDarkModeParam |
26 | ( | 27 | ? null |
27 | searchParams.set('theme', 'dark'), | 28 | : (searchParams.set('theme', 'dark'), (changedParams = true)); |
28 | changedParams = true | ||
29 | ); | ||
30 | } else { | 29 | } else { |
31 | isDarkModeParam ? | 30 | isDarkModeParam |
32 | ( | 31 | ? (searchParams.delete('theme', 'dark'), (changedParams = true)) |
33 | searchParams.delete('theme', 'dark'), | 32 | : null; |
34 | changedParams = true | ||
35 | ) | ||
36 | : null; | ||
37 | } | 33 | } |
38 | 34 | ||
39 | changedParams ? | 35 | changedParams |
40 | ( | 36 | ? ((url.search = searchParams.toString()), |
41 | url.search = searchParams.toString(), | 37 | (window.location.href = url.toString())) |
42 | window.location.href = url.toString() | 38 | : null; |
43 | ) | ||
44 | : null; | ||
45 | |||
46 | }); | 39 | }); |
47 | 40 | ||
48 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 41 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
diff --git a/recipes/intercom/package.json b/recipes/intercom/package.json index f863184..c483ae2 100644 --- a/recipes/intercom/package.json +++ b/recipes/intercom/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "intercom", | 2 | "id": "intercom", |
3 | "name": "Intercom", | 3 | "name": "Intercom", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.intercom.io/", | 7 | "serviceURL": "https://app.intercom.io/", |
diff --git a/recipes/intercom/webview.js b/recipes/intercom/webview.js index 69ba2f6..08225a8 100644 --- a/recipes/intercom/webview.js +++ b/recipes/intercom/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const numMessages = Ferdium.safeParseInt( | 9 | const numMessages = Ferdium.safeParseInt( |
@@ -9,4 +15,6 @@ module.exports = Ferdium => { | |||
9 | }; | 15 | }; |
10 | 16 | ||
11 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 20 | }; |
diff --git a/recipes/irccloud/package.json b/recipes/irccloud/package.json index 8420757..bd96866 100644 --- a/recipes/irccloud/package.json +++ b/recipes/irccloud/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "irccloud", | 2 | "id": "irccloud", |
3 | "name": "IRCCloud", | 3 | "name": "IRCCloud", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/albertomurillo/recipe-irccloud", | 6 | "repository": "https://github.com/albertomurillo/recipe-irccloud", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/irccloud/webview.js b/recipes/irccloud/webview.js index c70e8f6..16d1519 100644 --- a/recipes/irccloud/webview.js +++ b/recipes/irccloud/webview.js | |||
@@ -1,10 +1,22 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directMessages = document.querySelectorAll('.buffer.conversation.active.unread.activeBadge').length; | 9 | const directMessages = document.querySelectorAll( |
4 | const indirectMessages = document.querySelectorAll('.buffer.channel.active.unread').length; | 10 | '.buffer.conversation.active.unread.activeBadge', |
11 | ).length; | ||
12 | const indirectMessages = document.querySelectorAll( | ||
13 | '.buffer.channel.active.unread', | ||
14 | ).length; | ||
5 | 15 | ||
6 | Ferdium.setBadge(directMessages, indirectMessages); | 16 | Ferdium.setBadge(directMessages, indirectMessages); |
7 | }; | 17 | }; |
8 | 18 | ||
9 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 22 | }; |
diff --git a/recipes/iris-messenger/package.json b/recipes/iris-messenger/package.json index 92cce54..7b46719 100644 --- a/recipes/iris-messenger/package.json +++ b/recipes/iris-messenger/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "iris-messenger", | 2 | "id": "iris-messenger", |
3 | "name": "Iris Messenger", | 3 | "name": "Iris Messenger", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://iris.to" | 7 | "serviceURL": "https://iris.to" |
diff --git a/recipes/iris-messenger/webview.js b/recipes/iris-messenger/webview.js index 100aaf8..5aef124 100644 --- a/recipes/iris-messenger/webview.js +++ b/recipes/iris-messenger/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -8,4 +14,6 @@ module.exports = Ferdium => { | |||
8 | Ferdium.setBadge(count); | 14 | Ferdium.setBadge(count); |
9 | }; | 15 | }; |
10 | Ferdium.loop(getMessages); | 16 | Ferdium.loop(getMessages); |
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 19 | }; |
diff --git a/recipes/jira/index.js b/recipes/jira/index.js index ba77d96..e625d83 100644 --- a/recipes/jira/index.js +++ b/recipes/jira/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = (Ferdium) => class Jira extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Jira extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/jira/package.json b/recipes/jira/package.json index 7cc0aa5..1b88dee 100644 --- a/recipes/jira/package.json +++ b/recipes/jira/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "jira", | 2 | "id": "jira", |
3 | "name": "Jira", | 3 | "name": "Jira", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.atlassian.net", | 7 | "serviceURL": "https://{teamId}.atlassian.net", |
diff --git a/recipes/jira/webview.js b/recipes/jira/webview.js index 1859067..4264076 100644 --- a/recipes/jira/webview.js +++ b/recipes/jira/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // get unread messages | 9 | // get unread messages |
@@ -8,4 +14,6 @@ module.exports = Ferdium => { | |||
8 | }; | 14 | }; |
9 | 15 | ||
10 | Ferdium.loop(getMessages); | 16 | Ferdium.loop(getMessages); |
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 19 | }; |
diff --git a/recipes/jitsi/index.js b/recipes/jitsi/index.js index 5f22c17..7b8486c 100644 --- a/recipes/jitsi/index.js +++ b/recipes/jitsi/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = Ferdium => class Jitsi extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Jitsi extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/jitsi/package.json b/recipes/jitsi/package.json index 0e4cf90..4842791 100644 --- a/recipes/jitsi/package.json +++ b/recipes/jitsi/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "jitsi", | 2 | "id": "jitsi", |
3 | "name": "Jitsi Meet", | 3 | "name": "Jitsi Meet", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/sampathBlam/ferdi-jitsi", | 6 | "repository": "https://github.com/sampathBlam/ferdi-jitsi", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/jitsi/webview.js b/recipes/jitsi/webview.js index 6e0e1e9..847624e 100644 --- a/recipes/jitsi/webview.js +++ b/recipes/jitsi/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | const NOTIFICATION_BADGE_CLASS = '.badge-round'; | 7 | const NOTIFICATION_BADGE_CLASS = '.badge-round'; |
2 | 8 | ||
3 | module.exports = Ferdium => { | 9 | module.exports = Ferdium => { |
@@ -12,4 +18,6 @@ module.exports = Ferdium => { | |||
12 | }; | 18 | }; |
13 | 19 | ||
14 | Ferdium.loop(getMessages); | 20 | Ferdium.loop(getMessages); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
15 | }; | 23 | }; |
diff --git a/recipes/jollor/package.json b/recipes/jollor/package.json index 6a1aba6..9d7255a 100644 --- a/recipes/jollor/package.json +++ b/recipes/jollor/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "jollor", | 2 | "id": "jollor", |
3 | "name": "jollor", | 3 | "name": "jollor", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://jollor.com", | 7 | "serviceURL": "https://jollor.com", |
diff --git a/recipes/jollor/webview.js b/recipes/jollor/webview.js index 24a963d..fae58cb 100644 --- a/recipes/jollor/webview.js +++ b/recipes/jollor/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const count = document.querySelector( | 9 | const count = document.querySelector( |
diff --git a/recipes/kaizala/index.js b/recipes/kaizala/index.js index 425683a..0f18b4f 100644 --- a/recipes/kaizala/index.js +++ b/recipes/kaizala/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = (Ferdium) => class Messenger extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Messenger extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/kaizala/package.json b/recipes/kaizala/package.json index 8ce9a08..c4b83d8 100644 --- a/recipes/kaizala/package.json +++ b/recipes/kaizala/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "kaizala", | 2 | "id": "kaizala", |
3 | "name": "Microsoft Kaizala", | 3 | "name": "Microsoft Kaizala", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/meetfranz/recipe-microsoft-kaizala", | 6 | "repository": "https://github.com/meetfranz/recipe-microsoft-kaizala", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/kaizala/webview.js b/recipes/kaizala/webview.js index 7ac231e..df8897e 100644 --- a/recipes/kaizala/webview.js +++ b/recipes/kaizala/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const count = document.querySelectorAll('.unseen-msg-count').length; | 9 | const count = document.querySelectorAll('.unseen-msg-count').length; |
@@ -5,4 +11,6 @@ module.exports = Ferdium => { | |||
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/keepervault/package.json b/recipes/keepervault/package.json index e13d331..a142abe 100644 --- a/recipes/keepervault/package.json +++ b/recipes/keepervault/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "keepervault", | 2 | "id": "keepervault", |
3 | "name": "Keeper Vault", | 3 | "name": "Keeper Vault", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://keepersecurity.eu/vault/#" | 7 | "serviceURL": "https://keepersecurity.eu/vault/#" |
diff --git a/recipes/keepervault/webview.js b/recipes/keepervault/webview.js index 56a20b6..1119219 100644 --- a/recipes/keepervault/webview.js +++ b/recipes/keepervault/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/keybase.io/package.json b/recipes/keybase.io/package.json index 414a0ce..b1664cd 100644 --- a/recipes/keybase.io/package.json +++ b/recipes/keybase.io/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "keybase.io", | 2 | "id": "keybase.io", |
3 | "name": "Keybase", | 3 | "name": "Keybase", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://keybase.io/login", | 7 | "serviceURL": "https://keybase.io/login", |
diff --git a/recipes/keybase.io/webview.js b/recipes/keybase.io/webview.js index 86bb422..2a81dec 100644 --- a/recipes/keybase.io/webview.js +++ b/recipes/keybase.io/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/kimaicloud/package.json b/recipes/kimaicloud/package.json index 76319f2..d37135d 100644 --- a/recipes/kimaicloud/package.json +++ b/recipes/kimaicloud/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "kimaicloud", | 2 | "id": "kimaicloud", |
3 | "name": "Kimai Cloud", | 3 | "name": "Kimai Cloud", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/kimai-cloud/recipe-kimaicloud", | 6 | "repository": "https://github.com/kimai-cloud/recipe-kimaicloud", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/kimaicloud/webview.js b/recipes/kimaicloud/webview.js index 2855aa2..90ff710 100644 --- a/recipes/kimaicloud/webview.js +++ b/recipes/kimaicloud/webview.js | |||
@@ -1,9 +1,17 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
4 | 10 | ||
5 | // get amount of running timesheets | 11 | // get amount of running timesheets |
6 | const label = document.querySelector('.main-header .navbar .dropdown.messages-menu .ticktac span.label'); | 12 | const label = document.querySelector( |
13 | '.main-header .navbar .dropdown.messages-menu .ticktac span.label', | ||
14 | ); | ||
7 | if (label !== undefined) { | 15 | if (label !== undefined) { |
8 | count = Ferdium.safeParseInt(label.textContent); | 16 | count = Ferdium.safeParseInt(label.textContent); |
9 | } | 17 | } |
@@ -12,7 +20,7 @@ module.exports = (Ferdium) => { | |||
12 | Ferdium.setBadge(count); | 20 | Ferdium.setBadge(count); |
13 | }; | 21 | }; |
14 | 22 | ||
15 | document.addEventListener('click', (e) => { | 23 | document.addEventListener('click', e => { |
16 | const { tagName, target, href } = e.target; | 24 | const { tagName, target, href } = e.target; |
17 | 25 | ||
18 | if (tagName === 'A' && target === '_blank') { | 26 | if (tagName === 'A' && target === '_blank') { |
@@ -23,4 +31,6 @@ module.exports = (Ferdium) => { | |||
23 | }); | 31 | }); |
24 | 32 | ||
25 | Ferdium.loop(getMessages); | 33 | Ferdium.loop(getMessages); |
34 | |||
35 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
26 | }; | 36 | }; |
diff --git a/recipes/kiwiirc/package.json b/recipes/kiwiirc/package.json index 9c0b7b7..1e1adfd 100644 --- a/recipes/kiwiirc/package.json +++ b/recipes/kiwiirc/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "kiwiirc", | 2 | "id": "kiwiirc", |
3 | "name": "KiwiIRC", | 3 | "name": "KiwiIRC", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://kiwiirc.com/nextclient/", | 7 | "serviceURL": "https://kiwiirc.com/nextclient/", |
diff --git a/recipes/kiwiirc/webview.js b/recipes/kiwiirc/webview.js index 0c362f0..ef6c930 100644 --- a/recipes/kiwiirc/webview.js +++ b/recipes/kiwiirc/webview.js | |||
@@ -1,28 +1,33 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
9 | // eslint-disable-next-line no-undef | 9 | // eslint-disable-next-line no-undef |
10 | const unreadChannelsCount = kiwi.state.networks.reduce((count, network) => { | 10 | const unreadChannelsCount = kiwi.state.networks.reduce((count, network) => { |
11 | // eslint-disable-next-line no-param-reassign | ||
11 | return (count += network.buffers.filter(buffer => { | 12 | return (count += network.buffers.filter(buffer => { |
12 | return !buffer.name.startsWith('*') && buffer.flags.unread !== 0; | 13 | return !buffer.name.startsWith('*') && buffer.flags.unread !== 0; |
13 | }).length); | 14 | }).length); |
14 | }, 0); | 15 | }, 0); |
15 | 16 | ||
16 | // eslint-disable-next-line no-undef | 17 | // eslint-disable-next-line no-undef |
17 | const mentionedChannelsCount = kiwi.state.networks.reduce((count, network) => { | 18 | const mentionedChannelsCount = kiwi.state.networks.reduce( |
18 | return (count += network.buffers.filter(buffer => { | 19 | (count, network) => { |
19 | return ( | 20 | // eslint-disable-next-line no-param-reassign |
20 | !buffer.name.startsWith('*') && | 21 | return (count += network.buffers.filter(buffer => { |
21 | buffer.flags.unread !== 0 && | 22 | return ( |
22 | buffer.flags.highlight | 23 | !buffer.name.startsWith('*') && |
23 | ); | 24 | buffer.flags.unread !== 0 && |
24 | }).length); | 25 | buffer.flags.highlight |
25 | }, 0); | 26 | ); |
27 | }).length); | ||
28 | }, | ||
29 | 0, | ||
30 | ); | ||
26 | 31 | ||
27 | // set Ferdium badges | 32 | // set Ferdium badges |
28 | Ferdium.setBadge(mentionedChannelsCount, unreadChannelsCount); | 33 | Ferdium.setBadge(mentionedChannelsCount, unreadChannelsCount); |
diff --git a/recipes/lark/package.json b/recipes/lark/package.json index d92f6c0..43ed964 100644 --- a/recipes/lark/package.json +++ b/recipes/lark/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "lark", | 2 | "id": "lark", |
3 | "name": "Lark", | 3 | "name": "Lark", |
4 | "version": "0.2.0", | 4 | "version": "0.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.larksuite.com/messenger/", | 7 | "serviceURL": "https://{teamId}.larksuite.com/messenger/", |
diff --git a/recipes/lark/webview.js b/recipes/lark/webview.js index 6dd561b..1d41e1d 100644 --- a/recipes/lark/webview.js +++ b/recipes/lark/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const ele = document.querySelectorAll( | 9 | const ele = document.querySelectorAll( |
diff --git a/recipes/lastpass/index.js b/recipes/lastpass/index.js index 8cf6ec6..0f18b4f 100644 --- a/recipes/lastpass/index.js +++ b/recipes/lastpass/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = Ferdium => class Messenger extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Messenger extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/lastpass/package.json b/recipes/lastpass/package.json index 8e1efdb..d484136 100644 --- a/recipes/lastpass/package.json +++ b/recipes/lastpass/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "lastpass", | 2 | "id": "lastpass", |
3 | "name": "LastPass", | 3 | "name": "LastPass", |
4 | "version": "2.3.0", | 4 | "version": "2.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://lastpass.com/?ac=1&lpnorefresh=1", | 7 | "serviceURL": "https://lastpass.com/?ac=1&lpnorefresh=1", |
diff --git a/recipes/lastpass/webview.js b/recipes/lastpass/webview.js index 6287964..978e7ce 100644 --- a/recipes/lastpass/webview.js +++ b/recipes/lastpass/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | setTimeout(() => { | 7 | setTimeout(() => { |
8 | if ( | 8 | if ( |
9 | document.querySelector('body').textContent.includes('Google Chrome 36+') | 9 | document.querySelector('body').textContent.includes('Google Chrome 36+') |
diff --git a/recipes/lemmy/package.json b/recipes/lemmy/package.json index ccf2847..1057812 100644 --- a/recipes/lemmy/package.json +++ b/recipes/lemmy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "lemmy", | 2 | "id": "lemmy", |
3 | "name": "Lemmy", | 3 | "name": "Lemmy", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [], | 6 | "aliases": [], |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/lemmy/webview.js b/recipes/lemmy/webview.js index dd41f72..1119219 100644 --- a/recipes/lemmy/webview.js +++ b/recipes/lemmy/webview.js | |||
@@ -1 +1,9 @@ | |||
1 | module.exports = Ferdium => Ferdium; | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | ||
diff --git a/recipes/linear/index.js b/recipes/linear/index.js index 244fe33..dd41f72 100644 --- a/recipes/linear/index.js +++ b/recipes/linear/index.js | |||
@@ -1 +1 @@ | |||
module.exports = (Ferdium) => Ferdium; | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/linear/package.json b/recipes/linear/package.json index da57697..e29e0dd 100644 --- a/recipes/linear/package.json +++ b/recipes/linear/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "linear", | 2 | "id": "linear", |
3 | "name": "Linear", | 3 | "name": "Linear", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://linear.app" | 7 | "serviceURL": "https://linear.app" |
diff --git a/recipes/linear/webview.js b/recipes/linear/webview.js index 63ff9c4..1119219 100644 --- a/recipes/linear/webview.js +++ b/recipes/linear/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require("path")); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
7 | module.exports = (Ferdium) => { | 5 | const _path = _interopRequireDefault(require('path')); |
8 | Ferdium.injectCSS(_path.default.join(__dirname, "service.css")); | 6 | |
7 | module.exports = Ferdium => { | ||
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 9 | }; |
diff --git a/recipes/lineworks/package.json b/recipes/lineworks/package.json index a830544..ef6fddd 100644 --- a/recipes/lineworks/package.json +++ b/recipes/lineworks/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "lineworks", | 2 | "id": "lineworks", |
3 | "name": "Line Works", | 3 | "name": "Line Works", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasIndirectMessages": true, | 7 | "hasIndirectMessages": true, |
diff --git a/recipes/lineworks/webview.js b/recipes/lineworks/webview.js index 41683ef..1706418 100644 --- a/recipes/lineworks/webview.js +++ b/recipes/lineworks/webview.js | |||
@@ -1,19 +1,21 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const elements = document.querySelectorAll( | 9 | const elements = document.querySelectorAll( |
10 | 'div#chat_list > ul#chat_grp_lst > li#item_chat > dl#chat_count > span#new', | 10 | 'div#chat_list > ul#chat_grp_lst > li#item_chat > dl#chat_count > span#new', |
11 | ); | 11 | ); |
12 | let count = elements[0] ? count = Ferdium.safeParseInt(elements[0].textContent): 0; | 12 | let count = elements[0] |
13 | ? (count = Ferdium.safeParseInt(elements[0].textContent)) | ||
14 | : 0; | ||
13 | 15 | ||
14 | Ferdium.setBadge(count); | 16 | Ferdium.setBadge(count); |
15 | }; | 17 | }; |
16 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
17 | 19 | ||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
19 | } | 21 | }; |
diff --git a/recipes/linkedin/package.json b/recipes/linkedin/package.json index a6b9042..0a15f7c 100644 --- a/recipes/linkedin/package.json +++ b/recipes/linkedin/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "linkedin", | 2 | "id": "linkedin", |
3 | "name": "LinkedIn", | 3 | "name": "LinkedIn", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.linkedin.com/messaging" | 7 | "serviceURL": "https://www.linkedin.com/messaging" |
diff --git a/recipes/linkedin/webview.js b/recipes/linkedin/webview.js index b4180e4..f09170c 100644 --- a/recipes/linkedin/webview.js +++ b/recipes/linkedin/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -19,4 +25,6 @@ module.exports = Ferdium => { | |||
19 | }; | 25 | }; |
20 | 26 | ||
21 | Ferdium.loop(getMessages); | 27 | Ferdium.loop(getMessages); |
28 | |||
29 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | 30 | }; |
diff --git a/recipes/localazy/package.json b/recipes/localazy/package.json index daec11f..1b2d722 100644 --- a/recipes/localazy/package.json +++ b/recipes/localazy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "localazy", | 2 | "id": "localazy", |
3 | "name": "Localazy", | 3 | "name": "Localazy", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://localazy.com/my/dashboard" | 7 | "serviceURL": "https://localazy.com/my/dashboard" |
diff --git a/recipes/localazy/webview.js b/recipes/localazy/webview.js index 56a20b6..1119219 100644 --- a/recipes/localazy/webview.js +++ b/recipes/localazy/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/magic-level/package.json b/recipes/magic-level/package.json index e36c097..d027f10 100644 --- a/recipes/magic-level/package.json +++ b/recipes/magic-level/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "magic-level", | 2 | "id": "magic-level", |
3 | "name": "Magic Level", | 3 | "name": "Magic Level", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://magiclevel.ml" | 7 | "serviceURL": "https://magiclevel.ml" |
diff --git a/recipes/magic-level/webview.js b/recipes/magic-level/webview.js index d39c90d..d757e8b 100644 --- a/recipes/magic-level/webview.js +++ b/recipes/magic-level/webview.js | |||
@@ -1,32 +1,31 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | |||
9 | const getMessages = () => { | 8 | const getMessages = () => { |
10 | let countImportant = 0; | 9 | let countImportant = 0; |
11 | let countNonImportant = 0; | 10 | let countNonImportant = 0; |
12 | const inboxLinks = document.querySelectorAll('.J-Ke.n0'); | 11 | const inboxLinks = document.querySelectorAll('.J-Ke.n0'); |
13 | if (inboxLinks.length > 0) { | 12 | if (inboxLinks.length > 0) { |
14 | let parentNode = inboxLinks[0].parentNode; | 13 | const { parentNode } = inboxLinks[0]; |
15 | if (parentNode) { | 14 | if (parentNode) { |
16 | let parentNodeOfParentNode = parentNode.parentNode; | 15 | const parentNodeOfParentNode = parentNode.parentNode; |
17 | if (parentNodeOfParentNode) { | 16 | if (parentNodeOfParentNode) { |
18 | const unreadCounts = parentNodeOfParentNode.querySelectorAll('.bsU'); | 17 | const unreadCounts = parentNodeOfParentNode.querySelectorAll('.bsU'); |
19 | if (unreadCounts.length > 0) { | 18 | if (unreadCounts.length > 0) { |
20 | let unreadCount = unreadCounts[0].textContent; | 19 | const unreadCount = unreadCounts[0].textContent; |
21 | if (unreadCount.includes(':')) { | 20 | if (unreadCount.includes(':')) { |
22 | let counts = unreadCount | 21 | const counts = unreadCount |
23 | .split(':') | 22 | .split(':') |
24 | .map(s => Ferdium.safeParseInt(s.replace(/[^\p{N}]/gu, ''))); | 23 | .map(s => Ferdium.safeParseInt(s.replaceAll(/[^\p{N}]/gu, ''))); |
25 | countImportant = counts[0]; | 24 | countImportant = counts[0]; |
26 | countNonImportant = counts[1] - counts[0]; | 25 | countNonImportant = counts[1] - counts[0]; |
27 | } else { | 26 | } else { |
28 | countImportant = Ferdium.safeParseInt( | 27 | countImportant = Ferdium.safeParseInt( |
29 | unreadCount.replace(/[^\p{N}]/gu, ''), | 28 | unreadCount.replaceAll(/[^\p{N}]/gu, ''), |
30 | ); | 29 | ); |
31 | } | 30 | } |
32 | } | 31 | } |
diff --git a/recipes/mailbox.org/package.json b/recipes/mailbox.org/package.json index 5d320d7..d7c2851 100644 --- a/recipes/mailbox.org/package.json +++ b/recipes/mailbox.org/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mailbox.org", | 2 | "id": "mailbox.org", |
3 | "name": "Mailbox.org", | 3 | "name": "Mailbox.org", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://office.mailbox.org/appsuite/#!!&app=io.ox/portal" | 7 | "serviceURL": "https://office.mailbox.org/appsuite/#!!&app=io.ox/portal" |
diff --git a/recipes/mailbox.org/webview.js b/recipes/mailbox.org/webview.js index 68ab707..889f6c4 100644 --- a/recipes/mailbox.org/webview.js +++ b/recipes/mailbox.org/webview.js | |||
@@ -1,4 +1,10 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const count = document.querySelectorAll('.new-item').length; | 9 | const count = document.querySelectorAll('.new-item').length; |
4 | 10 | ||
@@ -6,4 +12,6 @@ module.exports = (Ferdium) => { | |||
6 | }; | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 17 | }; |
diff --git a/recipes/mailfence/package.json b/recipes/mailfence/package.json index 7c9e98d..8cd6a62 100644 --- a/recipes/mailfence/package.json +++ b/recipes/mailfence/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mailfence", | 2 | "id": "mailfence", |
3 | "name": "Mailfence", | 3 | "name": "Mailfence", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/hafiz-muhammad/ferdium-recipes", | 6 | "repository": "https://github.com/hafiz-muhammad/ferdium-recipes", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/mailfence/webview.js b/recipes/mailfence/webview.js index 309f4e8..75229fc 100644 --- a/recipes/mailfence/webview.js +++ b/recipes/mailfence/webview.js | |||
@@ -1,27 +1,20 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | 2 | return obj && obj.__esModule ? obj : { default: obj }; | |
3 | function _interopRequireDefault(obj) | ||
4 | { | ||
5 | return obj && obj.__esModule ? obj : | ||
6 | { | ||
7 | default: obj | ||
8 | }; | ||
9 | } | 3 | } |
10 | 4 | ||
11 | module.exports = Ferdium => | 5 | const _path = _interopRequireDefault(require('path')); |
12 | { | 6 | |
13 | const getMessages = () => | 7 | module.exports = Ferdium => { |
14 | { | 8 | const getMessages = () => { |
15 | let unreadCount = 0; | 9 | let unreadCount = 0; |
16 | for (const counterElement of document.querySelectorAll('.GCSDBRWBMXB')) | 10 | for (const counterElement of document.querySelectorAll('.GCSDBRWBMXB')) { |
17 | { | 11 | const unreadCounter = Ferdium.safeParseInt(counterElement.textContent); |
18 | const unreadCounter = Ferdium.safeParseInt(counterElement.textContent); | 12 | unreadCount = Math.max(unreadCount, unreadCounter); |
19 | unreadCount = Math.max(unreadCount, unreadCounter); | 13 | } |
20 | } | ||
21 | 14 | ||
22 | Ferdium.setBadge(unreadCount); | 15 | Ferdium.setBadge(unreadCount); |
23 | }; | 16 | }; |
24 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
25 | 18 | ||
26 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
27 | }; \ No newline at end of file | 20 | }; |
diff --git a/recipes/mastodon/package.json b/recipes/mastodon/package.json index 7371494..24f0ea6 100644 --- a/recipes/mastodon/package.json +++ b/recipes/mastodon/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "name": "Mastodon", | 2 | "name": "Mastodon", |
3 | "id": "mastodon", | 3 | "id": "mastodon", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mastodon.social", | 7 | "serviceURL": "https://mastodon.social", |
diff --git a/recipes/mastodon/webview.js b/recipes/mastodon/webview.js index e34f284..0259d7f 100644 --- a/recipes/mastodon/webview.js +++ b/recipes/mastodon/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | let latestStatement = $('.status time').attr('datetime'); | 8 | let latestStatement = $('.status time').attr('datetime'); |
3 | let latestNotify = $($('.notification__message span').get(0)).text(); | 9 | let latestNotify = $($('.notification__message span').get(0)).text(); |
@@ -12,12 +18,12 @@ module.exports = Ferdium => { | |||
12 | const getMessages = () => { | 18 | const getMessages = () => { |
13 | let reply = 0; | 19 | let reply = 0; |
14 | const ln = $($('.notification__message span').get(0)).text(); | 20 | const ln = $($('.notification__message span').get(0)).text(); |
15 | if (ln != latestNotify) { | 21 | if (ln !== latestNotify) { |
16 | reply = 1; | 22 | reply = 1; |
17 | } | 23 | } |
18 | let unread = 0; | 24 | let unread = 0; |
19 | const ls = $('.status time').attr('datetime'); | 25 | const ls = $('.status time').attr('datetime'); |
20 | if (ls != latestStatement) { | 26 | if (ls !== latestStatement) { |
21 | unread = 1; | 27 | unread = 1; |
22 | } | 28 | } |
23 | 29 | ||
@@ -25,4 +31,6 @@ module.exports = Ferdium => { | |||
25 | }; | 31 | }; |
26 | 32 | ||
27 | Ferdium.loop(getMessages); | 33 | Ferdium.loop(getMessages); |
34 | |||
35 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
28 | }; | 36 | }; |
diff --git a/recipes/mattermost/index.js b/recipes/mattermost/index.js index fca10e1..74ab2ee 100644 --- a/recipes/mattermost/index.js +++ b/recipes/mattermost/index.js | |||
@@ -1,17 +1,18 @@ | |||
1 | module.exports = Ferdium => class Mattermost extends Ferdium { | 1 | module.exports = Ferdium => |
2 | async validateUrl(url) { | 2 | class Mattermost extends Ferdium { |
3 | try { | 3 | async validateUrl(url) { |
4 | const resp = await window.fetch(url, { | 4 | try { |
5 | method: 'GET', | 5 | const resp = await window.fetch(url, { |
6 | headers: { | 6 | method: 'GET', |
7 | 'Content-Type': 'application/json', | 7 | headers: { |
8 | }, | 8 | 'Content-Type': 'application/json', |
9 | }); | 9 | }, |
10 | return resp.status.toString().startsWith('2'); | 10 | }); |
11 | } catch (error) { | 11 | return resp.status.toString().startsWith('2'); |
12 | console.error(error); | 12 | } catch (error) { |
13 | } | 13 | console.error(error); |
14 | } | ||
14 | 15 | ||
15 | return false; | 16 | return false; |
16 | } | 17 | } |
17 | }; | 18 | }; |
diff --git a/recipes/mattermost/package.json b/recipes/mattermost/package.json index 457973d..cbdcbda 100644 --- a/recipes/mattermost/package.json +++ b/recipes/mattermost/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mattermost", | 2 | "id": "mattermost", |
3 | "name": "Mattermost", | 3 | "name": "Mattermost", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasNotificationSound": true, | 7 | "hasNotificationSound": true, |
diff --git a/recipes/mattermost/webview.js b/recipes/mattermost/webview.js index 32e990e..716848e 100644 --- a/recipes/mattermost/webview.js +++ b/recipes/mattermost/webview.js | |||
@@ -1,22 +1,45 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const DIRECT_MESSAGES_INDIVIDUAL = '#sidebar-left .unread-title .DirectChannel__profile-picture'; | 8 | const DIRECT_MESSAGES_INDIVIDUAL = |
9 | '#sidebar-left .unread-title .DirectChannel__profile-picture'; | ||
3 | const DIRECT_MESSAGES_GROUP = '#sidebar-left .unread-title .status--group'; | 10 | const DIRECT_MESSAGES_GROUP = '#sidebar-left .unread-title .status--group'; |
4 | const DIRECT_MESSAGES_LEGACY = '.sidebar--left .has-badge .badge'; | 11 | const DIRECT_MESSAGES_LEGACY = '.sidebar--left .has-badge .badge'; |
5 | const ALL_MESSAGES = '#sidebar-left .unread-title'; | 12 | const ALL_MESSAGES = '#sidebar-left .unread-title'; |
6 | const ALL_MESSAGES_LEGACY = '#sidebar-left .unread-title'; | 13 | const ALL_MESSAGES_LEGACY = '#sidebar-left .unread-title'; |
7 | 14 | ||
8 | const getMessages = () => { | 15 | const getMessages = () => { |
9 | const directMessagesSelector = [DIRECT_MESSAGES_LEGACY, DIRECT_MESSAGES_INDIVIDUAL, DIRECT_MESSAGES_GROUP].join(', '); | 16 | const directMessagesSelector = [ |
10 | const directMessages = document.querySelectorAll(directMessagesSelector).length; | 17 | DIRECT_MESSAGES_LEGACY, |
18 | DIRECT_MESSAGES_INDIVIDUAL, | ||
19 | DIRECT_MESSAGES_GROUP, | ||
20 | ].join(', '); | ||
21 | const directMessages = document.querySelectorAll( | ||
22 | directMessagesSelector, | ||
23 | ).length; | ||
11 | 24 | ||
12 | const allMessagesSelector = [ALL_MESSAGES, ALL_MESSAGES_LEGACY].join(', '); | 25 | const allMessagesSelector = [ALL_MESSAGES, ALL_MESSAGES_LEGACY].join(', '); |
13 | const allMessages = document.querySelectorAll(allMessagesSelector).length - directMessages; | 26 | const allMessages = |
27 | document.querySelectorAll(allMessagesSelector).length - directMessages; | ||
14 | 28 | ||
15 | const teamDirectMessages = document.querySelectorAll('.team-wrapper .team-container .badge').length; | 29 | const teamDirectMessages = document.querySelectorAll( |
16 | const teamMessages = document.querySelectorAll('.team-wrapper .unread').length - teamDirectMessages; | 30 | '.team-wrapper .team-container .badge', |
31 | ).length; | ||
32 | const teamMessages = | ||
33 | document.querySelectorAll('.team-wrapper .unread').length - | ||
34 | teamDirectMessages; | ||
17 | 35 | ||
18 | Ferdium.setBadge(directMessages + teamDirectMessages, allMessages + teamMessages); | 36 | Ferdium.setBadge( |
37 | directMessages + teamDirectMessages, | ||
38 | allMessages + teamMessages, | ||
39 | ); | ||
19 | }; | 40 | }; |
20 | 41 | ||
21 | Ferdium.loop(getMessages); | 42 | Ferdium.loop(getMessages); |
43 | |||
44 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | 45 | }; |
diff --git a/recipes/medium/package.json b/recipes/medium/package.json index 54608d1..1dc5631 100644 --- a/recipes/medium/package.json +++ b/recipes/medium/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "medium", | 2 | "id": "medium", |
3 | "name": "Medium", | 3 | "name": "Medium", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://medium.com" | 7 | "serviceURL": "https://medium.com" |
diff --git a/recipes/medium/webview.js b/recipes/medium/webview.js index 56a20b6..1119219 100644 --- a/recipes/medium/webview.js +++ b/recipes/medium/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/meetup/package.json b/recipes/meetup/package.json index 42afa9b..468d800 100644 --- a/recipes/meetup/package.json +++ b/recipes/meetup/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "meetup", | 2 | "id": "meetup", |
3 | "name": "Meetup", | 3 | "name": "Meetup", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://meetup.com", | 7 | "serviceURL": "https://meetup.com", |
diff --git a/recipes/meetup/webview.js b/recipes/meetup/webview.js index 1ddb5fd..a5c7a88 100644 --- a/recipes/meetup/webview.js +++ b/recipes/meetup/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const hasNotifications = document.querySelector(".counterBadge"); | 9 | const hasNotifications = document.querySelector('.counterBadge'); |
4 | 10 | ||
5 | Ferdium.setBadge(0, hasNotifications ? 1 : 0); | 11 | Ferdium.setBadge(0, hasNotifications ? 1 : 0); |
6 | }; | 12 | }; |
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/messenger/index.js b/recipes/messenger/index.js index 425683a..0f18b4f 100644 --- a/recipes/messenger/index.js +++ b/recipes/messenger/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = (Ferdium) => class Messenger extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Messenger extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/messenger/package.json b/recipes/messenger/package.json index 2e8bdec..3b5783c 100644 --- a/recipes/messenger/package.json +++ b/recipes/messenger/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "messenger", | 2 | "id": "messenger", |
3 | "name": "Messenger", | 3 | "name": "Messenger", |
4 | "version": "1.7.7", | 4 | "version": "1.8.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://messenger.com", | 7 | "serviceURL": "https://messenger.com", |
diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 7fc8ed6..39ea098 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js | |||
@@ -1,10 +1,16 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | function hideInstallMessage() { | 7 | function hideInstallMessage() { |
2 | const installMessage = document.querySelector('.usczdcwk'); | 8 | const installMessage = document.querySelector('.usczdcwk'); |
3 | if (installMessage) { | 9 | if (installMessage) { |
4 | installMessage.style.display = | 10 | installMessage.style.display = |
5 | installMessage.style.display != 'none' | 11 | installMessage.style.display === 'none' |
6 | ? 'none' | 12 | ? installMessage.style.display |
7 | : installMessage.style.display; | 13 | : 'none'; |
8 | } | 14 | } |
9 | } | 15 | } |
10 | 16 | ||
@@ -17,7 +23,9 @@ module.exports = Ferdium => { | |||
17 | * try the counting with the new UI | 23 | * try the counting with the new UI |
18 | */ | 24 | */ |
19 | for (let href of ['/', '/requests/', '/marketplace/']) { | 25 | for (let href of ['/', '/requests/', '/marketplace/']) { |
20 | const elem = document.querySelector(`a[href^='${href}t/'][role='link'][tabindex='0']`).ariaLabel; | 26 | const elem = document.querySelector( |
27 | `a[href^='${href}t/'][role='link'][tabindex='0']`, | ||
28 | ).ariaLabel; | ||
21 | if (elem) { | 29 | if (elem) { |
22 | newMessengerUI = true; | 30 | newMessengerUI = true; |
23 | const match = elem.match(/(\d+)/g); | 31 | const match = elem.match(/(\d+)/g); |
@@ -31,18 +39,26 @@ module.exports = Ferdium => { | |||
31 | * do the old counting if the interface is not the last one | 39 | * do the old counting if the interface is not the last one |
32 | */ | 40 | */ |
33 | if (!newMessengerUI) { | 41 | if (!newMessengerUI) { |
34 | count = [...document.querySelectorAll('.bp9cbjyn.j83agx80.owycx6da:not(.btwxx1t3)')] | 42 | count = [ |
43 | ...document.querySelectorAll( | ||
44 | '.bp9cbjyn.j83agx80.owycx6da:not(.btwxx1t3)', | ||
45 | ), | ||
46 | ] | ||
35 | .map(elem => { | 47 | .map(elem => { |
36 | const hasPing = !!elem.querySelector('.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa'); | 48 | const hasPing = !!elem.querySelector( |
37 | const isMuted = !!elem.querySelector('.a8c37x1j.ms05siws.l3qrxjdp.b7h9ocf4.trssfv1o'); | 49 | '.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa', |
50 | ); | ||
51 | const isMuted = !!elem.querySelector( | ||
52 | '.a8c37x1j.ms05siws.l3qrxjdp.b7h9ocf4.trssfv1o', | ||
53 | ); | ||
38 | 54 | ||
39 | return hasPing && !isMuted; | 55 | return hasPing && !isMuted; |
40 | }) | 56 | }) |
41 | .reduce((prev, curr) => prev + curr, 0); | 57 | .reduce((prev, curr) => prev + curr, 0); |
42 | 58 | ||
43 | /* | 59 | /* |
44 | * add count of message requests on top of notification counter | 60 | * add count of message requests on top of notification counter |
45 | */ | 61 | */ |
46 | const messageRequestsElement = document.querySelector('._5nxf'); | 62 | const messageRequestsElement = document.querySelector('._5nxf'); |
47 | if (messageRequestsElement) { | 63 | if (messageRequestsElement) { |
48 | count += Ferdium.safeParseInt(messageRequestsElement.textContent); | 64 | count += Ferdium.safeParseInt(messageRequestsElement.textContent); |
@@ -59,6 +75,8 @@ module.exports = Ferdium => { | |||
59 | 75 | ||
60 | Ferdium.loop(loopRoutine); | 76 | Ferdium.loop(loopRoutine); |
61 | 77 | ||
78 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
79 | |||
62 | localStorage.setItem( | 80 | localStorage.setItem( |
63 | '_cs_desktopNotifsEnabled', | 81 | '_cs_desktopNotifsEnabled', |
64 | JSON.stringify({ | 82 | JSON.stringify({ |
diff --git a/recipes/meta-business-suite/package.json b/recipes/meta-business-suite/package.json index fac1ae4..8b807f9 100644 --- a/recipes/meta-business-suite/package.json +++ b/recipes/meta-business-suite/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "meta-business-suite", | 2 | "id": "meta-business-suite", |
3 | "name": "Meta Business Suite", | 3 | "name": "Meta Business Suite", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://business.facebook.com" | 7 | "serviceURL": "https://business.facebook.com" |
diff --git a/recipes/meta-business-suite/webview.js b/recipes/meta-business-suite/webview.js index 56a20b6..1119219 100644 --- a/recipes/meta-business-suite/webview.js +++ b/recipes/meta-business-suite/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/mewe/package.json b/recipes/mewe/package.json index 0277666..87cfb71 100644 --- a/recipes/mewe/package.json +++ b/recipes/mewe/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mewe", | 2 | "id": "mewe", |
3 | "name": "MeWe", | 3 | "name": "MeWe", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mewe.com/chat", | 7 | "serviceURL": "https://mewe.com/chat", |
diff --git a/recipes/mewe/webview.js b/recipes/mewe/webview.js index 0434d1c..314e9bb 100644 --- a/recipes/mewe/webview.js +++ b/recipes/mewe/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const calculateTotalDirectMessages = () => | 8 | const calculateTotalDirectMessages = () => |
9 | [...document.querySelectorAll('.chats-list-element')] | 9 | [...document.querySelectorAll('.chats-list-element')] |
@@ -15,5 +15,6 @@ module.exports = Ferdium => { | |||
15 | .reduce((curr, prev) => curr + prev, 0); | 15 | .reduce((curr, prev) => curr + prev, 0); |
16 | 16 | ||
17 | Ferdium.loop(() => Ferdium.setBadge(calculateTotalDirectMessages())); | 17 | Ferdium.loop(() => Ferdium.setBadge(calculateTotalDirectMessages())); |
18 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
19 | }; | 20 | }; |
diff --git a/recipes/miro/package.json b/recipes/miro/package.json index 18adc17..8c088c7 100644 --- a/recipes/miro/package.json +++ b/recipes/miro/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "miro", | 2 | "id": "miro", |
3 | "name": "Miro", | 3 | "name": "Miro", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://miro.com/app/dashboard/" | 7 | "serviceURL": "https://miro.com/app/dashboard/" |
diff --git a/recipes/miro/webview.js b/recipes/miro/webview.js index 56a20b6..1119219 100644 --- a/recipes/miro/webview.js +++ b/recipes/miro/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/mirotalk-bro/index.js b/recipes/mirotalk-bro/index.js index 3b384eb..dd41f72 100644 --- a/recipes/mirotalk-bro/index.js +++ b/recipes/mirotalk-bro/index.js | |||
@@ -1,3 +1 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => Ferdium; | module.exports = Ferdium => Ferdium; | |
diff --git a/recipes/mirotalk-bro/package.json b/recipes/mirotalk-bro/package.json index 509d4c7..67d0cab 100644 --- a/recipes/mirotalk-bro/package.json +++ b/recipes/mirotalk-bro/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mirotalk-bro", | 2 | "id": "mirotalk-bro", |
3 | "name": "MiroTalk Live Broadcast", | 3 | "name": "MiroTalk Live Broadcast", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://bro.mirotalk.com", | 7 | "serviceURL": "https://bro.mirotalk.com", |
diff --git a/recipes/mirotalk-bro/webview.js b/recipes/mirotalk-bro/webview.js index b8f2d0a..1119219 100644 --- a/recipes/mirotalk-bro/webview.js +++ b/recipes/mirotalk-bro/webview.js | |||
@@ -1,11 +1,9 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 3 | } |
8 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
9 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
10 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
11 | }; | 9 | }; |
diff --git a/recipes/mirotalk-c2c/index.js b/recipes/mirotalk-c2c/index.js index 3b384eb..dd41f72 100644 --- a/recipes/mirotalk-c2c/index.js +++ b/recipes/mirotalk-c2c/index.js | |||
@@ -1,3 +1 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => Ferdium; | module.exports = Ferdium => Ferdium; | |
diff --git a/recipes/mirotalk-c2c/package.json b/recipes/mirotalk-c2c/package.json index 4ca77fc..309688c 100644 --- a/recipes/mirotalk-c2c/package.json +++ b/recipes/mirotalk-c2c/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mirotalk-c2c", | 2 | "id": "mirotalk-c2c", |
3 | "name": "MiroTalk C2C", | 3 | "name": "MiroTalk C2C", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://c2c.mirotalk.com", | 7 | "serviceURL": "https://c2c.mirotalk.com", |
diff --git a/recipes/mirotalk-c2c/webview.js b/recipes/mirotalk-c2c/webview.js index b8f2d0a..1119219 100644 --- a/recipes/mirotalk-c2c/webview.js +++ b/recipes/mirotalk-c2c/webview.js | |||
@@ -1,11 +1,9 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 3 | } |
8 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
9 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
10 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
11 | }; | 9 | }; |
diff --git a/recipes/mirotalk-p2p/index.js b/recipes/mirotalk-p2p/index.js index 3b384eb..dd41f72 100644 --- a/recipes/mirotalk-p2p/index.js +++ b/recipes/mirotalk-p2p/index.js | |||
@@ -1,3 +1 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => Ferdium; | module.exports = Ferdium => Ferdium; | |
diff --git a/recipes/mirotalk-p2p/package.json b/recipes/mirotalk-p2p/package.json index 249fdca..0df1537 100644 --- a/recipes/mirotalk-p2p/package.json +++ b/recipes/mirotalk-p2p/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mirotalk-p2p", | 2 | "id": "mirotalk-p2p", |
3 | "name": "MiroTalk P2P", | 3 | "name": "MiroTalk P2P", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://p2p.mirotalk.com", | 7 | "serviceURL": "https://p2p.mirotalk.com", |
diff --git a/recipes/mirotalk-p2p/webview.js b/recipes/mirotalk-p2p/webview.js index b8f2d0a..1119219 100644 --- a/recipes/mirotalk-p2p/webview.js +++ b/recipes/mirotalk-p2p/webview.js | |||
@@ -1,11 +1,9 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 3 | } |
8 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
9 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
10 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
11 | }; | 9 | }; |
diff --git a/recipes/mirotalk-sfu/index.js b/recipes/mirotalk-sfu/index.js index 3b384eb..dd41f72 100644 --- a/recipes/mirotalk-sfu/index.js +++ b/recipes/mirotalk-sfu/index.js | |||
@@ -1,3 +1 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => Ferdium; | module.exports = Ferdium => Ferdium; | |
diff --git a/recipes/mirotalk-sfu/package.json b/recipes/mirotalk-sfu/package.json index 8a94f66..e815c4b 100644 --- a/recipes/mirotalk-sfu/package.json +++ b/recipes/mirotalk-sfu/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mirotalk-sfu", | 2 | "id": "mirotalk-sfu", |
3 | "name": "MiroTalk SFU", | 3 | "name": "MiroTalk SFU", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://sfu.mirotalk.com", | 7 | "serviceURL": "https://sfu.mirotalk.com", |
diff --git a/recipes/mirotalk-sfu/webview.js b/recipes/mirotalk-sfu/webview.js index b8f2d0a..1119219 100644 --- a/recipes/mirotalk-sfu/webview.js +++ b/recipes/mirotalk-sfu/webview.js | |||
@@ -1,11 +1,9 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 3 | } |
8 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
9 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
10 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
11 | }; | 9 | }; |
diff --git a/recipes/mirotalk-webrtc/index.js b/recipes/mirotalk-webrtc/index.js index 3b384eb..dd41f72 100644 --- a/recipes/mirotalk-webrtc/index.js +++ b/recipes/mirotalk-webrtc/index.js | |||
@@ -1,3 +1 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => Ferdium; | module.exports = Ferdium => Ferdium; | |
diff --git a/recipes/mirotalk-webrtc/package.json b/recipes/mirotalk-webrtc/package.json index 22a7f52..afb6972 100644 --- a/recipes/mirotalk-webrtc/package.json +++ b/recipes/mirotalk-webrtc/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mirotalk-webrtc", | 2 | "id": "mirotalk-webrtc", |
3 | "name": "MiroTalk WebRTC", | 3 | "name": "MiroTalk WebRTC", |
4 | "version": "1.0.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://webrtc.mirotalk.com", | 7 | "serviceURL": "https://webrtc.mirotalk.com", |
diff --git a/recipes/mirotalk-webrtc/webview.js b/recipes/mirotalk-webrtc/webview.js index b8f2d0a..1119219 100644 --- a/recipes/mirotalk-webrtc/webview.js +++ b/recipes/mirotalk-webrtc/webview.js | |||
@@ -1,11 +1,9 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 3 | } |
8 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
9 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
10 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
11 | }; | 9 | }; |
diff --git a/recipes/misskey/package.json b/recipes/misskey/package.json index b1664cb..ecf446d 100644 --- a/recipes/misskey/package.json +++ b/recipes/misskey/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "misskey", | 2 | "id": "misskey", |
3 | "name": "Misskey", | 3 | "name": "Misskey", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/sharkpp/franz-recipe-misskey", | 6 | "repository": "https://github.com/sharkpp/franz-recipe-misskey", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/misskey/webview.js b/recipes/misskey/webview.js index 554feb0..8c8dbc5 100644 --- a/recipes/misskey/webview.js +++ b/recipes/misskey/webview.js | |||
@@ -1,11 +1,19 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // check notification badge for Ferdium badge | 9 | // check notification badge for Ferdium badge |
4 | let hasNotification = !!document.querySelector( | 10 | const hasNotification = !!document.querySelector( |
5 | '#app div.notifications > button > i.circle', | 11 | '#app div.notifications > button > i.circle', |
6 | ); | 12 | ); |
7 | Ferdium.setBadge(0, hasNotification ? 1 : 0); | 13 | Ferdium.setBadge(0, hasNotification ? 1 : 0); |
8 | }; | 14 | }; |
9 | 15 | ||
10 | Ferdium.loop(getMessages); | 16 | Ferdium.loop(getMessages); |
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 19 | }; |
diff --git a/recipes/monday/package.json b/recipes/monday/package.json index 6b1bcc6..a9fa8fd 100644 --- a/recipes/monday/package.json +++ b/recipes/monday/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "monday", | 2 | "id": "monday", |
3 | "name": "Monday", | 3 | "name": "Monday", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.monday.com", | 7 | "serviceURL": "https://{teamId}.monday.com", |
diff --git a/recipes/monday/webview.js b/recipes/monday/webview.js index 388e5bd..5da20e2 100755 --- a/recipes/monday/webview.js +++ b/recipes/monday/webview.js | |||
@@ -1,12 +1,16 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | let count = 0; | 9 | let count = 0; |
8 | 10 | ||
9 | const counters = document.querySelectorAll('.surface-control-component .item-counter, .surface-control-component .view-item-counter'); | 11 | const counters = document.querySelectorAll( |
12 | '.surface-control-component .item-counter, .surface-control-component .view-item-counter', | ||
13 | ); | ||
10 | 14 | ||
11 | for (const counter of counters) { | 15 | for (const counter of counters) { |
12 | count += Ferdium.safeParseInt(counter.textContent); | 16 | count += Ferdium.safeParseInt(counter.textContent); |
diff --git a/recipes/monicahq/package.json b/recipes/monicahq/package.json index 3b18cab..f8387d8 100755 --- a/recipes/monicahq/package.json +++ b/recipes/monicahq/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "monicahq", | 2 | "id": "monicahq", |
3 | "name": "Monica HQ", | 3 | "name": "Monica HQ", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/jkbecker/recipe-monica", | 6 | "repository": "https://github.com/jkbecker/recipe-monica", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/monicahq/webview.js b/recipes/monicahq/webview.js index 86bb422..2a81dec 100644 --- a/recipes/monicahq/webview.js +++ b/recipes/monicahq/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/moodle/package.json b/recipes/moodle/package.json index e661884..bc23813 100644 --- a/recipes/moodle/package.json +++ b/recipes/moodle/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "moodle", | 2 | "id": "moodle", |
3 | "name": "Moodle", | 3 | "name": "Moodle", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/moodle/webview.js b/recipes/moodle/webview.js index 2ac7aa4..af948c6 100644 --- a/recipes/moodle/webview.js +++ b/recipes/moodle/webview.js | |||
@@ -1,12 +1,23 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directCountSelector = [...document.querySelectorAll('[data-region="count-container"]')]; | 9 | const directCountSelector = [ |
10 | ...document.querySelectorAll('[data-region="count-container"]'), | ||
11 | ]; | ||
4 | const totalMessageCount = directCountSelector.reduce( | 12 | const totalMessageCount = directCountSelector.reduce( |
5 | ((count, item) => count + Ferdium.safeParseInt(item.textContent)), | 13 | (count, item) => count + Ferdium.safeParseInt(item.textContent), |
6 | 0 | 14 | 0, |
7 | ); | 15 | ); |
8 | 16 | ||
9 | Ferdium.setBadge(totalMessageCount, 0); | 17 | Ferdium.setBadge(totalMessageCount, 0); |
10 | }; | 18 | }; |
19 | |||
11 | Ferdium.loop(getMessages); | 20 | Ferdium.loop(getMessages); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 23 | }; |
diff --git a/recipes/msteams/index.js b/recipes/msteams/index.js index c8cdc38..ea86196 100644 --- a/recipes/msteams/index.js +++ b/recipes/msteams/index.js | |||
@@ -1,18 +1,21 @@ | |||
1 | module.exports = Ferdium => class MicrosoftTeams extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class MicrosoftTeams extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') | ||
6 | .trim(); | ||
7 | } | ||
5 | 8 | ||
6 | // TODO: Commenting out since this can expose the user to a MITM attack. Before this can be turned on, we will need to put in some safeguards/warnings that the user can explicitly accept the security ramifications | 9 | // TODO: Commenting out since this can expose the user to a MITM attack. Before this can be turned on, we will need to put in some safeguards/warnings that the user can explicitly accept the security ramifications |
7 | // // https://docs.microsoft.com/en-us/microsoftteams/troubleshoot/teams-sign-in/sign-in-loop#resolution | 10 | // // https://docs.microsoft.com/en-us/microsoftteams/troubleshoot/teams-sign-in/sign-in-loop#resolution |
8 | // knownCertificateHosts() { | 11 | // knownCertificateHosts() { |
9 | // return [ | 12 | // return [ |
10 | // 'microsoft.com', | 13 | // 'microsoft.com', |
11 | // 'microsoftonline.com', | 14 | // 'microsoftonline.com', |
12 | // 'teams.skype.com', | 15 | // 'teams.skype.com', |
13 | // 'teams.microsoft.com', | 16 | // 'teams.microsoft.com', |
14 | // 'sfbassets.com', | 17 | // 'sfbassets.com', |
15 | // 'skypeforbusiness.com', | 18 | // 'skypeforbusiness.com', |
16 | // ]; | 19 | // ]; |
17 | // }; | 20 | // }; |
18 | }; | 21 | }; |
diff --git a/recipes/msteams/package.json b/recipes/msteams/package.json index a67616a..814f1c5 100644 --- a/recipes/msteams/package.json +++ b/recipes/msteams/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "msteams", | 2 | "id": "msteams", |
3 | "name": "Microsoft Teams", | 3 | "name": "Microsoft Teams", |
4 | "version": "3.2.1", | 4 | "version": "3.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "teamsChat" | 7 | "teamsChat" |
diff --git a/recipes/msteams/webview.js b/recipes/msteams/webview.js index 149cc76..92af3a4 100644 --- a/recipes/msteams/webview.js +++ b/recipes/msteams/webview.js | |||
@@ -1,20 +1,23 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let messages = 0; | 9 | let messages = 0; |
10 | const badges = document.querySelectorAll('.activity-badge.dot-activity-badge .activity-badge'); | 10 | const badges = document.querySelectorAll( |
11 | '.activity-badge.dot-activity-badge .activity-badge', | ||
12 | ); | ||
11 | if (badges) { | 13 | if (badges) { |
12 | Array.prototype.forEach.call(badges, badge => { | 14 | Array.prototype.forEach.call(badges, badge => { |
13 | messages += Ferdium.safeParseInt(badge.textContent); | 15 | messages += Ferdium.safeParseInt(badge.textContent); |
14 | }); | 16 | }); |
15 | } | 17 | } |
16 | 18 | ||
17 | const indirectMessages = document.querySelectorAll('.app-bar-mention').length; | 19 | const indirectMessages = |
20 | document.querySelectorAll('.app-bar-mention').length; | ||
18 | 21 | ||
19 | Ferdium.setBadge(messages, indirectMessages); | 22 | Ferdium.setBadge(messages, indirectMessages); |
20 | }; | 23 | }; |
diff --git a/recipes/mstodo/package.json b/recipes/mstodo/package.json index 2d38ce0..a99bed1 100644 --- a/recipes/mstodo/package.json +++ b/recipes/mstodo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mstodo", | 2 | "id": "mstodo", |
3 | "name": "Microsoft To Do", | 3 | "name": "Microsoft To Do", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://to-do.live.com/tasks/", | 7 | "serviceURL": "https://to-do.live.com/tasks/", |
diff --git a/recipes/mstodo/webview.js b/recipes/mstodo/webview.js index 960e4bb..d7aa6c4 100644 --- a/recipes/mstodo/webview.js +++ b/recipes/mstodo/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
diff --git a/recipes/mysms/package.json b/recipes/mysms/package.json index a81fbc4..f4d30a4 100644 --- a/recipes/mysms/package.json +++ b/recipes/mysms/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mysms", | 2 | "id": "mysms", |
3 | "name": "MySMS", | 3 | "name": "MySMS", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.mysms.com" | 7 | "serviceURL": "https://app.mysms.com" |
diff --git a/recipes/mysms/webview.js b/recipes/mysms/webview.js index e0d638d..b68d5ee 100644 --- a/recipes/mysms/webview.js +++ b/recipes/mysms/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const elements = document.querySelectorAll('.unread'); | 9 | const elements = document.querySelectorAll('.unread'); |
@@ -6,10 +12,10 @@ module.exports = Ferdium => { | |||
6 | for (const element of elements) { | 12 | for (const element of elements) { |
7 | if ( | 13 | if ( |
8 | Ferdium.safeParseInt( | 14 | Ferdium.safeParseInt( |
9 | element.textContent && element.textContent.replace(/[^\d.]/g, ''), | 15 | element.textContent && element.textContent.replaceAll(/[^\d.]/g, ''), |
10 | ) > 0 | 16 | ) > 0 |
11 | ) { | 17 | ) { |
12 | count++; // count 1 per channel with messages | 18 | count += 1; // count 1 per channel with messages |
13 | } | 19 | } |
14 | } | 20 | } |
15 | 21 | ||
@@ -17,4 +23,6 @@ module.exports = Ferdium => { | |||
17 | }; | 23 | }; |
18 | 24 | ||
19 | Ferdium.loop(getMessages); | 25 | Ferdium.loop(getMessages); |
26 | |||
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
20 | }; | 28 | }; |
diff --git a/recipes/netatmo-energy/package.json b/recipes/netatmo-energy/package.json index 2cf28de..2ebd073 100644 --- a/recipes/netatmo-energy/package.json +++ b/recipes/netatmo-energy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "netatmo-energy", | 2 | "id": "netatmo-energy", |
3 | "name": "Netatmo Energy", | 3 | "name": "Netatmo Energy", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/rctneil/franz-recipe-netatmo-energy", | 6 | "repository": "https://github.com/rctneil/franz-recipe-netatmo-energy", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/netatmo-energy/webview.js b/recipes/netatmo-energy/webview.js index 86bb422..2a81dec 100644 --- a/recipes/netatmo-energy/webview.js +++ b/recipes/netatmo-energy/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/netlify/package.json b/recipes/netlify/package.json index a90c544..076c68b 100644 --- a/recipes/netlify/package.json +++ b/recipes/netlify/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "netlify", | 2 | "id": "netlify", |
3 | "name": "Netlify", | 3 | "name": "Netlify", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.netlify.com", | 7 | "serviceURL": "https://app.netlify.com", |
diff --git a/recipes/netlify/webview.js b/recipes/netlify/webview.js index 6bfff02..17fd73d 100644 --- a/recipes/netlify/webview.js +++ b/recipes/netlify/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const notifications = document.querySelectorAll("circle"); | 9 | const notifications = document.querySelectorAll('circle'); |
4 | 10 | ||
5 | Ferdium.setBadge(0, notifications.length > 0 ? 1 : 0); | 11 | Ferdium.setBadge(0, notifications.length > 0 ? 1 : 0); |
6 | }; | 12 | }; |
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/nextcloud-calendar/package.json b/recipes/nextcloud-calendar/package.json index f135caa..6505652 100644 --- a/recipes/nextcloud-calendar/package.json +++ b/recipes/nextcloud-calendar/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-calendar", | 2 | "id": "nextcloud-calendar", |
3 | "name": "Nextcloud Calendar", | 3 | "name": "Nextcloud Calendar", |
4 | "version": "1.2.2", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-calendar/", | 6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-calendar/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-calendar/webview.js b/recipes/nextcloud-calendar/webview.js index 80bfc45..2755cab 100644 --- a/recipes/nextcloud-calendar/webview.js +++ b/recipes/nextcloud-calendar/webview.js | |||
@@ -1,15 +1,17 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const directSelector = document.querySelectorAll( | 9 | const directSelector = document.querySelectorAll( |
10 | '.notifications .notification-wrapper .notification[object_type="dav"]', | 10 | '.notifications .notification-wrapper .notification[object_type="dav"]', |
11 | ); | 11 | ); |
12 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0; | 12 | const direct = directSelector |
13 | ? Ferdium.safeParseInt(directSelector.length) | ||
14 | : 0; | ||
13 | 15 | ||
14 | Ferdium.setBadge(direct); | 16 | Ferdium.setBadge(direct); |
15 | }; | 17 | }; |
diff --git a/recipes/nextcloud-carnet/package.json b/recipes/nextcloud-carnet/package.json index 67c7515..70ef1cd 100644 --- a/recipes/nextcloud-carnet/package.json +++ b/recipes/nextcloud-carnet/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-carnet", | 2 | "id": "nextcloud-carnet", |
3 | "name": "Carnet (Nextcloud)", | 3 | "name": "Carnet (Nextcloud)", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-carnet/", | 6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-carnet/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-carnet/webview.js b/recipes/nextcloud-carnet/webview.js index b3836a7..5832e75 100644 --- a/recipes/nextcloud-carnet/webview.js +++ b/recipes/nextcloud-carnet/webview.js | |||
@@ -1,18 +1,24 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const directSelector = document.querySelectorAll( | 9 | const directSelector = document.querySelectorAll( |
8 | '.app-navigation-entry-utils-counter.highlighted', | 10 | '.app-navigation-entry-utils-counter.highlighted', |
9 | ); | 11 | ); |
10 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0; | 12 | const direct = directSelector |
13 | ? Ferdium.safeParseInt(directSelector.length) | ||
14 | : 0; | ||
11 | 15 | ||
12 | const indirectSelector = document.querySelectorAll( | 16 | const indirectSelector = document.querySelectorAll( |
13 | '.app-navigation-entry-utils-counter:not(.highlighted)', | 17 | '.app-navigation-entry-utils-counter:not(.highlighted)', |
14 | ); | 18 | ); |
15 | const indirect = indirectSelector ? Ferdium.safeParseInt(indirectSelector.length) : 0; | 19 | const indirect = indirectSelector |
20 | ? Ferdium.safeParseInt(indirectSelector.length) | ||
21 | : 0; | ||
16 | 22 | ||
17 | Ferdium.setBadge(direct, indirect); | 23 | Ferdium.setBadge(direct, indirect); |
18 | }; | 24 | }; |
diff --git a/recipes/nextcloud-cospend/package.json b/recipes/nextcloud-cospend/package.json index 7367589..36d971e 100644 --- a/recipes/nextcloud-cospend/package.json +++ b/recipes/nextcloud-cospend/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-cospend", | 2 | "id": "nextcloud-cospend", |
3 | "name": "Nextcloud Cospend", | 3 | "name": "Nextcloud Cospend", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-cospend/", | 6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-cospend/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-cospend/webview.js b/recipes/nextcloud-cospend/webview.js index b3836a7..5832e75 100644 --- a/recipes/nextcloud-cospend/webview.js +++ b/recipes/nextcloud-cospend/webview.js | |||
@@ -1,18 +1,24 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const directSelector = document.querySelectorAll( | 9 | const directSelector = document.querySelectorAll( |
8 | '.app-navigation-entry-utils-counter.highlighted', | 10 | '.app-navigation-entry-utils-counter.highlighted', |
9 | ); | 11 | ); |
10 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0; | 12 | const direct = directSelector |
13 | ? Ferdium.safeParseInt(directSelector.length) | ||
14 | : 0; | ||
11 | 15 | ||
12 | const indirectSelector = document.querySelectorAll( | 16 | const indirectSelector = document.querySelectorAll( |
13 | '.app-navigation-entry-utils-counter:not(.highlighted)', | 17 | '.app-navigation-entry-utils-counter:not(.highlighted)', |
14 | ); | 18 | ); |
15 | const indirect = indirectSelector ? Ferdium.safeParseInt(indirectSelector.length) : 0; | 19 | const indirect = indirectSelector |
20 | ? Ferdium.safeParseInt(indirectSelector.length) | ||
21 | : 0; | ||
16 | 22 | ||
17 | Ferdium.setBadge(direct, indirect); | 23 | Ferdium.setBadge(direct, indirect); |
18 | }; | 24 | }; |
diff --git a/recipes/nextcloud-deck/package.json b/recipes/nextcloud-deck/package.json index 7d2be65..549bc4f 100644 --- a/recipes/nextcloud-deck/package.json +++ b/recipes/nextcloud-deck/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-deck", | 2 | "id": "nextcloud-deck", |
3 | "name": "Nextcloud Deck", | 3 | "name": "Nextcloud Deck", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/mindcombatant/ferdium-recipes/tree/master/recipes/nextcloud-deck/", | 6 | "repository": "https://github.com/mindcombatant/ferdium-recipes/tree/master/recipes/nextcloud-deck/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-deck/webview.js b/recipes/nextcloud-deck/webview.js index 33bf0c5..e60f50b 100644 --- a/recipes/nextcloud-deck/webview.js +++ b/recipes/nextcloud-deck/webview.js | |||
@@ -1,15 +1,17 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const directSelector = document.querySelector( | 9 | const directSelector = document.querySelector( |
10 | '.subscriptions-feed .app-navigation-entry-utils-counter', | 10 | '.subscriptions-feed .app-navigation-entry-utils-counter', |
11 | ); | 11 | ); |
12 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.textContent) : 0; | 12 | const direct = directSelector |
13 | ? Ferdium.safeParseInt(directSelector.textContent) | ||
14 | : 0; | ||
13 | 15 | ||
14 | Ferdium.setBadge(direct); | 16 | Ferdium.setBadge(direct); |
15 | }; | 17 | }; |
diff --git a/recipes/nextcloud-news/package.json b/recipes/nextcloud-news/package.json index 83db65b..2be7b75 100644 --- a/recipes/nextcloud-news/package.json +++ b/recipes/nextcloud-news/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-news", | 2 | "id": "nextcloud-news", |
3 | "name": "Nextcloud News", | 3 | "name": "Nextcloud News", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-news/", | 6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-news/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-news/webview.js b/recipes/nextcloud-news/webview.js index 33bf0c5..e60f50b 100644 --- a/recipes/nextcloud-news/webview.js +++ b/recipes/nextcloud-news/webview.js | |||
@@ -1,15 +1,17 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const directSelector = document.querySelector( | 9 | const directSelector = document.querySelector( |
10 | '.subscriptions-feed .app-navigation-entry-utils-counter', | 10 | '.subscriptions-feed .app-navigation-entry-utils-counter', |
11 | ); | 11 | ); |
12 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.textContent) : 0; | 12 | const direct = directSelector |
13 | ? Ferdium.safeParseInt(directSelector.textContent) | ||
14 | : 0; | ||
13 | 15 | ||
14 | Ferdium.setBadge(direct); | 16 | Ferdium.setBadge(direct); |
15 | }; | 17 | }; |
diff --git a/recipes/nextcloud-talk/package.json b/recipes/nextcloud-talk/package.json index e86bb8e..aaf779f 100644 --- a/recipes/nextcloud-talk/package.json +++ b/recipes/nextcloud-talk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-talk", | 2 | "id": "nextcloud-talk", |
3 | "name": "Nextcloud Talk", | 3 | "name": "Nextcloud Talk", |
4 | "version": "1.3.3", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-tasks/", | 6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-tasks/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-talk/webview.js b/recipes/nextcloud-talk/webview.js index 1c6d2a5..0c7f5c2 100644 --- a/recipes/nextcloud-talk/webview.js +++ b/recipes/nextcloud-talk/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
@@ -19,13 +21,17 @@ module.exports = Ferdium => { | |||
19 | 21 | ||
20 | let indirect = 0; | 22 | let indirect = 0; |
21 | 23 | ||
22 | for (const counter of document.querySelectorAll('.app-navigation-entry__counter')) { | 24 | for (const counter of document.querySelectorAll( |
23 | const entryCounter = counter ? Ferdium.safeParseInt(counter.textContent) : 0; | 25 | '.app-navigation-entry__counter', |
26 | )) { | ||
27 | const entryCounter = counter | ||
28 | ? Ferdium.safeParseInt(counter.textContent) | ||
29 | : 0; | ||
24 | indirect += entryCounter; | 30 | indirect += entryCounter; |
25 | } | 31 | } |
26 | 32 | ||
27 | if (document.title.startsWith("*")) { | 33 | if (document.title.startsWith('*')) { |
28 | indirect++; | 34 | indirect += 1; |
29 | } | 35 | } |
30 | 36 | ||
31 | Ferdium.setBadge(direct, indirect); | 37 | Ferdium.setBadge(direct, indirect); |
diff --git a/recipes/nextcloud-tasks/package.json b/recipes/nextcloud-tasks/package.json index 91942e4..473bf4a 100644 --- a/recipes/nextcloud-tasks/package.json +++ b/recipes/nextcloud-tasks/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-tasks", | 2 | "id": "nextcloud-tasks", |
3 | "name": "Nextcloud Tasks", | 3 | "name": "Nextcloud Tasks", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-tasks/", | 6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-tasks/", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/nextcloud-tasks/webview.js b/recipes/nextcloud-tasks/webview.js index 717fed7..5832e75 100644 --- a/recipes/nextcloud-tasks/webview.js +++ b/recipes/nextcloud-tasks/webview.js | |||
@@ -1,20 +1,24 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const directSelector = document.querySelectorAll( | 9 | const directSelector = document.querySelectorAll( |
10 | '.app-navigation-entry-utils-counter.highlighted', | 10 | '.app-navigation-entry-utils-counter.highlighted', |
11 | ); | 11 | ); |
12 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0; | 12 | const direct = directSelector |
13 | ? Ferdium.safeParseInt(directSelector.length) | ||
14 | : 0; | ||
13 | 15 | ||
14 | const indirectSelector = document.querySelectorAll( | 16 | const indirectSelector = document.querySelectorAll( |
15 | '.app-navigation-entry-utils-counter:not(.highlighted)', | 17 | '.app-navigation-entry-utils-counter:not(.highlighted)', |
16 | ); | 18 | ); |
17 | const indirect = indirectSelector ? Ferdium.safeParseInt(indirectSelector.length) : 0; | 19 | const indirect = indirectSelector |
20 | ? Ferdium.safeParseInt(indirectSelector.length) | ||
21 | : 0; | ||
18 | 22 | ||
19 | Ferdium.setBadge(direct, indirect); | 23 | Ferdium.setBadge(direct, indirect); |
20 | }; | 24 | }; |
diff --git a/recipes/nextcloud/index.js b/recipes/nextcloud/index.js index 4618097..ec947b7 100644 --- a/recipes/nextcloud/index.js +++ b/recipes/nextcloud/index.js | |||
@@ -1,5 +1,6 @@ | |||
1 | module.exports = Ferdium => class Nextcloud extends Ferdium { | 1 | module.exports = Ferdium => |
2 | buildUrl(url) { | 2 | class Nextcloud extends Ferdium { |
3 | return `${url}/`; | 3 | buildUrl(url) { |
4 | } | 4 | return `${url}/`; |
5 | }; | 5 | } |
6 | }; | ||
diff --git a/recipes/nextcloud/package.json b/recipes/nextcloud/package.json index 239cd6b..0cf39e8 100644 --- a/recipes/nextcloud/package.json +++ b/recipes/nextcloud/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud", | 2 | "id": "nextcloud", |
3 | "name": "Nextcloud", | 3 | "name": "Nextcloud", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasNotificationSound": true, | 7 | "hasNotificationSound": true, |
diff --git a/recipes/nextcloud/webview.js b/recipes/nextcloud/webview.js index cb13e02..e42f10a 100644 --- a/recipes/nextcloud/webview.js +++ b/recipes/nextcloud/webview.js | |||
@@ -1,13 +1,21 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const direct = document.querySelector( | 9 | const direct = document |
4 | '#header-menu-notifications, .notifications' | 10 | .querySelector('#header-menu-notifications, .notifications') |
5 | ).querySelectorAll( | 11 | .querySelectorAll( |
6 | '.notification-container .notification-wrapper .notification' | 12 | '.notification-container .notification-wrapper .notification', |
7 | ).length; | 13 | ).length; |
8 | 14 | ||
9 | Ferdium.setBadge(direct); | 15 | Ferdium.setBadge(direct); |
10 | }; | 16 | }; |
11 | 17 | ||
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/nextdoor/package.json b/recipes/nextdoor/package.json index 2874231..7ec984c 100644 --- a/recipes/nextdoor/package.json +++ b/recipes/nextdoor/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nextdoor", | 2 | "id": "nextdoor", |
3 | "name": "Nextdoor", | 3 | "name": "Nextdoor", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://nextdoor.co.uk/inbox/" | 7 | "serviceURL": "https://nextdoor.co.uk/inbox/" |
diff --git a/recipes/nextdoor/webview.js b/recipes/nextdoor/webview.js index bec9944..ea110b8 100644 --- a/recipes/nextdoor/webview.js +++ b/recipes/nextdoor/webview.js | |||
@@ -1,14 +1,22 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let unread = 0; | 9 | let unread = 0; |
4 | const notificationBadge = document.querySelectorAll( | 10 | const notificationBadge = document.querySelectorAll( |
5 | '.notification-badge', | 11 | '.notification-badge', |
6 | )[0]; | 12 | )[0]; |
7 | if (notificationBadge != undefined) { | 13 | if (notificationBadge !== undefined) { |
8 | unread = Ferdium.safeParseInt(notificationBadge.textContent); | 14 | unread = Ferdium.safeParseInt(notificationBadge.textContent); |
9 | } | 15 | } |
10 | Ferdium.setBadge(unread); | 16 | Ferdium.setBadge(unread); |
11 | }; | 17 | }; |
12 | 18 | ||
13 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 22 | }; |
diff --git a/recipes/noisli/package.json b/recipes/noisli/package.json index 0a35c57..21ec583 100755 --- a/recipes/noisli/package.json +++ b/recipes/noisli/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "noisli", | 2 | "id": "noisli", |
3 | "name": "Noisli", | 3 | "name": "Noisli", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.noisli.com/login" | 7 | "serviceURL": "https://www.noisli.com/login" |
diff --git a/recipes/noisli/webview.js b/recipes/noisli/webview.js index 86bb422..2a81dec 100644 --- a/recipes/noisli/webview.js +++ b/recipes/noisli/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/nomadlist/package.json b/recipes/nomadlist/package.json index 64936d6..c63fecb 100644 --- a/recipes/nomadlist/package.json +++ b/recipes/nomadlist/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "nomadlist", | 2 | "id": "nomadlist", |
3 | "name": "NomadList", | 3 | "name": "NomadList", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://nomadlist.com/chat", | 7 | "serviceURL": "https://nomadlist.com/chat", |
diff --git a/recipes/nomadlist/webview.js b/recipes/nomadlist/webview.js index f737e2e..a9524f8 100644 --- a/recipes/nomadlist/webview.js +++ b/recipes/nomadlist/webview.js | |||
@@ -1,7 +1,15 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | Ferdium.setBadge($('.unread').length); | 9 | Ferdium.setBadge($('.unread').length); |
4 | }; | 10 | }; |
5 | 11 | ||
6 | Ferdium.loop(getMessages); | 12 | Ferdium.loop(getMessages); |
13 | |||
14 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
7 | }; | 15 | }; |
diff --git a/recipes/notion/package.json b/recipes/notion/package.json index f020b26..5ed8a2d 100644 --- a/recipes/notion/package.json +++ b/recipes/notion/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "notion", | 2 | "id": "notion", |
3 | "name": "Notion", | 3 | "name": "Notion", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/TanZng/ferdi-notion", | 6 | "repository": "https://github.com/TanZng/ferdi-notion", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/notion/webview.js b/recipes/notion/webview.js index b64727a..e3c96e8 100644 --- a/recipes/notion/webview.js +++ b/recipes/notion/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let direct = 0; | 9 | let direct = 0; |
@@ -12,4 +18,6 @@ module.exports = Ferdium => { | |||
12 | }; | 18 | }; |
13 | 19 | ||
14 | Ferdium.loop(getMessages); | 20 | Ferdium.loop(getMessages); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
15 | }; | 23 | }; |
diff --git a/recipes/ntfy/index.js b/recipes/ntfy/index.js index 8244b1b..dd41f72 100644 --- a/recipes/ntfy/index.js +++ b/recipes/ntfy/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdium => Ferdium; \ No newline at end of file | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/ntfy/package.json b/recipes/ntfy/package.json index 76771b0..3786052 100644 --- a/recipes/ntfy/package.json +++ b/recipes/ntfy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "ntfy", | 2 | "id": "ntfy", |
3 | "name": "ntfy", | 3 | "name": "ntfy", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "Notify" | 7 | "Notify" |
diff --git a/recipes/ntfy/webview.js b/recipes/ntfy/webview.js index 45b8d2d..4fed933 100644 --- a/recipes/ntfy/webview.js +++ b/recipes/ntfy/webview.js | |||
@@ -1,14 +1,22 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let msgRaw = document.title.match(/\(\d*\)/); | 9 | const msgRaw = document.title.match(/\(\d*\)/); |
4 | let messages = 0; | 10 | let messages = 0; |
5 | 11 | ||
6 | if (msgRaw) { | 12 | if (msgRaw) { |
7 | messages = Ferdium.safeParseInt(msgRaw[0].slice(1)); | 13 | messages = Ferdium.safeParseInt(msgRaw[0].slice(1)); |
8 | } | 14 | } |
9 | 15 | ||
10 | Ferdium.setBadge(messages, 0); | 16 | Ferdium.setBadge(messages, 0); |
11 | } | 17 | }; |
12 | 18 | ||
13 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
14 | }; \ No newline at end of file | 20 | |
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | ||
diff --git a/recipes/odoo/package.json b/recipes/odoo/package.json index 3c95b13..21c58af 100644 --- a/recipes/odoo/package.json +++ b/recipes/odoo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "odoo", | 2 | "id": "odoo", |
3 | "name": "Odoo", | 3 | "name": "Odoo", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.odoo.com/web/login", | 7 | "serviceURL": "https://www.odoo.com/web/login", |
diff --git a/recipes/odoo/webview.js b/recipes/odoo/webview.js index 86bb422..2a81dec 100644 --- a/recipes/odoo/webview.js +++ b/recipes/odoo/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/odysee/package.json b/recipes/odysee/package.json index 181c4ad..2a0a09a 100644 --- a/recipes/odysee/package.json +++ b/recipes/odysee/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "odysee", | 2 | "id": "odysee", |
3 | "name": "Odysee", | 3 | "name": "Odysee", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/hafiz-muhammad/ferdium-recipes", | 6 | "repository": "https://github.com/hafiz-muhammad/ferdium-recipes", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/odysee/webview.js b/recipes/odysee/webview.js index 745e807..f51fb7b 100644 --- a/recipes/odysee/webview.js +++ b/recipes/odysee/webview.js | |||
@@ -1,15 +1,23 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | function getNotifications() { | 8 | function getNotifications() { |
3 | let unreadNotifications = 0; | 9 | let unreadNotifications = 0; |
4 | for (const notificationCounterElement of document.querySelectorAll( | 10 | for (const notificationCounterElement of document.querySelectorAll( |
5 | ".notification__count" | 11 | '.notification__count', |
6 | )) { | 12 | )) { |
7 | unreadNotifications = | 13 | unreadNotifications += Ferdium.safeParseInt( |
8 | unreadNotifications + | 14 | notificationCounterElement.textContent, |
9 | Ferdium.safeParseInt(notificationCounterElement.textContent); | 15 | ); |
10 | } | 16 | } |
11 | 17 | ||
12 | Ferdium.setBadge(unreadNotifications); | 18 | Ferdium.setBadge(unreadNotifications); |
13 | } | 19 | } |
14 | Ferdium.loop(getNotifications); | 20 | Ferdium.loop(getNotifications); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
15 | }; | 23 | }; |
diff --git a/recipes/office365-owa/index.js b/recipes/office365-owa/index.js index 2b10475..7ea3435 100644 --- a/recipes/office365-owa/index.js +++ b/recipes/office365-owa/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = Ferdium => class Outlook extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Outlook extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/office365-owa/package.json b/recipes/office365-owa/package.json index 6cd10eb..72082ab 100644 --- a/recipes/office365-owa/package.json +++ b/recipes/office365-owa/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "office365-owa", | 2 | "id": "office365-owa", |
3 | "name": "Office 365 Outlook", | 3 | "name": "Office 365 Outlook", |
4 | "version": "1.6.2", | 4 | "version": "1.7.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "live.com", | 7 | "live.com", |
diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js index 9613636..5026249 100644 --- a/recipes/office365-owa/webview.js +++ b/recipes/office365-owa/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
2 | const collectCounts = selector => { | 8 | const collectCounts = selector => { |
3 | let unreadCount = 0; | 9 | let unreadCount = 0; |
@@ -36,4 +42,6 @@ module.exports = (Ferdium, settings) => { | |||
36 | Ferdium.setBadge(directUnreadCount, indirectUnreadCount); | 42 | Ferdium.setBadge(directUnreadCount, indirectUnreadCount); |
37 | }; | 43 | }; |
38 | Ferdium.loop(getMessages); | 44 | Ferdium.loop(getMessages); |
45 | |||
46 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
39 | }; | 47 | }; |
diff --git a/recipes/onenote/package.json b/recipes/onenote/package.json index a9957d0..da20430 100644 --- a/recipes/onenote/package.json +++ b/recipes/onenote/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "onenote", | 2 | "id": "onenote", |
3 | "name": "OneNote", | 3 | "name": "OneNote", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://onenote.com" | 7 | "serviceURL": "https://onenote.com" |
diff --git a/recipes/onenote/webview.js b/recipes/onenote/webview.js index 86bb422..2a81dec 100644 --- a/recipes/onenote/webview.js +++ b/recipes/onenote/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/onmail/package.json b/recipes/onmail/package.json index fd48d51..9976997 100644 --- a/recipes/onmail/package.json +++ b/recipes/onmail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "onmail", | 2 | "id": "onmail", |
3 | "name": "onMail", | 3 | "name": "onMail", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.onmail.com" | 7 | "serviceURL": "https://mail.onmail.com" |
diff --git a/recipes/onmail/webview.js b/recipes/onmail/webview.js index 9e881f4..e2a5fb2 100644 --- a/recipes/onmail/webview.js +++ b/recipes/onmail/webview.js | |||
@@ -1,17 +1,20 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let countImportant = 0; | 9 | let countImportant = 0; |
10 | const inboxLinks = document.querySelectorAll('p.truncate'); | 10 | const inboxLinks = document.querySelectorAll('p.truncate'); |
11 | for (const label of inboxLinks){ | 11 | for (const label of inboxLinks) { |
12 | if (label.textContent) { | 12 | if (label.textContent) { |
13 | let inbox_count = label.nextSibling | 13 | const inboxCount = label.nextSibling; |
14 | countImportant = inbox_count == null ? 0 : Ferdium.safeParseInt(inbox_count.textContent); | 14 | countImportant = |
15 | inboxCount === null | ||
16 | ? 0 | ||
17 | : Ferdium.safeParseInt(inboxCount.textContent); | ||
15 | 18 | ||
16 | break; | 19 | break; |
17 | } | 20 | } |
diff --git a/recipes/oreilly-learning/package.json b/recipes/oreilly-learning/package.json index 05aee71..a5bb2fa 100644 --- a/recipes/oreilly-learning/package.json +++ b/recipes/oreilly-learning/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "oreilly-learning", | 2 | "id": "oreilly-learning", |
3 | "name": "O'Reilly Learning", | 3 | "name": "O'Reilly Learning", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://learning.oreilly.com/home-new/" | 7 | "serviceURL": "https://learning.oreilly.com/home-new/" |
diff --git a/recipes/oreilly-learning/webview.js b/recipes/oreilly-learning/webview.js index 56a20b6..1119219 100644 --- a/recipes/oreilly-learning/webview.js +++ b/recipes/oreilly-learning/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/outreach/package.json b/recipes/outreach/package.json index 554a127..e6ca4b4 100644 --- a/recipes/outreach/package.json +++ b/recipes/outreach/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "outreach", | 2 | "id": "outreach", |
3 | "name": "Outreach", | 3 | "name": "Outreach", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://accounts.outreach.io/users/sign_in" | 7 | "serviceURL": "https://accounts.outreach.io/users/sign_in" |
diff --git a/recipes/outreach/webview.js b/recipes/outreach/webview.js index 56a20b6..1119219 100644 --- a/recipes/outreach/webview.js +++ b/recipes/outreach/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/paymo/package.json b/recipes/paymo/package.json index 5fb2c9d..0315814 100644 --- a/recipes/paymo/package.json +++ b/recipes/paymo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "paymo", | 2 | "id": "paymo", |
3 | "name": "Paymo", | 3 | "name": "Paymo", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.paymoapp.com/auth/login" | 7 | "serviceURL": "https://app.paymoapp.com/auth/login" |
diff --git a/recipes/paymo/webview.js b/recipes/paymo/webview.js index 86bb422..2a81dec 100644 --- a/recipes/paymo/webview.js +++ b/recipes/paymo/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/perplexity/package.json b/recipes/perplexity/package.json index 4da64ae..7b6eebd 100644 --- a/recipes/perplexity/package.json +++ b/recipes/perplexity/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "perplexity", | 2 | "id": "perplexity", |
3 | "name": "Perplexity AI", | 3 | "name": "Perplexity AI", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.perplexity.ai/" | 7 | "serviceURL": "https://www.perplexity.ai/" |
diff --git a/recipes/perplexity/webview.js b/recipes/perplexity/webview.js index 56a20b6..1119219 100644 --- a/recipes/perplexity/webview.js +++ b/recipes/perplexity/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/pinterest/package.json b/recipes/pinterest/package.json index 2773675..b6d2d1a 100644 --- a/recipes/pinterest/package.json +++ b/recipes/pinterest/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pinterest", | 2 | "id": "pinterest", |
3 | "name": "Pinterest", | 3 | "name": "Pinterest", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://pinterest.com" | 7 | "serviceURL": "https://pinterest.com" |
diff --git a/recipes/pinterest/webview.js b/recipes/pinterest/webview.js index 86bb422..2a81dec 100644 --- a/recipes/pinterest/webview.js +++ b/recipes/pinterest/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/pipefy/index.js b/recipes/pipefy/index.js index 3dc9471..dde5cea 100644 --- a/recipes/pipefy/index.js +++ b/recipes/pipefy/index.js | |||
@@ -1,6 +1,6 @@ | |||
1 | module.exports = (Ferdium) => | 1 | module.exports = Ferdium => |
2 | class Pipefy extends Ferdium { | 2 | class Pipefy extends Ferdium { |
3 | overrideUserAgent() { | 3 | overrideUserAgent() { |
4 | return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; | 4 | return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0'; |
5 | } | 5 | } |
6 | }; | 6 | }; |
diff --git a/recipes/pipefy/package.json b/recipes/pipefy/package.json index ba02935..abdc555 100644 --- a/recipes/pipefy/package.json +++ b/recipes/pipefy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pipefy", | 2 | "id": "pipefy", |
3 | "name": "Pipefy", | 3 | "name": "Pipefy", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.pipefy.com/", | 7 | "serviceURL": "https://app.pipefy.com/", |
diff --git a/recipes/pipefy/webview.js b/recipes/pipefy/webview.js index f951ad1..8662f7d 100644 --- a/recipes/pipefy/webview.js +++ b/recipes/pipefy/webview.js | |||
@@ -1,10 +1,19 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const getNotificationButton = document.querySelector( | 9 | const getNotificationButton = document.querySelector( |
4 | '#notifications_button', | 10 | '#notifications_button', |
5 | ); | 11 | ); |
6 | let hasNotification = getNotificationButton.classList.contains('pp-active'); | 12 | const hasNotification = |
13 | getNotificationButton.classList.contains('pp-active'); | ||
7 | Ferdium.setBadge(0, hasNotification ? 1 : 0); | 14 | Ferdium.setBadge(0, hasNotification ? 1 : 0); |
8 | }; | 15 | }; |
9 | Ferdium.loop(getMessages); | 16 | Ferdium.loop(getMessages); |
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 19 | }; |
diff --git a/recipes/pivotal-tracker/package.json b/recipes/pivotal-tracker/package.json index 42ba0dc..07af528 100644 --- a/recipes/pivotal-tracker/package.json +++ b/recipes/pivotal-tracker/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pivotal-tracker", | 2 | "id": "pivotal-tracker", |
3 | "name": "pivotal-tracker", | 3 | "name": "pivotal-tracker", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.pivotaltracker.com/signin", | 7 | "serviceURL": "https://www.pivotaltracker.com/signin", |
diff --git a/recipes/pivotal-tracker/webview.js b/recipes/pivotal-tracker/webview.js index 8671847..3df27ee 100644 --- a/recipes/pivotal-tracker/webview.js +++ b/recipes/pivotal-tracker/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const bell = document.querySelectorAll('#view65 > span')[0]; | 9 | const bell = document.querySelectorAll('#view65 > span')[0]; |
@@ -7,4 +13,6 @@ module.exports = Ferdium => { | |||
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/pixelfed/package.json b/recipes/pixelfed/package.json index 328dab8..28a8bc5 100644 --- a/recipes/pixelfed/package.json +++ b/recipes/pixelfed/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pixelfed", | 2 | "id": "pixelfed", |
3 | "name": "Pixelfed", | 3 | "name": "Pixelfed", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://pixelfed.social", | 7 | "serviceURL": "https://pixelfed.social", |
diff --git a/recipes/pixelfed/webview.js b/recipes/pixelfed/webview.js index 56a20b6..1119219 100644 --- a/recipes/pixelfed/webview.js +++ b/recipes/pixelfed/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/pixieset/package.json b/recipes/pixieset/package.json index 773f37a..37d70f3 100644 --- a/recipes/pixieset/package.json +++ b/recipes/pixieset/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pixieset", | 2 | "id": "pixieset", |
3 | "name": "Pixieset", | 3 | "name": "Pixieset", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://accounts.pixieset.com/dashboard/" | 7 | "serviceURL": "https://accounts.pixieset.com/dashboard/" |
diff --git a/recipes/pixieset/webview.js b/recipes/pixieset/webview.js index 913aa94..88c9263 100644 --- a/recipes/pixieset/webview.js +++ b/recipes/pixieset/webview.js | |||
@@ -1,10 +1,18 @@ | |||
1 | "use strict"; | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | module.exports = (Ferdium) => { | 5 | const _path = _interopRequireDefault(require('path')); |
6 | |||
7 | module.exports = Ferdium => { | ||
4 | const getMessages = () => { | 8 | const getMessages = () => { |
5 | const element = document.querySelector('.notification-count'); | 9 | const element = document.querySelector('.notification-count'); |
6 | Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent.match(/\d+/)[0]) : 0); | 10 | Ferdium.setBadge( |
11 | element ? Ferdium.safeParseInt(element.textContent.match(/\d+/)[0]) : 0, | ||
12 | ); | ||
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/plan/package.json b/recipes/plan/package.json index 3d61a68..3722d39 100644 --- a/recipes/plan/package.json +++ b/recipes/plan/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "plan", | 2 | "id": "plan", |
3 | "name": "Plan", | 3 | "name": "Plan", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://getplan.co/", | 7 | "serviceURL": "https://getplan.co/", |
diff --git a/recipes/plan/webview.js b/recipes/plan/webview.js index 86bb422..2a81dec 100644 --- a/recipes/plan/webview.js +++ b/recipes/plan/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/planitpoker/package.json b/recipes/planitpoker/package.json index 1b371e4..992ff48 100644 --- a/recipes/planitpoker/package.json +++ b/recipes/planitpoker/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "planitpoker", | 2 | "id": "planitpoker", |
3 | "name": "PlanITPoker", | 3 | "name": "PlanITPoker", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.planitpoker.com/board/#/room/{teamId}", | 7 | "serviceURL": "https://www.planitpoker.com/board/#/room/{teamId}", |
diff --git a/recipes/planitpoker/webview.js b/recipes/planitpoker/webview.js index 13b8156..94dab2f 100644 --- a/recipes/planitpoker/webview.js +++ b/recipes/planitpoker/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your OReilly Service service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your OReilly Service service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/plek/package.json b/recipes/plek/package.json index 815b34e..9f99186 100644 --- a/recipes/plek/package.json +++ b/recipes/plek/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "plek", | 2 | "id": "plek", |
3 | "name": "Plek", | 3 | "name": "Plek", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "repository": "https://github.com/jsimonetti/franz-recipe-plek", | 5 | "repository": "https://github.com/jsimonetti/franz-recipe-plek", |
6 | "license": "MIT", | 6 | "license": "MIT", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/plek/webview.js b/recipes/plek/webview.js index bf3579e..0f6396b 100644 --- a/recipes/plek/webview.js +++ b/recipes/plek/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directMessages = 0; | 9 | let directMessages = 0; |
@@ -17,4 +23,6 @@ module.exports = Ferdium => { | |||
17 | }; | 23 | }; |
18 | 24 | ||
19 | Ferdium.loop(getMessages); | 25 | Ferdium.loop(getMessages); |
26 | |||
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
20 | }; | 28 | }; |
diff --git a/recipes/pleroma/index.js b/recipes/pleroma/index.js index 67a0e19..2050059 100644 --- a/recipes/pleroma/index.js +++ b/recipes/pleroma/index.js | |||
@@ -1,19 +1,21 @@ | |||
1 | module.exports = Ferdium => class Pleroma extends Ferdium { | 1 | module.exports = Ferdium => |
2 | async validateUrl(url) { | 2 | class Pleroma extends Ferdium { |
3 | try { | 3 | async validateUrl(url) { |
4 | const resp = await window.fetch(`${url}/api/v1/instance`, { | 4 | try { |
5 | Accept: 'application/json', | 5 | const resp = await window.fetch(`${url}/api/v1/instance`, { |
6 | }); | 6 | Accept: 'application/json', |
7 | const data = await resp.json(); | 7 | }); |
8 | const version = data.version; | 8 | const data = await resp.json(); |
9 | return typeof (version) === 'string' && version.includes('Pleroma'); | 9 | const version = data.version; |
10 | } catch (error) { | 10 | return typeof version === 'string' && version.includes('Pleroma'); |
11 | console.log('Pleroma server validation error', error); | 11 | } catch (error) { |
12 | // eslint-disable-next-line no-console | ||
13 | console.log('Pleroma server validation error', error); | ||
14 | } | ||
15 | return false; | ||
12 | } | 16 | } |
13 | return false; | ||
14 | } | ||
15 | 17 | ||
16 | buildUrl(url) { | 18 | buildUrl(url) { |
17 | return `${url}/main/friends`; | 19 | return `${url}/main/friends`; |
18 | } | 20 | } |
19 | }; | 21 | }; |
diff --git a/recipes/pleroma/package.json b/recipes/pleroma/package.json index de92244..5819a75 100644 --- a/recipes/pleroma/package.json +++ b/recipes/pleroma/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pleroma", | 2 | "id": "pleroma", |
3 | "name": "Pleroma", | 3 | "name": "Pleroma", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js index 41516f6..703a53f 100644 --- a/recipes/pleroma/webview.js +++ b/recipes/pleroma/webview.js | |||
@@ -16,6 +16,7 @@ const getInstanceConfig = async () => { | |||
16 | const pleromaFeConfig = frontendConfig.pleroma_fe || {}; | 16 | const pleromaFeConfig = frontendConfig.pleroma_fe || {}; |
17 | return { ...staticConfig, ...pleromaFeConfig }; | 17 | return { ...staticConfig, ...pleromaFeConfig }; |
18 | } catch (error) { | 18 | } catch (error) { |
19 | // eslint-disable-next-line no-console | ||
19 | console.log('Failed to load dynamic frontend configuration', error); | 20 | console.log('Failed to load dynamic frontend configuration', error); |
20 | return staticConfig; | 21 | return staticConfig; |
21 | } | 22 | } |
@@ -162,6 +163,7 @@ module.exports = Ferdium => { | |||
162 | }); | 163 | }); |
163 | }, | 164 | }, |
164 | error => { | 165 | error => { |
166 | // eslint-disable-next-line no-console | ||
165 | console.log('Failed to load instance logo', error); | 167 | console.log('Failed to load instance logo', error); |
166 | Ferdium.loop(getMessages); | 168 | Ferdium.loop(getMessages); |
167 | }, | 169 | }, |
diff --git a/recipes/plurk/package.json b/recipes/plurk/package.json index 50415da..44ddc2d 100644 --- a/recipes/plurk/package.json +++ b/recipes/plurk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "plurk", | 2 | "id": "plurk", |
3 | "name": "Plurk", | 3 | "name": "Plurk", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.plurk.com" | 7 | "serviceURL": "https://www.plurk.com" |
diff --git a/recipes/plurk/webview.js b/recipes/plurk/webview.js index dfacf30..da52aec 100644 --- a/recipes/plurk/webview.js +++ b/recipes/plurk/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let direct = 0; | 9 | let direct = 0; |
@@ -16,4 +22,6 @@ module.exports = Ferdium => { | |||
16 | }; | 22 | }; |
17 | 23 | ||
18 | Ferdium.loop(getMessages, 10_000); | 24 | Ferdium.loop(getMessages, 10_000); |
25 | |||
26 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
19 | }; | 27 | }; |
diff --git a/recipes/pocket/package.json b/recipes/pocket/package.json index 5f81d1f..25210e2 100644 --- a/recipes/pocket/package.json +++ b/recipes/pocket/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pocket", | 2 | "id": "pocket", |
3 | "name": "Pocket", | 3 | "name": "Pocket", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://getpocket.com/a/queue/list/" | 7 | "serviceURL": "https://getpocket.com/a/queue/list/" |
diff --git a/recipes/pocket/webview.js b/recipes/pocket/webview.js index 86bb422..2a81dec 100644 --- a/recipes/pocket/webview.js +++ b/recipes/pocket/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/pocketcasts/package.json b/recipes/pocketcasts/package.json index 7cb2be2..a7334d2 100644 --- a/recipes/pocketcasts/package.json +++ b/recipes/pocketcasts/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pocketcasts", | 2 | "id": "pocketcasts", |
3 | "name": "PocketCasts", | 3 | "name": "PocketCasts", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://play.pocketcasts.com/user/login" | 7 | "serviceURL": "https://play.pocketcasts.com/user/login" |
diff --git a/recipes/pocketcasts/webview.js b/recipes/pocketcasts/webview.js index 5c033a2..f529029 100644 --- a/recipes/pocketcasts/webview.js +++ b/recipes/pocketcasts/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your Pocket Casts service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your Pocket Casts service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/podio/package.json b/recipes/podio/package.json index 5d2ae43..f9e6cd9 100644 --- a/recipes/podio/package.json +++ b/recipes/podio/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "podio", | 2 | "id": "podio", |
3 | "name": "Podio", | 3 | "name": "Podio", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://podio.com", | 7 | "serviceURL": "https://podio.com", |
diff --git a/recipes/podio/webview.js b/recipes/podio/webview.js index 9ba40d0..e6c2f77 100644 --- a/recipes/podio/webview.js +++ b/recipes/podio/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const updates = document.querySelectorAll('.counter')[0].textContent; | 9 | const updates = document.querySelectorAll('.counter')[0].textContent; |
diff --git a/recipes/pomodoro-tracker/package.json b/recipes/pomodoro-tracker/package.json index ab7f3f1..65337bb 100644 --- a/recipes/pomodoro-tracker/package.json +++ b/recipes/pomodoro-tracker/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pomodoro-tracker", | 2 | "id": "pomodoro-tracker", |
3 | "name": "Pomodoro Tracker", | 3 | "name": "Pomodoro Tracker", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://pomodoro-tracker.com", | 7 | "serviceURL": "https://pomodoro-tracker.com", |
diff --git a/recipes/pomodoro-tracker/webview.js b/recipes/pomodoro-tracker/webview.js index 86bb422..2a81dec 100644 --- a/recipes/pomodoro-tracker/webview.js +++ b/recipes/pomodoro-tracker/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/posteo/package.json b/recipes/posteo/package.json index 8bfdeb8..cbe9529 100644 --- a/recipes/posteo/package.json +++ b/recipes/posteo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "posteo", | 2 | "id": "posteo", |
3 | "name": "Posteo", | 3 | "name": "Posteo", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "mail", | 7 | "mail", |
diff --git a/recipes/posteo/webview.js b/recipes/posteo/webview.js index 56a20b6..1119219 100644 --- a/recipes/posteo/webview.js +++ b/recipes/posteo/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/producthunt/index.js b/recipes/producthunt/index.js index 2d59d28..dd41f72 100644 --- a/recipes/producthunt/index.js +++ b/recipes/producthunt/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdium => Ferdium | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/producthunt/package.json b/recipes/producthunt/package.json index 64a57a8..d8f3eea 100644 --- a/recipes/producthunt/package.json +++ b/recipes/producthunt/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "producthunt", | 2 | "id": "producthunt", |
3 | "name": "Product Hunt", | 3 | "name": "Product Hunt", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/alexdevero/franz-producthunt-recipe", | 6 | "repository": "https://github.com/alexdevero/franz-producthunt-recipe", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/producthunt/webview.js b/recipes/producthunt/webview.js index 86cab43..afcdc3e 100644 --- a/recipes/producthunt/webview.js +++ b/recipes/producthunt/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const notificationsSelector = document.querySelector( | 8 | const notificationsSelector = document.querySelector( |
3 | '[class*=header_] [class*=content_] [class*=actions_] [class*=notificationsButton_]', | 9 | '[class*=header_] [class*=content_] [class*=actions_] [class*=notificationsButton_]', |
@@ -10,4 +16,6 @@ module.exports = Ferdium => { | |||
10 | }; | 16 | }; |
11 | 17 | ||
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/protoncalendar/darkmode.css b/recipes/proton-calendar/darkmode.css index 8eeeb07..8eeeb07 100644 --- a/recipes/protoncalendar/darkmode.css +++ b/recipes/proton-calendar/darkmode.css | |||
diff --git a/recipes/protoncalendar/icon.svg b/recipes/proton-calendar/icon.svg index 6522ffd..6522ffd 100644 --- a/recipes/protoncalendar/icon.svg +++ b/recipes/proton-calendar/icon.svg | |||
diff --git a/recipes/protoncalendar/index.js b/recipes/proton-calendar/index.js index dd41f72..dd41f72 100644 --- a/recipes/protoncalendar/index.js +++ b/recipes/proton-calendar/index.js | |||
diff --git a/recipes/protoncalendar/package.json b/recipes/proton-calendar/package.json index 85da1bb..4d6a062 100644 --- a/recipes/protoncalendar/package.json +++ b/recipes/proton-calendar/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "protoncalendar", | 2 | "id": "proton-calendar", |
3 | "name": "ProtonCalendar", | 3 | "name": "ProtonCalendar", |
4 | "version": "1.4.1", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://calendar.proton.me/" | 7 | "serviceURL": "https://calendar.proton.me/" |
diff --git a/recipes/googlepodcasts/webview.js b/recipes/proton-calendar/webview.js index 86bb422..2a81dec 100644 --- a/recipes/googlepodcasts/webview.js +++ b/recipes/proton-calendar/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/protondrive/icon.svg b/recipes/proton-drive/icon.svg index 1709ff1..1709ff1 100755 --- a/recipes/protondrive/icon.svg +++ b/recipes/proton-drive/icon.svg | |||
diff --git a/recipes/protondrive/index.js b/recipes/proton-drive/index.js index dd41f72..dd41f72 100755 --- a/recipes/protondrive/index.js +++ b/recipes/proton-drive/index.js | |||
diff --git a/recipes/protondrive/package.json b/recipes/proton-drive/package.json index f0da40a..54ea8f4 100755 --- a/recipes/protondrive/package.json +++ b/recipes/proton-drive/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "protondrive", | 2 | "id": "proton-drive", |
3 | "name": "Proton Drive", | 3 | "name": "Proton Drive", |
4 | "version": "1.0.1", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://drive.proton.me" | 7 | "serviceURL": "https://drive.proton.me" |
diff --git a/recipes/protondrive/webview-unsafe.js b/recipes/proton-drive/webview-unsafe.js index 9198ac5..9198ac5 100755 --- a/recipes/protondrive/webview-unsafe.js +++ b/recipes/proton-drive/webview-unsafe.js | |||
diff --git a/recipes/protondrive/webview.js b/recipes/proton-drive/webview.js index aba811f..c27c226 100755 --- a/recipes/protondrive/webview.js +++ b/recipes/proton-drive/webview.js | |||
@@ -1,8 +1,10 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
7 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 9 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
8 | }; | 10 | }; |
diff --git a/recipes/proton-mail/package.json b/recipes/proton-mail/package.json index 81dae58..715bdad 100644 --- a/recipes/proton-mail/package.json +++ b/recipes/proton-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "proton-mail", | 2 | "id": "proton-mail", |
3 | "name": "ProtonMail", | 3 | "name": "ProtonMail", |
4 | "version": "1.6.1", | 4 | "version": "1.7.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.proton.me/login" | 7 | "serviceURL": "https://mail.proton.me/login" |
diff --git a/recipes/proton-mail/webview.js b/recipes/proton-mail/webview.js index dc3499a..05db958 100644 --- a/recipes/proton-mail/webview.js +++ b/recipes/proton-mail/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let unreadCount = 0; | 9 | let unreadCount = 0; |
4 | // Loop over all displayed counters and take the highest one (from the "All Mail" folder) | 10 | // Loop over all displayed counters and take the highest one (from the "All Mail" folder) |
5 | for (const counterElement of document.querySelectorAll('.navigation-counter-item')) { | 11 | for (const counterElement of document.querySelectorAll( |
12 | '.navigation-counter-item', | ||
13 | )) { | ||
6 | const unreadCounter = Ferdium.safeParseInt(counterElement.textContent); | 14 | const unreadCounter = Ferdium.safeParseInt(counterElement.textContent); |
7 | unreadCount = Math.max(unreadCount, unreadCounter); | 15 | unreadCount = Math.max(unreadCount, unreadCounter); |
8 | } | 16 | } |
@@ -11,4 +19,6 @@ module.exports = Ferdium => { | |||
11 | }; | 19 | }; |
12 | 20 | ||
13 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
22 | |||
23 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 24 | }; |
diff --git a/recipes/protonet/package.json b/recipes/protonet/package.json index a876339..f5a06f8 100755 --- a/recipes/protonet/package.json +++ b/recipes/protonet/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "protonet", | 2 | "id": "protonet", |
3 | "name": "protonet", | 3 | "name": "protonet", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamID}.protonet.info", | 7 | "serviceURL": "https://{teamID}.protonet.info", |
diff --git a/recipes/protonet/webview.js b/recipes/protonet/webview.js index 4ec9f78..71c0d0f 100755 --- a/recipes/protonet/webview.js +++ b/recipes/protonet/webview.js | |||
@@ -1,10 +1,22 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const unreadPrivateMessages = Ferdium.safeParseInt($('.messages .unread-meeps').text()); | 9 | const unreadPrivateMessages = Ferdium.safeParseInt( |
4 | const unreadGroupMessages = Ferdium.safeParseInt($('.today .unread-meeps').text()); | 10 | $('.messages .unread-meeps').text(), |
11 | ); | ||
12 | const unreadGroupMessages = Ferdium.safeParseInt( | ||
13 | $('.today .unread-meeps').text(), | ||
14 | ); | ||
5 | 15 | ||
6 | Ferdium.setBadge(unreadPrivateMessages + unreadGroupMessages); | 16 | Ferdium.setBadge(unreadPrivateMessages + unreadGroupMessages); |
7 | }; | 17 | }; |
8 | 18 | ||
9 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 22 | }; |
diff --git a/recipes/pulsesms/LICENSE b/recipes/pulse-sms/LICENSE index 8ac4a22..8ac4a22 100644 --- a/recipes/pulsesms/LICENSE +++ b/recipes/pulse-sms/LICENSE | |||
diff --git a/recipes/pulsesms/icon.svg b/recipes/pulse-sms/icon.svg index da3f9d3..da3f9d3 100644 --- a/recipes/pulsesms/icon.svg +++ b/recipes/pulse-sms/icon.svg | |||
diff --git a/recipes/pulsesms/index.js b/recipes/pulse-sms/index.js index dd41f72..dd41f72 100644 --- a/recipes/pulsesms/index.js +++ b/recipes/pulse-sms/index.js | |||
diff --git a/recipes/pulsesms/package.json b/recipes/pulse-sms/package.json index 786cf8b..8cfdd5f 100644 --- a/recipes/pulsesms/package.json +++ b/recipes/pulse-sms/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pulsesms", | 2 | "id": "pulse-sms", |
3 | "name": "PulseSMS", | 3 | "name": "PulseSMS", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://pulsesms.app", | 7 | "serviceURL": "https://pulsesms.app", |
diff --git a/recipes/pulse-sms/webview.js b/recipes/pulse-sms/webview.js new file mode 100644 index 0000000..e2d7f40 --- /dev/null +++ b/recipes/pulse-sms/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | Ferdium.setBadge( | ||
10 | document.querySelector('#unread_count').textContent.replaceAll(/\s/g, ''), | ||
11 | ); | ||
12 | }; | ||
13 | |||
14 | Ferdium.loop(getMessages); | ||
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
17 | }; | ||
diff --git a/recipes/pulsesms/webview.js b/recipes/pulsesms/webview.js deleted file mode 100644 index 01a2b75..0000000 --- a/recipes/pulsesms/webview.js +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | ||
3 | Ferdium.setBadge( | ||
4 | document.querySelector('#unread_count').textContent.replace(/\s/g, ''), | ||
5 | ); | ||
6 | }; | ||
7 | |||
8 | Ferdium.loop(getMessages); | ||
9 | }; | ||
diff --git a/recipes/pushbullet/package.json b/recipes/pushbullet/package.json index cf27677..5851a2b 100644 --- a/recipes/pushbullet/package.json +++ b/recipes/pushbullet/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pushbullet", | 2 | "id": "pushbullet", |
3 | "name": "Pushbullet", | 3 | "name": "Pushbullet", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.pushbullet.com/" | 7 | "serviceURL": "https://www.pushbullet.com/" |
diff --git a/recipes/pushbullet/webview.js b/recipes/pushbullet/webview.js index 86bb422..2a81dec 100644 --- a/recipes/pushbullet/webview.js +++ b/recipes/pushbullet/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/pushover/package.json b/recipes/pushover/package.json index 9616852..22a9db3 100644 --- a/recipes/pushover/package.json +++ b/recipes/pushover/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pushover", | 2 | "id": "pushover", |
3 | "name": "Pushover", | 3 | "name": "Pushover", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/jdwhite/franz-recipe-pushover", | 6 | "repository": "https://github.com/jdwhite/franz-recipe-pushover", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/pushover/webview.js b/recipes/pushover/webview.js index b37b9e4..30d596b 100644 --- a/recipes/pushover/webview.js +++ b/recipes/pushover/webview.js | |||
@@ -1,12 +1,14 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const totalMessages = document.querySelector('#app_0 > div.app_counter').innerHTML; | 9 | const totalMessages = document.querySelector( |
10 | '#app_0 > div.app_counter', | ||
11 | ).innerHTML; | ||
10 | Ferdium.setBadge(totalMessages); | 12 | Ferdium.setBadge(totalMessages); |
11 | }; | 13 | }; |
12 | 14 | ||
diff --git a/recipes/rainloop/package.json b/recipes/rainloop/package.json index 3c9ce18..3d3b2c4 100644 --- a/recipes/rainloop/package.json +++ b/recipes/rainloop/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "rainloop", | 2 | "id": "rainloop", |
3 | "name": "RainLoop", | 3 | "name": "RainLoop", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "repository": "https://github.com/promarcel/franz-recipe-rainloop", | 5 | "repository": "https://github.com/promarcel/franz-recipe-rainloop", |
6 | "license": "MIT", | 6 | "license": "MIT", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/rainloop/webview.js b/recipes/rainloop/webview.js index 6b0c3d6..0421d54 100644 --- a/recipes/rainloop/webview.js +++ b/recipes/rainloop/webview.js | |||
@@ -1,13 +1,21 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let messages = 0; | 9 | let messages = 0; |
4 | 10 | ||
5 | // Let's only loop through user folders, as all system folders are duplicated there | 11 | // Let's only loop through user folders, as all system folders are duplicated there |
6 | for (const obj of document.querySelectorAll('.b-folders-user .ui-droppable')) { | 12 | for (const obj of document.querySelectorAll( |
13 | '.b-folders-user .ui-droppable', | ||
14 | )) { | ||
7 | const countEl = obj.querySelector('.count'); | 15 | const countEl = obj.querySelector('.count'); |
8 | const countText = countEl ? countEl.innerHTML : ''; | 16 | const countText = countEl ? countEl.innerHTML : ''; |
9 | 17 | ||
10 | if (countText != '') { | 18 | if (countText !== '') { |
11 | if (obj.classList.contains('system')) { | 19 | if (obj.classList.contains('system')) { |
12 | // Only count the Inbox system folder and ignore Archive, Trash, Drafts, Spam, Sent | 20 | // Only count the Inbox system folder and ignore Archive, Trash, Drafts, Spam, Sent |
13 | if (obj.classList.contains('i-am-inbox')) { | 21 | if (obj.classList.contains('i-am-inbox')) { |
@@ -23,4 +31,6 @@ module.exports = Ferdium => { | |||
23 | }; | 31 | }; |
24 | 32 | ||
25 | Ferdium.loop(getMessages); | 33 | Ferdium.loop(getMessages); |
34 | |||
35 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
26 | }; | 36 | }; |
diff --git a/recipes/reclaim/index.js b/recipes/reclaim/index.js index 8244b1b..dd41f72 100644 --- a/recipes/reclaim/index.js +++ b/recipes/reclaim/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdium => Ferdium; \ No newline at end of file | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/reclaim/package.json b/recipes/reclaim/package.json index 5e7df91..9fd5062 100644 --- a/recipes/reclaim/package.json +++ b/recipes/reclaim/package.json | |||
@@ -1,9 +1,9 @@ | |||
1 | { | 1 | { |
2 | "id": "reclaim", | 2 | "id": "reclaim", |
3 | "name": "Reclaim", | 3 | "name": "Reclaim", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.reclaim.ai/" | 7 | "serviceURL": "https://app.reclaim.ai/" |
8 | } | 8 | } |
9 | } \ No newline at end of file | 9 | } |
diff --git a/recipes/reclaim/webview.js b/recipes/reclaim/webview.js index 86bb422..2a81dec 100644 --- a/recipes/reclaim/webview.js +++ b/recipes/reclaim/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/redditchat/icon.svg b/recipes/reddit-chat/icon.svg index 4dad730..4dad730 100644 --- a/recipes/redditchat/icon.svg +++ b/recipes/reddit-chat/icon.svg | |||
diff --git a/recipes/redditchat/index.js b/recipes/reddit-chat/index.js index dd41f72..dd41f72 100644 --- a/recipes/redditchat/index.js +++ b/recipes/reddit-chat/index.js | |||
diff --git a/recipes/redditchat/package.json b/recipes/reddit-chat/package.json index ae79ca7..6d60303 100644 --- a/recipes/redditchat/package.json +++ b/recipes/reddit-chat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "redditchat", | 2 | "id": "reddit-chat", |
3 | "name": "Reddit Chat", | 3 | "name": "Reddit Chat", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.reddit.com/chat/" | 7 | "serviceURL": "https://www.reddit.com/chat/" |
diff --git a/recipes/redditchat/webview.js b/recipes/reddit-chat/webview.js index 6dc736a..7e2ef95 100644 --- a/recipes/redditchat/webview.js +++ b/recipes/reddit-chat/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | // Regular expression for (*) or (1), will extract the asterisk or the number | 8 | // Regular expression for (*) or (1), will extract the asterisk or the number |
3 | const titleRegEx = /^\(([\d*])\)/; | 9 | const titleRegEx = /^\(([\d*])\)/; |
@@ -18,4 +24,6 @@ module.exports = Ferdium => { | |||
18 | }; | 24 | }; |
19 | 25 | ||
20 | Ferdium.loop(getMessages); | 26 | Ferdium.loop(getMessages); |
27 | |||
28 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
21 | }; | 29 | }; |
diff --git a/recipes/reddit/package.json b/recipes/reddit/package.json index 42e4fbc..07b7112 100644 --- a/recipes/reddit/package.json +++ b/recipes/reddit/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "reddit", | 2 | "id": "reddit", |
3 | "name": "Reddit", | 3 | "name": "Reddit", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/ferdium/ferdium-recipes", | 6 | "repository": "https://github.com/ferdium/ferdium-recipes", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/reddit/webview.js b/recipes/reddit/webview.js index e8498ac..aac3766 100644 --- a/recipes/reddit/webview.js +++ b/recipes/reddit/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const elements = document.querySelectorAll( | 9 | const elements = document.querySelectorAll( |
diff --git a/recipes/ringcentral/icon.svg b/recipes/ring-central/icon.svg index e30813e..e30813e 100644 --- a/recipes/ringcentral/icon.svg +++ b/recipes/ring-central/icon.svg | |||
diff --git a/recipes/ringcentral/index.js b/recipes/ring-central/index.js index dd41f72..dd41f72 100644 --- a/recipes/ringcentral/index.js +++ b/recipes/ring-central/index.js | |||
diff --git a/recipes/ringcentral/package.json b/recipes/ring-central/package.json index 9121482..ee21fb3 100644 --- a/recipes/ringcentral/package.json +++ b/recipes/ring-central/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "ringcentral", | 2 | "id": "ring-central", |
3 | "name": "RingCentral", | 3 | "name": "RingCentral", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/deadmeu/ferdi-ringcentral", | 6 | "repository": "https://github.com/deadmeu/ferdi-ringcentral", |
7 | "aliases": [ | 7 | "aliases": [ |
diff --git a/recipes/ringcentral/webview.js b/recipes/ring-central/webview.js index acf1cfa..68a688a 100644 --- a/recipes/ringcentral/webview.js +++ b/recipes/ring-central/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directCount = 0; | 9 | let directCount = 0; |
@@ -16,4 +22,6 @@ module.exports = Ferdium => { | |||
16 | }; | 22 | }; |
17 | 23 | ||
18 | Ferdium.loop(getMessages); | 24 | Ferdium.loop(getMessages); |
25 | |||
26 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
19 | }; | 27 | }; |
diff --git a/recipes/riseup/package.json b/recipes/riseup/package.json index f6ea15b..7dc626e 100644 --- a/recipes/riseup/package.json +++ b/recipes/riseup/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "riseup", | 2 | "id": "riseup", |
3 | "name": "Riseup.net", | 3 | "name": "Riseup.net", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.riseup.net" | 7 | "serviceURL": "https://mail.riseup.net" |
diff --git a/recipes/riseup/webview.js b/recipes/riseup/webview.js index 6f63103..bbf0db6 100644 --- a/recipes/riseup/webview.js +++ b/recipes/riseup/webview.js | |||
@@ -1,12 +1,20 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let unread = 0; | 9 | let unread = 0; |
4 | const notificationBadge = document.querySelectorAll('.unreadcount')[0]; | 10 | const notificationBadge = document.querySelectorAll('.unreadcount')[0]; |
5 | if (notificationBadge != undefined) { | 11 | if (notificationBadge !== undefined) { |
6 | unread = Ferdium.safeParseInt(notificationBadge.textContent); | 12 | unread = Ferdium.safeParseInt(notificationBadge.textContent); |
7 | } | 13 | } |
8 | Ferdium.setBadge(unread); | 14 | Ferdium.setBadge(unread); |
9 | }; | 15 | }; |
10 | 16 | ||
11 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 20 | }; |
diff --git a/recipes/ritetag/index.js b/recipes/ritetag/index.js index 2d59d28..dd41f72 100644 --- a/recipes/ritetag/index.js +++ b/recipes/ritetag/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdium => Ferdium | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/ritetag/package.json b/recipes/ritetag/package.json index fedd05b..33287d7 100644 --- a/recipes/ritetag/package.json +++ b/recipes/ritetag/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "ritetag", | 2 | "id": "ritetag", |
3 | "name": "Ritetag", | 3 | "name": "Ritetag", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/alexdevero/franz-ritetag-recipe", | 6 | "repository": "https://github.com/alexdevero/franz-ritetag-recipe", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/ritetag/webview.js b/recipes/ritetag/webview.js index be6157e..1119219 100644 --- a/recipes/ritetag/webview.js +++ b/recipes/ritetag/webview.js | |||
@@ -1,7 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
7 | }; | 9 | }; |
diff --git a/recipes/rocketchat/index.js b/recipes/rocketchat/index.js index a7fee29..a89bd61 100644 --- a/recipes/rocketchat/index.js +++ b/recipes/rocketchat/index.js | |||
@@ -1,18 +1,19 @@ | |||
1 | module.exports = Ferdium => class RocketChat extends Ferdium { | 1 | module.exports = Ferdium => |
2 | async validateUrl(url) { | 2 | class RocketChat extends Ferdium { |
3 | try { | 3 | async validateUrl(url) { |
4 | const resp = await window.fetch(url, { | 4 | try { |
5 | method: 'GET', | 5 | const resp = await window.fetch(url, { |
6 | headers: { | 6 | method: 'GET', |
7 | 'Content-Type': 'application/json', | 7 | headers: { |
8 | }, | 8 | 'Content-Type': 'application/json', |
9 | }); | 9 | }, |
10 | const status = resp.status.toString(); | 10 | }); |
11 | return status.startsWith('2') || status.startsWith('3'); | 11 | const status = resp.status.toString(); |
12 | } catch (error) { | 12 | return status.startsWith('2') || status.startsWith('3'); |
13 | console.error(error); | 13 | } catch (error) { |
14 | } | 14 | console.error(error); |
15 | } | ||
15 | 16 | ||
16 | return false; | 17 | return false; |
17 | } | 18 | } |
18 | }; | 19 | }; |
diff --git a/recipes/rocketchat/package.json b/recipes/rocketchat/package.json index 17719ed..164cd5f 100644 --- a/recipes/rocketchat/package.json +++ b/recipes/rocketchat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "rocketchat", | 2 | "id": "rocketchat", |
3 | "name": "Rocket.Chat", | 3 | "name": "Rocket.Chat", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.rocket.chat", | 7 | "serviceURL": "https://{teamId}.rocket.chat", |
diff --git a/recipes/rocketchat/webview.js b/recipes/rocketchat/webview.js index 85b0c32..74556de 100644 --- a/recipes/rocketchat/webview.js +++ b/recipes/rocketchat/webview.js | |||
@@ -1,3 +1,8 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
1 | 6 | ||
2 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
3 | const getMessages = () => { | 8 | const getMessages = () => { |
@@ -18,30 +23,34 @@ module.exports = Ferdium => { | |||
18 | 23 | ||
19 | Ferdium.loop(getMessages); | 24 | Ferdium.loop(getMessages); |
20 | 25 | ||
26 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
27 | |||
21 | const getTeamIcon = function getTeamIcon() { | 28 | const getTeamIcon = function getTeamIcon() { |
22 | const manifestElement = document.querySelector('link[rel="manifest"]'); | 29 | const manifestElement = document.querySelector('link[rel="manifest"]'); |
23 | 30 | ||
24 | if (manifestElement == null) { | 31 | if (manifestElement === null) { |
25 | return; | 32 | return; |
26 | } | 33 | } |
27 | 34 | ||
28 | const manifestUrl = manifestElement.getAttribute('href'); | 35 | const manifestUrl = manifestElement.getAttribute('href'); |
29 | 36 | ||
30 | if (manifestUrl == null) { | 37 | if (manifestUrl === null) { |
31 | return; | 38 | return; |
32 | } | 39 | } |
33 | 40 | ||
34 | const xmlhttp = new XMLHttpRequest(); | 41 | const xmlhttp = new XMLHttpRequest(); |
35 | 42 | ||
36 | xmlhttp.addEventListener('readystatechange', function () { | 43 | xmlhttp.addEventListener('readystatechange', function () { |
37 | if (this.readyState != 4 || this.status != 200) { | 44 | if (this.readyState !== 4 || this.status !== 200) { |
38 | return; | 45 | return; |
39 | } | 46 | } |
40 | 47 | ||
41 | const response = JSON.parse(this.responseText); | 48 | const response = JSON.parse(this.responseText); |
42 | 49 | ||
43 | if (response.icons.length > 0) { | 50 | if (response.icons.length > 0) { |
44 | Ferdium.setAvatarImage(`${window.location.protocol}//${window.location.host}${response.icons[0].src}`); | 51 | Ferdium.setAvatarImage( |
52 | `${window.location.protocol}//${window.location.host}${response.icons[0].src}`, | ||
53 | ); | ||
45 | } | 54 | } |
46 | }); | 55 | }); |
47 | 56 | ||
diff --git a/recipes/roundcube/package.json b/recipes/roundcube/package.json index 6378ff8..8ebd52c 100644 --- a/recipes/roundcube/package.json +++ b/recipes/roundcube/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "roundcube", | 2 | "id": "roundcube", |
3 | "name": "Roundcube", | 3 | "name": "Roundcube", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/jonathanjuursema/franz-roundcube", | 6 | "repository": "https://github.com/jonathanjuursema/franz-roundcube", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/roundcube/webview.js b/recipes/roundcube/webview.js index f9aead4..d7f00c5 100644 --- a/recipes/roundcube/webview.js +++ b/recipes/roundcube/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const directElements = document.querySelectorAll('.unreadcount'); | 9 | const directElements = document.querySelectorAll('.unreadcount'); |
@@ -9,4 +15,6 @@ module.exports = Ferdium => { | |||
9 | }; | 15 | }; |
10 | 16 | ||
11 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 20 | }; |
diff --git a/recipes/schildichat/package.json b/recipes/schildichat/package.json index 91ca379..96fcbf9 100644 --- a/recipes/schildichat/package.json +++ b/recipes/schildichat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "schildichat", | 2 | "id": "schildichat", |
3 | "name": "SchildiChat", | 3 | "name": "SchildiChat", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "Element", | 7 | "Element", |
diff --git a/recipes/schildichat/webview.js b/recipes/schildichat/webview.js index bd7eef8..592d89b 100644 --- a/recipes/schildichat/webview.js +++ b/recipes/schildichat/webview.js | |||
@@ -1,14 +1,23 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | function getMessages() { | 8 | function getMessages() { |
3 | const directMatches = document.querySelector('title').textContent | 9 | const directMatches = document |
4 | .match('(?<=\\[)\\d+(?=])'); | 10 | .querySelector('title') |
11 | .textContent.match('(?<=\\[)\\d+(?=])'); | ||
5 | Ferdium.setBadge( | 12 | Ferdium.setBadge( |
6 | Ferdium.safeParseInt(directMatches !== null ? directMatches[0] : 0), | 13 | Ferdium.safeParseInt(directMatches === null ? 0 : directMatches[0]), |
7 | document.querySelector('.mx_SpaceTreeLevel') | 14 | document |
8 | .querySelectorAll('.mx_NotificationBadge_dot') | 15 | .querySelector('.mx_SpaceTreeLevel') |
9 | .length | 16 | .querySelectorAll('.mx_NotificationBadge_dot').length, |
10 | ); | 17 | ); |
11 | } | 18 | } |
12 | 19 | ||
13 | Ferdium.loop(getMessages); | 20 | Ferdium.loop(getMessages); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 23 | }; |
diff --git a/recipes/scribens/package.json b/recipes/scribens/package.json index b993a2c..dad972c 100644 --- a/recipes/scribens/package.json +++ b/recipes/scribens/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "scribens", | 2 | "id": "scribens", |
3 | "name": "Scribens", | 3 | "name": "Scribens", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://scribens.{teamId}", | 7 | "serviceURL": "https://scribens.{teamId}", |
diff --git a/recipes/scribens/webview.js b/recipes/scribens/webview.js index 86bb422..2a81dec 100644 --- a/recipes/scribens/webview.js +++ b/recipes/scribens/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/scrumpy/package.json b/recipes/scrumpy/package.json index c2383b7..cd64d5f 100644 --- a/recipes/scrumpy/package.json +++ b/recipes/scrumpy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "scrumpy", | 2 | "id": "scrumpy", |
3 | "name": "Scrumpy", | 3 | "name": "Scrumpy", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/scrumpy/franz-recipe-scrumpy", | 6 | "repository": "https://github.com/scrumpy/franz-recipe-scrumpy", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/scrumpy/webview.js b/recipes/scrumpy/webview.js index 5037aee..89dd93b 100644 --- a/recipes/scrumpy/webview.js +++ b/recipes/scrumpy/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const notifications = document.querySelector( | 9 | const notifications = document.querySelector( |
@@ -9,4 +15,6 @@ module.exports = Ferdium => { | |||
9 | }; | 15 | }; |
10 | 16 | ||
11 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 20 | }; |
diff --git a/recipes/sendtask/package.json b/recipes/sendtask/package.json index 342a2e6..9cc2ffc 100644 --- a/recipes/sendtask/package.json +++ b/recipes/sendtask/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "sendtask", | 2 | "id": "sendtask", |
3 | "name": "Sendtask", | 3 | "name": "Sendtask", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "repository": "https://github.com/patrickdaniel/sendtask-franz", | 5 | "repository": "https://github.com/patrickdaniel/sendtask-franz", |
6 | "license": "MIT", | 6 | "license": "MIT", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/sendtask/webview.js b/recipes/sendtask/webview.js index bca4e19..678c716 100644 --- a/recipes/sendtask/webview.js +++ b/recipes/sendtask/webview.js | |||
@@ -1,10 +1,14 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const inbox = document.querySelector('.topbar-notificationsButton.has-newNotifications'); | 9 | const inbox = document.querySelector( |
10 | '.topbar-notificationsButton.has-newNotifications', | ||
11 | ); | ||
8 | const passiveCount = inbox === null ? 0 : 1; | 12 | const passiveCount = inbox === null ? 0 : 1; |
9 | Ferdium.setBadge(0, passiveCount); | 13 | Ferdium.setBadge(0, passiveCount); |
10 | }; | 14 | }; |
diff --git a/recipes/simplelogin/package.json b/recipes/simplelogin/package.json index 6d12b3c..6cbdd95 100644 --- a/recipes/simplelogin/package.json +++ b/recipes/simplelogin/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "simplelogin", | 2 | "id": "simplelogin", |
3 | "name": "SimpleLogin", | 3 | "name": "SimpleLogin", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.simplelogin.io/" | 7 | "serviceURL": "https://app.simplelogin.io/" |
diff --git a/recipes/simplelogin/webview.js b/recipes/simplelogin/webview.js index 46366f4..1119219 100644 --- a/recipes/simplelogin/webview.js +++ b/recipes/simplelogin/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/simplenote/package.json b/recipes/simplenote/package.json index 00e0fb0..13d3573 100644 --- a/recipes/simplenote/package.json +++ b/recipes/simplenote/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "simplenote", | 2 | "id": "simplenote", |
3 | "name": "Simplenote", | 3 | "name": "Simplenote", |
4 | "version": "1.2.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.simplenote.com/" | 7 | "serviceURL": "https://app.simplenote.com/" |
diff --git a/recipes/simplenote/webview.js b/recipes/simplenote/webview.js index b4180e4..f09170c 100644 --- a/recipes/simplenote/webview.js +++ b/recipes/simplenote/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -19,4 +25,6 @@ module.exports = Ferdium => { | |||
19 | }; | 25 | }; |
20 | 26 | ||
21 | Ferdium.loop(getMessages); | 27 | Ferdium.loop(getMessages); |
28 | |||
29 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | 30 | }; |
diff --git a/recipes/skiff-mail/package.json b/recipes/skiff-mail/package.json index 1193c82..02e73a9 100644 --- a/recipes/skiff-mail/package.json +++ b/recipes/skiff-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "skiff-mail", | 2 | "id": "skiff-mail", |
3 | "name": "Skiff Mail", | 3 | "name": "Skiff Mail", |
4 | "version": "1.0.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.skiff.com/mail/inbox" | 7 | "serviceURL": "https://app.skiff.com/mail/inbox" |
diff --git a/recipes/skiff-mail/webview.js b/recipes/skiff-mail/webview.js index 522b062..2726145 100644 --- a/recipes/skiff-mail/webview.js +++ b/recipes/skiff-mail/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const element = document.querySelector('div[href="/mail/inbox"]'); | 9 | const element = document.querySelector('div[href="/mail/inbox"]'); |
diff --git a/recipes/skype/index.js b/recipes/skype/index.js index 425683a..0f18b4f 100644 --- a/recipes/skype/index.js +++ b/recipes/skype/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = (Ferdium) => class Messenger extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Messenger extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/skype/package.json b/recipes/skype/package.json index 18d5b37..32fcef9 100644 --- a/recipes/skype/package.json +++ b/recipes/skype/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "skype", | 2 | "id": "skype", |
3 | "name": "Skype", | 3 | "name": "Skype", |
4 | "version": "3.5.4", | 4 | "version": "3.6.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.skype.com/", | 7 | "serviceURL": "https://web.skype.com/", |
diff --git a/recipes/skype/webview-unsafe.js b/recipes/skype/webview-unsafe.js index 28f5e0e..a782464 100644 --- a/recipes/skype/webview-unsafe.js +++ b/recipes/skype/webview-unsafe.js | |||
@@ -1,4 +1,7 @@ | |||
1 | const nameDescriptor = Object.getOwnPropertyDescriptor(Plugin.prototype, 'name'); | 1 | const nameDescriptor = Object.getOwnPropertyDescriptor( |
2 | Plugin.prototype, | ||
3 | 'name', | ||
4 | ); | ||
2 | const getName = nameDescriptor.get; | 5 | const getName = nameDescriptor.get; |
3 | Object.defineProperty(Plugin.prototype, 'name', { | 6 | Object.defineProperty(Plugin.prototype, 'name', { |
4 | ...nameDescriptor, | 7 | ...nameDescriptor, |
diff --git a/recipes/skype/webview.js b/recipes/skype/webview.js index db97d98..45bc005 100644 --- a/recipes/skype/webview.js +++ b/recipes/skype/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
@@ -8,13 +10,16 @@ module.exports = (Ferdium, settings) => { | |||
8 | const container = document.querySelector('[role="tablist"] > button > div'); | 10 | const container = document.querySelector('[role="tablist"] > button > div'); |
9 | 11 | ||
10 | if (container) { | 12 | if (container) { |
11 | const children = container.children; | 13 | const { children } = container; |
12 | 14 | ||
13 | if (children.length === 3) { | 15 | if (children.length === 3) { |
16 | // eslint-disable-next-line unicorn/prefer-at | ||
14 | const elementContainer = children[children.length - 1]; | 17 | const elementContainer = children[children.length - 1]; |
15 | 18 | ||
16 | if (elementContainer) { | 19 | if (elementContainer) { |
17 | const element = elementContainer.querySelector('[data-text-as-pseudo-element]'); | 20 | const element = elementContainer.querySelector( |
21 | '[data-text-as-pseudo-element]', | ||
22 | ); | ||
18 | if (element && element.dataset) { | 23 | if (element && element.dataset) { |
19 | count = Ferdium.safeParseInt(element.dataset.textAsPseudoElement); | 24 | count = Ferdium.safeParseInt(element.dataset.textAsPseudoElement); |
20 | } | 25 | } |
@@ -31,21 +36,27 @@ module.exports = (Ferdium, settings) => { | |||
31 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 36 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
32 | 37 | ||
33 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences | 38 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences |
34 | document.addEventListener('click', event => { | 39 | document.addEventListener( |
35 | const link = event.target.closest('a[href^="http"]'); | 40 | 'click', |
36 | const button = event.target.closest('button[title^="http"]'); | 41 | event => { |
37 | 42 | const link = event.target.closest('a[href^="http"]'); | |
38 | if (link || button) { | 43 | const button = event.target.closest('button[title^="http"]'); |
39 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); | 44 | |
40 | 45 | if (link || button) { | |
41 | event.preventDefault(); | 46 | const url = link |
42 | event.stopPropagation(); | 47 | ? link.getAttribute('href') |
43 | 48 | : button.getAttribute('title'); | |
44 | if (settings.trapLinkClicks === true) { | 49 | |
45 | window.location.href = url; | 50 | event.preventDefault(); |
46 | } else { | 51 | event.stopPropagation(); |
47 | Ferdium.openNewWindow(url); | 52 | |
53 | if (settings.trapLinkClicks === true) { | ||
54 | window.location.href = url; | ||
55 | } else { | ||
56 | Ferdium.openNewWindow(url); | ||
57 | } | ||
48 | } | 58 | } |
49 | } | 59 | }, |
50 | }, true); | 60 | true, |
61 | ); | ||
51 | }; | 62 | }; |
diff --git a/recipes/slack/package.json b/recipes/slack/package.json index 9105f31..99e3559 100644 --- a/recipes/slack/package.json +++ b/recipes/slack/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "slack", | 2 | "id": "slack", |
3 | "name": "Slack", | 3 | "name": "Slack", |
4 | "version": "1.4.2", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.slack.com", | 7 | "serviceURL": "https://{teamId}.slack.com", |
diff --git a/recipes/slack/webview.js b/recipes/slack/webview.js index b3722f0..bd28ba9 100644 --- a/recipes/slack/webview.js +++ b/recipes/slack/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | const SELECTOR_CHANNELS_UNREAD = | 7 | const SELECTOR_CHANNELS_UNREAD = |
8 | '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)'; | 8 | '.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)'; |
9 | 9 | ||
diff --git a/recipes/slite/package.json b/recipes/slite/package.json index 6ed9773..8e97183 100644 --- a/recipes/slite/package.json +++ b/recipes/slite/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "slite", | 2 | "id": "slite", |
3 | "name": "Slite", | 3 | "name": "Slite", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.slite.com", | 7 | "serviceURL": "https://{teamId}.slite.com", |
diff --git a/recipes/slite/webview.js b/recipes/slite/webview.js index cb0bebf..5c3985f 100644 --- a/recipes/slite/webview.js +++ b/recipes/slite/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const element = document.querySelector( | 9 | const element = document.querySelector( |
@@ -7,4 +13,6 @@ module.exports = Ferdium => { | |||
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/slowly/package.json b/recipes/slowly/package.json index 13b9c23..302388c 100644 --- a/recipes/slowly/package.json +++ b/recipes/slowly/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "slowly", | 2 | "id": "slowly", |
3 | "name": "Slowly", | 3 | "name": "Slowly", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/BerakaStudio/franz-slowly", | 6 | "repository": "https://github.com/BerakaStudio/franz-slowly", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/slowly/webview.js b/recipes/slowly/webview.js index 86bb422..2a81dec 100644 --- a/recipes/slowly/webview.js +++ b/recipes/slowly/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/smartsheet/package.json b/recipes/smartsheet/package.json index aa19e96..8595e1f 100644 --- a/recipes/smartsheet/package.json +++ b/recipes/smartsheet/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "smartsheet", | 2 | "id": "smartsheet", |
3 | "name": "SmartSheet", | 3 | "name": "SmartSheet", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.smartsheet.com" | 7 | "serviceURL": "https://app.smartsheet.com" |
diff --git a/recipes/smartsheet/webview.js b/recipes/smartsheet/webview.js index 56a20b6..1119219 100644 --- a/recipes/smartsheet/webview.js +++ b/recipes/smartsheet/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/snapchat/package.json b/recipes/snapchat/package.json index e7c9408..0c96faa 100644 --- a/recipes/snapchat/package.json +++ b/recipes/snapchat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "snapchat", | 2 | "id": "snapchat", |
3 | "name": "Snapchat", | 3 | "name": "Snapchat", |
4 | "version": "1.1.1", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.snapchat.com/" | 7 | "serviceURL": "https://web.snapchat.com/" |
diff --git a/recipes/snapchat/webview.js b/recipes/snapchat/webview.js index 78a2455..352b012 100644 --- a/recipes/snapchat/webview.js +++ b/recipes/snapchat/webview.js | |||
@@ -1,13 +1,13 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const title = document.querySelector('title').textContent.match(/\d+/); | 9 | const title = document.querySelector('title').textContent.match(/\d+/); |
10 | const count = title !== null ? title[0] : 0; | 10 | const count = title === null ? 0 : title[0]; |
11 | 11 | ||
12 | Ferdium.setBadge(count); | 12 | Ferdium.setBadge(count); |
13 | }; | 13 | }; |
diff --git a/recipes/snapdrop/index.js b/recipes/snapdrop/index.js index f0797ea..4e126b1 100644 --- a/recipes/snapdrop/index.js +++ b/recipes/snapdrop/index.js | |||
@@ -1,15 +1,17 @@ | |||
1 | module.exports = (Ferdium) => class Snapdrop extends Ferdium { | 1 | module.exports = Ferdium => |
2 | modifyRequestHeaders() { | 2 | class Snapdrop extends Ferdium { |
3 | return [ | 3 | modifyRequestHeaders() { |
4 | { | 4 | return [ |
5 | headers: { | 5 | { |
6 | // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdium | 6 | headers: { |
7 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', | 7 | // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdium |
8 | 'user-agent': | ||
9 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', | ||
10 | }, | ||
11 | requestFilters: { | ||
12 | urls: ['*://*/*'], | ||
13 | }, | ||
8 | }, | 14 | }, |
9 | requestFilters: { | 15 | ]; |
10 | urls: ['*://*/*'], | 16 | } |
11 | }, | 17 | }; |
12 | }, | ||
13 | ]; | ||
14 | } | ||
15 | }; | ||
diff --git a/recipes/snapdrop/package.json b/recipes/snapdrop/package.json index a9c96fd..1285642 100644 --- a/recipes/snapdrop/package.json +++ b/recipes/snapdrop/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "snapdrop", | 2 | "id": "snapdrop", |
3 | "name": "Snapdrop", | 3 | "name": "Snapdrop", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "http://snapdrop.net/", | 7 | "serviceURL": "http://snapdrop.net/", |
diff --git a/recipes/snapdrop/webview.js b/recipes/snapdrop/webview.js index 86bb422..2a81dec 100644 --- a/recipes/snapdrop/webview.js +++ b/recipes/snapdrop/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/sococo/package.json b/recipes/sococo/package.json index 3f9f7f0..000f986 100644 --- a/recipes/sococo/package.json +++ b/recipes/sococo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "sococo", | 2 | "id": "sococo", |
3 | "name": "Sococo", | 3 | "name": "Sococo", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/klcodanr/recipe-sococo", | 6 | "repository": "https://github.com/klcodanr/recipe-sococo", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/sococo/webview.js b/recipes/sococo/webview.js index c1e6326..44b258d 100644 --- a/recipes/sococo/webview.js +++ b/recipes/sococo/webview.js | |||
@@ -1,6 +1,12 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let indirect = document.querySelectorAll('.new-messages'); | 9 | const indirect = document.querySelectorAll('.new-messages'); |
4 | let direct = 0; | 10 | let direct = 0; |
5 | for (const badge of document.querySelectorAll('.people-pane .badge')) { | 11 | for (const badge of document.querySelectorAll('.people-pane .badge')) { |
6 | direct += Ferdium.safeParseInt(badge.textContent); | 12 | direct += Ferdium.safeParseInt(badge.textContent); |
@@ -9,4 +15,6 @@ module.exports = Ferdium => { | |||
9 | }; | 15 | }; |
10 | 16 | ||
11 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
12 | }; | 20 | }; |
diff --git a/recipes/stackexchange/package.json b/recipes/stackexchange/package.json index 2a57d10..60c5585 100644 --- a/recipes/stackexchange/package.json +++ b/recipes/stackexchange/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "stackexchange", | 2 | "id": "stackexchange", |
3 | "name": "StackExchange", | 3 | "name": "StackExchange", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://stackexchange.com/" | 7 | "serviceURL": "https://stackexchange.com/" |
diff --git a/recipes/stackexchange/webview.js b/recipes/stackexchange/webview.js index 86bb422..2a81dec 100644 --- a/recipes/stackexchange/webview.js +++ b/recipes/stackexchange/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/stackoverflow-chat/package.json b/recipes/stackoverflow-chat/package.json index a291593..14ff835 100644 --- a/recipes/stackoverflow-chat/package.json +++ b/recipes/stackoverflow-chat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "stackoverflow-chat", | 2 | "id": "stackoverflow-chat", |
3 | "name": "Stack Overflow Chat", | 3 | "name": "Stack Overflow Chat", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://chat.stackoverflow.com/", | 7 | "serviceURL": "https://chat.stackoverflow.com/", |
diff --git a/recipes/stackoverflow-chat/webview.js b/recipes/stackoverflow-chat/webview.js index aa5bde6..c600a65 100644 --- a/recipes/stackoverflow-chat/webview.js +++ b/recipes/stackoverflow-chat/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const unreadSpan = document.querySelector( | 9 | const unreadSpan = document.querySelector( |
@@ -10,4 +16,6 @@ module.exports = Ferdium => { | |||
10 | Ferdium.setBadge(directCount); | 16 | Ferdium.setBadge(directCount); |
11 | }; | 17 | }; |
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/stackoverflow/package.json b/recipes/stackoverflow/package.json index 747bfb8..ca91bb0 100644 --- a/recipes/stackoverflow/package.json +++ b/recipes/stackoverflow/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "stackoverflow", | 2 | "id": "stackoverflow", |
3 | "name": "Stack Overflow", | 3 | "name": "Stack Overflow", |
4 | "version": "0.1.0", | 4 | "version": "0.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/christianascone/franz-recipe-stackoverflow", | 6 | "repository": "https://github.com/christianascone/franz-recipe-stackoverflow", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/stackoverflow/webview.js b/recipes/stackoverflow/webview.js index 0da8914..f9de87a 100644 --- a/recipes/stackoverflow/webview.js +++ b/recipes/stackoverflow/webview.js | |||
@@ -1,8 +1,10 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const elements = document.querySelectorAll('.CxUIE, .unread'); | 9 | const elements = document.querySelectorAll('.CxUIE, .unread'); |
8 | let count = 0; | 10 | let count = 0; |
diff --git a/recipes/standardnotes/package.json b/recipes/standardnotes/package.json index 8d3ce8b..fb4a287 100755 --- a/recipes/standardnotes/package.json +++ b/recipes/standardnotes/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "standardnotes", | 2 | "id": "standardnotes", |
3 | "name": "StandardNotes", | 3 | "name": "StandardNotes", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/vantezzen/franz-recipe-standardnotes", | 6 | "repository": "https://github.com/vantezzen/franz-recipe-standardnotes", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/standardnotes/webview.js b/recipes/standardnotes/webview.js index 86bb422..2a81dec 100644 --- a/recipes/standardnotes/webview.js +++ b/recipes/standardnotes/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/steamchat/index.js b/recipes/steamchat/index.js index 7edfda5..3b3a28a 100644 --- a/recipes/steamchat/index.js +++ b/recipes/steamchat/index.js | |||
@@ -1,5 +1,8 @@ | |||
1 | module.exports = (Ferdium) => class SteamChat extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class SteamChat extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | }; | 5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') |
6 | .trim(); | ||
7 | } | ||
8 | }; | ||
diff --git a/recipes/steamchat/package.json b/recipes/steamchat/package.json index 9123671..2f37026 100644 --- a/recipes/steamchat/package.json +++ b/recipes/steamchat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "steamchat", | 2 | "id": "steamchat", |
3 | "name": "SteamChat", | 3 | "name": "SteamChat", |
4 | "version": "1.4.3", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://steamcommunity.com/chat", | 7 | "serviceURL": "https://steamcommunity.com/chat", |
diff --git a/recipes/steamchat/webview.js b/recipes/steamchat/webview.js index 9cb6d64..3385423 100644 --- a/recipes/steamchat/webview.js +++ b/recipes/steamchat/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // get new msg count | 9 | // get new msg count |
@@ -30,13 +36,19 @@ module.exports = (Ferdium, settings) => { | |||
30 | 36 | ||
31 | Ferdium.loop(getMessages); | 37 | Ferdium.loop(getMessages); |
32 | 38 | ||
39 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
40 | |||
33 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences | 41 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences |
34 | document.addEventListener('click', event => { | 42 | document.addEventListener( |
35 | const link = event.target.closest('a[href^="http"]'); | 43 | 'click', |
36 | const button = event.target.closest('button[title^="http"]'); | 44 | event => { |
45 | const link = event.target.closest('a[href^="http"]'); | ||
46 | const button = event.target.closest('button[title^="http"]'); | ||
37 | 47 | ||
38 | if (link || button) { | 48 | if (link || button) { |
39 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); | 49 | const url = link |
50 | ? link.getAttribute('href') | ||
51 | : button.getAttribute('title'); | ||
40 | 52 | ||
41 | event.preventDefault(); | 53 | event.preventDefault(); |
42 | event.stopPropagation(); | 54 | event.stopPropagation(); |
@@ -46,6 +58,8 @@ module.exports = (Ferdium, settings) => { | |||
46 | } else { | 58 | } else { |
47 | Ferdium.openNewWindow(url); | 59 | Ferdium.openNewWindow(url); |
48 | } | 60 | } |
49 | } | 61 | } |
50 | }, true); | 62 | }, |
63 | true, | ||
64 | ); | ||
51 | }; | 65 | }; |
diff --git a/recipes/stride/package.json b/recipes/stride/package.json index d3dcb60..1405005 100644 --- a/recipes/stride/package.json +++ b/recipes/stride/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "stride", | 2 | "id": "stride", |
3 | "name": "Stride", | 3 | "name": "Stride", |
4 | "version": "1.3.1", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.stride.com", | 7 | "serviceURL": "https://app.stride.com", |
diff --git a/recipes/stride/webview.js b/recipes/stride/webview.js index 3ab132d..dc2edd4 100644 --- a/recipes/stride/webview.js +++ b/recipes/stride/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
@@ -16,7 +18,7 @@ module.exports = Ferdium => { | |||
16 | directCount += Math.max(1, +item.dataset.count); | 18 | directCount += Math.max(1, +item.dataset.count); |
17 | } else { | 19 | } else { |
18 | // this will be the case for indirect messages | 20 | // this will be the case for indirect messages |
19 | indirectCount++; | 21 | indirectCount += 1; |
20 | } | 22 | } |
21 | } | 23 | } |
22 | 24 | ||
diff --git a/recipes/superhuman/index.js b/recipes/superhuman/index.js index 3cae124..c2d4bee 100644 --- a/recipes/superhuman/index.js +++ b/recipes/superhuman/index.js | |||
@@ -1,6 +1,7 @@ | |||
1 | module.exports = Ferdium => class SuperHuman extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class SuperHuman extends Ferdium { |
3 | // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdium | 3 | overrideUserAgent() { |
4 | return 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'; | 4 | // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdium |
5 | } | 5 | return 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'; |
6 | }; | 6 | } |
7 | }; | ||
diff --git a/recipes/superhuman/package.json b/recipes/superhuman/package.json index e4ea8ab..37283d8 100644 --- a/recipes/superhuman/package.json +++ b/recipes/superhuman/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "superhuman", | 2 | "id": "superhuman", |
3 | "name": "Superhuman", | 3 | "name": "Superhuman", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/CrystalLarsh/franz-superhuman-recipe", | 6 | "repository": "https://github.com/CrystalLarsh/franz-superhuman-recipe", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/superhuman/webview.js b/recipes/superhuman/webview.js index 0652545..6778fcd 100644 --- a/recipes/superhuman/webview.js +++ b/recipes/superhuman/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const mentions = document.querySelectorAll('.chat-line .mentioned').length; | 9 | const mentions = document.querySelectorAll('.chat-line .mentioned').length; |
4 | Ferdium.setBadge(mentions, 0); | 10 | Ferdium.setBadge(mentions, 0); |
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/sync/package.json b/recipes/sync/package.json index f14f4e9..caf777b 100644 --- a/recipes/sync/package.json +++ b/recipes/sync/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "sync", | 2 | "id": "sync", |
3 | "name": "Sync", | 3 | "name": "Sync", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://cp.sync.com/files/" | 7 | "serviceURL": "https://cp.sync.com/files/" |
diff --git a/recipes/sync/webview.js b/recipes/sync/webview.js index 86bb422..2a81dec 100644 --- a/recipes/sync/webview.js +++ b/recipes/sync/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/tawk/package.json b/recipes/tawk/package.json index 8e7e10b..7b71411 100644 --- a/recipes/tawk/package.json +++ b/recipes/tawk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tawk", | 2 | "id": "tawk", |
3 | "name": "Tawk.to", | 3 | "name": "Tawk.to", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://dashboard.tawk.to/", | 7 | "serviceURL": "https://dashboard.tawk.to/", |
diff --git a/recipes/tawk/webview.js b/recipes/tawk/webview.js index 86bb422..2a81dec 100644 --- a/recipes/tawk/webview.js +++ b/recipes/tawk/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/tchap/index.js b/recipes/tchap/index.js index 8244b1b..dd41f72 100644 --- a/recipes/tchap/index.js +++ b/recipes/tchap/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdium => Ferdium; \ No newline at end of file | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/tchap/package.json b/recipes/tchap/package.json index a9425fc..cff6893 100644 --- a/recipes/tchap/package.json +++ b/recipes/tchap/package.json | |||
@@ -1,10 +1,10 @@ | |||
1 | { | 1 | { |
2 | "id": "tchap", | 2 | "id": "tchap", |
3 | "name": "Tchap", | 3 | "name": "Tchap", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/Sykursen/recipe-tchap/", | 6 | "repository": "https://github.com/Sykursen/recipe-tchap/", |
7 | "config": { | 7 | "config": { |
8 | "serviceURL": "https://www.tchap.gouv.fr/" | 8 | "serviceURL": "https://www.tchap.gouv.fr/" |
9 | } | 9 | } |
10 | } \ No newline at end of file | 10 | } |
diff --git a/recipes/tchap/webview.js b/recipes/tchap/webview.js index bc24fe6..cd5b4a5 100644 --- a/recipes/tchap/webview.js +++ b/recipes/tchap/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = document.querySelector('.mx_RoomSubList_badge').innerHTML | 9 | const count = document.querySelector('.mx_RoomSubList_badge').innerHTML; |
4 | Ferdium.setBadge(count); | 10 | Ferdium.setBadge(count); |
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
8 | }; \ No newline at end of file | 14 | |
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
16 | }; | ||
diff --git a/recipes/teamleader/package.json b/recipes/teamleader/package.json index 0b1fe52..5fc94c3 100644 --- a/recipes/teamleader/package.json +++ b/recipes/teamleader/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "teamleader", | 2 | "id": "teamleader", |
3 | "name": "teamleader", | 3 | "name": "teamleader", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.teamleader.eu/?gotologin", | 7 | "serviceURL": "https://app.teamleader.eu/?gotologin", |
diff --git a/recipes/teamleader/webview.js b/recipes/teamleader/webview.js index f530549..422af5e 100644 --- a/recipes/teamleader/webview.js +++ b/recipes/teamleader/webview.js | |||
@@ -1,35 +1,33 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let notifications = 0; | 9 | let notifications = 0; |
10 | let indirectNotifications = 0; | 10 | let indirectNotifications = 0; |
11 | 11 | ||
12 | const notification_element = document.querySelector( | 12 | const notificationElement = document.querySelector('#notifications_amount'); |
13 | '#notifications_amount', | 13 | const ticketElement = document.querySelector( |
14 | ); | ||
15 | const ticket_element = document.querySelector( | ||
16 | "a[href='tickets.php'] > span", | 14 | "a[href='tickets.php'] > span", |
17 | ); | 15 | ); |
18 | const call_element = document.querySelector('#queue_amount'); | 16 | const callElement = document.querySelector('#queue_amount'); |
19 | 17 | ||
20 | if (notification_element) { | 18 | if (notificationElement) { |
21 | notifications = Ferdium.safeParseInt( | 19 | notifications = Ferdium.safeParseInt( |
22 | notification_element.getAttribute('datacount'), | 20 | notificationElement.getAttribute('datacount'), |
23 | ); | 21 | ); |
24 | } | 22 | } |
25 | 23 | ||
26 | if (ticket_element != null) { | 24 | if (ticketElement !== null) { |
27 | indirectNotifications = Ferdium.safeParseInt(ticket_element.textContent); | 25 | indirectNotifications = Ferdium.safeParseInt(ticketElement.textContent); |
28 | } | 26 | } |
29 | 27 | ||
30 | if (call_element) { | 28 | if (callElement) { |
31 | indirectNotifications += Ferdium.safeParseInt( | 29 | indirectNotifications += Ferdium.safeParseInt( |
32 | call_element.getAttribute('datacount'), | 30 | callElement.getAttribute('datacount'), |
33 | ); | 31 | ); |
34 | } | 32 | } |
35 | 33 | ||
diff --git a/recipes/teamweek/package.json b/recipes/teamweek/package.json index 881cc89..a9ce0f6 100644 --- a/recipes/teamweek/package.json +++ b/recipes/teamweek/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "teamweek", | 2 | "id": "teamweek", |
3 | "name": "Teamweek", | 3 | "name": "Teamweek", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/claudiupelmus/recipe-teamweek", | 6 | "repository": "https://github.com/claudiupelmus/recipe-teamweek", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/teamweek/webview.js b/recipes/teamweek/webview.js index 86bb422..2a81dec 100644 --- a/recipes/teamweek/webview.js +++ b/recipes/teamweek/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/teamwork-projects/package.json b/recipes/teamwork-projects/package.json index 02e89b9..56ce605 100644 --- a/recipes/teamwork-projects/package.json +++ b/recipes/teamwork-projects/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "teamwork-projects", | 2 | "id": "teamwork-projects", |
3 | "name": "Teamwork Projects", | 3 | "name": "Teamwork Projects", |
4 | "version": "0.3.0", | 4 | "version": "0.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.teamwork.com/", | 7 | "serviceURL": "https://{teamId}.teamwork.com/", |
diff --git a/recipes/teamwork-projects/webview.js b/recipes/teamwork-projects/webview.js index ca3df22..fa885bb 100644 --- a/recipes/teamwork-projects/webview.js +++ b/recipes/teamwork-projects/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let indirectCount = 0; | 9 | let indirectCount = 0; |
@@ -11,4 +17,6 @@ module.exports = Ferdium => { | |||
11 | }; | 17 | }; |
12 | 18 | ||
13 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
14 | }; | 22 | }; |
diff --git a/recipes/telegram/package.json b/recipes/telegram/package.json index 31fc71d..ba4da14 100644 --- a/recipes/telegram/package.json +++ b/recipes/telegram/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "telegram", | 2 | "id": "telegram", |
3 | "name": "Telegram", | 3 | "name": "Telegram", |
4 | "version": "3.3.7", | 4 | "version": "3.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.telegram.org", | 7 | "serviceURL": "https://web.telegram.org", |
diff --git a/recipes/telegram/webview.js b/recipes/telegram/webview.js index ee9e803..5a12adb 100644 --- a/recipes/telegram/webview.js +++ b/recipes/telegram/webview.js | |||
@@ -1,13 +1,11 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
8 | const telegramVersion = document | 8 | const telegramVersion = document.querySelector('meta[property="og:url"]')?.getAttribute('content'); |
9 | .querySelector('meta[property="og:url"]') | ||
10 | ?.getAttribute('content'); | ||
11 | 9 | ||
12 | const isWebK = telegramVersion?.includes('/k/'); | 10 | const isWebK = telegramVersion?.includes('/k/'); |
13 | 11 | ||
diff --git a/recipes/thelounge/package.json b/recipes/thelounge/package.json index f5dc06f..ef43758 100644 --- a/recipes/thelounge/package.json +++ b/recipes/thelounge/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "thelounge", | 2 | "id": "thelounge", |
3 | "name": "The Lounge", | 3 | "name": "The Lounge", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true, | 7 | "hasCustomUrl": true, |
diff --git a/recipes/thelounge/webview.js b/recipes/thelounge/webview.js index 5d3dbb7..9be0862 100644 --- a/recipes/thelounge/webview.js +++ b/recipes/thelounge/webview.js | |||
@@ -1,10 +1,15 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
1 | 6 | ||
2 | function countsOfUnreadMessagesAfterMarker(unreadMarker) { | 7 | function countsOfUnreadMessagesAfterMarker(unreadMarker) { |
3 | var children = unreadMarker.parentElement.childNodes; | 8 | const children = unreadMarker.parentElement.childNodes; |
4 | var unread = 0; | 9 | let unread = 0; |
5 | var unreadHighlighted = 0; | 10 | let unreadHighlighted = 0; |
6 | 11 | ||
7 | for(var i = children.length-1; i >= 0; --i) { | 12 | for (let i = children.length - 1; i >= 0; i -= 1) { |
8 | if (children[i] === unreadMarker) { | 13 | if (children[i] === unreadMarker) { |
9 | break; | 14 | break; |
10 | } | 15 | } |
@@ -14,10 +19,10 @@ function countsOfUnreadMessagesAfterMarker(unreadMarker) { | |||
14 | } | 19 | } |
15 | 20 | ||
16 | if (children[i].classList.contains('msg')) { | 21 | if (children[i].classList.contains('msg')) { |
17 | unread++; | 22 | unread += 1; |
18 | 23 | ||
19 | if (children[i].classList.contains('highlight')) { | 24 | if (children[i].classList.contains('highlight')) { |
20 | unreadHighlighted++; | 25 | unreadHighlighted += 1; |
21 | } | 26 | } |
22 | } | 27 | } |
23 | } | 28 | } |
@@ -26,8 +31,8 @@ function countsOfUnreadMessagesAfterMarker(unreadMarker) { | |||
26 | } | 31 | } |
27 | 32 | ||
28 | module.exports = Ferdium => { | 33 | module.exports = Ferdium => { |
29 | var unreadMessagesAtLastActivity = 0; | 34 | let unreadMessagesAtLastActivity = 0; |
30 | var unreadHighlightedMessagesAtLastActivity = 0; | 35 | let unreadHighlightedMessagesAtLastActivity = 0; |
31 | 36 | ||
32 | const getMessages = () => { | 37 | const getMessages = () => { |
33 | // In order to get a correct tally of unread messages, we must | 38 | // In order to get a correct tally of unread messages, we must |
@@ -37,7 +42,7 @@ module.exports = Ferdium => { | |||
37 | // messages that arrived before or while the app has focus. | 42 | // messages that arrived before or while the app has focus. |
38 | 43 | ||
39 | let direct = 0; | 44 | let direct = 0; |
40 | var directElements = document.querySelectorAll('.badge.highlight'); | 45 | const directElements = document.querySelectorAll('.badge.highlight'); |
41 | 46 | ||
42 | for (const directElement of directElements) { | 47 | for (const directElement of directElements) { |
43 | if (directElement.textContent.length > 0) { | 48 | if (directElement.textContent.length > 0) { |
@@ -51,16 +56,16 @@ module.exports = Ferdium => { | |||
51 | ); | 56 | ); |
52 | for (const indirectElement of indirectElements) { | 57 | for (const indirectElement of indirectElements) { |
53 | if (indirectElement.textContent.length > 0) { | 58 | if (indirectElement.textContent.length > 0) { |
54 | indirect++; | 59 | indirect += 1; |
55 | } | 60 | } |
56 | } | 61 | } |
57 | 62 | ||
58 | const unreadMarkers = document.querySelectorAll('div.unread-marker'); | 63 | const unreadMarkers = document.querySelectorAll('div.unread-marker'); |
59 | 64 | ||
60 | if (unreadMarkers.length > 0) { | 65 | if (unreadMarkers.length > 0) { |
61 | var counts = countsOfUnreadMessagesAfterMarker(unreadMarkers[0]); | 66 | const counts = countsOfUnreadMessagesAfterMarker(unreadMarkers[0]); |
62 | var unread = counts[0]; | 67 | const unread = counts[0]; |
63 | var unreadHighlighted = counts[1]; | 68 | const unreadHighlighted = counts[1]; |
64 | 69 | ||
65 | if (document.hasFocus()) { | 70 | if (document.hasFocus()) { |
66 | unreadMessagesAtLastActivity = unread; | 71 | unreadMessagesAtLastActivity = unread; |
@@ -68,10 +73,13 @@ module.exports = Ferdium => { | |||
68 | } | 73 | } |
69 | 74 | ||
70 | if (unread > unreadMessagesAtLastActivity) { | 75 | if (unread > unreadMessagesAtLastActivity) { |
71 | if (unreadHighlighted > 0 && unreadHighlighted > unreadHighlightedMessagesAtLastActivity) { | 76 | if ( |
72 | direct += (unreadHighlighted - unreadHighlightedMessagesAtLastActivity); | 77 | unreadHighlighted > 0 && |
78 | unreadHighlighted > unreadHighlightedMessagesAtLastActivity | ||
79 | ) { | ||
80 | direct += unreadHighlighted - unreadHighlightedMessagesAtLastActivity; | ||
73 | } else { | 81 | } else { |
74 | indirect++; | 82 | indirect += 1; |
75 | } | 83 | } |
76 | } | 84 | } |
77 | } else { | 85 | } else { |
@@ -84,8 +92,9 @@ module.exports = Ferdium => { | |||
84 | 92 | ||
85 | Ferdium.loop(getMessages); | 93 | Ferdium.loop(getMessages); |
86 | 94 | ||
95 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
96 | |||
87 | // We need to monkey patch ServierWorker.postMessage so that notifications | 97 | // We need to monkey patch ServierWorker.postMessage so that notifications |
88 | // will work, and that needs to be done without context isolation: | 98 | // will work, and that needs to be done without context isolation: |
89 | const path = require('path'); | 99 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
90 | Ferdium.injectJSUnsafe(path.join(__dirname, 'webview-unsafe.js')); | ||
91 | }; | 100 | }; |
diff --git a/recipes/threema/package.json b/recipes/threema/package.json index 5424f60..779e96f 100644 --- a/recipes/threema/package.json +++ b/recipes/threema/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "threema", | 2 | "id": "threema", |
3 | "name": "Threema", | 3 | "name": "Threema", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/Arany/franz-recipe-threema", | 6 | "repository": "https://github.com/Arany/franz-recipe-threema", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/threema/webview.js b/recipes/threema/webview.js index 16eb20a..272fec0 100644 --- a/recipes/threema/webview.js +++ b/recipes/threema/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const elements = document.querySelectorAll( | 9 | const elements = document.querySelectorAll( |
diff --git a/recipes/tick/package.json b/recipes/tick/package.json index 2c1356f..11076a8 100644 --- a/recipes/tick/package.json +++ b/recipes/tick/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tick", | 2 | "id": "tick", |
3 | "name": "tick", | 3 | "name": "tick", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "http://app.tickspot.com/" | 7 | "serviceURL": "http://app.tickspot.com/" |
diff --git a/recipes/tick/webview.js b/recipes/tick/webview.js index 8101672..bc6a4b8 100644 --- a/recipes/tick/webview.js +++ b/recipes/tick/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: not sure what "notify" would be useful for this app | 8 | // TODO: not sure what "notify" would be useful for this app |
9 | 9 | ||
diff --git a/recipes/tiktok/package.json b/recipes/tiktok/package.json index 5d8e794..a0018b1 100644 --- a/recipes/tiktok/package.json +++ b/recipes/tiktok/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tiktok", | 2 | "id": "tiktok", |
3 | "name": "Tiktok", | 3 | "name": "Tiktok", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://tiktok.com" | 7 | "serviceURL": "https://tiktok.com" |
diff --git a/recipes/tiktok/webview.js b/recipes/tiktok/webview.js index 6f78019..d2bf2d0 100644 --- a/recipes/tiktok/webview.js +++ b/recipes/tiktok/webview.js | |||
@@ -1,16 +1,23 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | const selNotifications = document.querySelector("div.tiktok-1b4xcc5-DivHeaderInboxContainer.e18kkhh40 > sup"); | 9 | const selNotifications = document.querySelector( |
10 | const selDM = document.querySelector("div.tiktok-1ibfxbr-DivMessageIconContainer.e1nx07zo0 > sup"); | 10 | 'div.tiktok-1b4xcc5-DivHeaderInboxContainer.e18kkhh40 > sup', |
11 | ); | ||
12 | const selDM = document.querySelector( | ||
13 | 'div.tiktok-1ibfxbr-DivMessageIconContainer.e1nx07zo0 > sup', | ||
14 | ); | ||
11 | 15 | ||
12 | const countNotifications = (selNotifications != null) ? Ferdium.safeParseInt(selNotifications.outerText) : 0; | 16 | const countNotifications = |
13 | const countDM = (selDM != null) ? Ferdium.safeParseInt(selDM.outerText) : 0; | 17 | selNotifications == null |
18 | ? 0 | ||
19 | : Ferdium.safeParseInt(selNotifications.outerText); | ||
20 | const countDM = selDM == null ? 0 : Ferdium.safeParseInt(selDM.outerText); | ||
14 | 21 | ||
15 | const count = countNotifications + countDM; | 22 | const count = countNotifications + countDM; |
16 | 23 | ||
diff --git a/recipes/tinder/package.json b/recipes/tinder/package.json index c3619ee..c5f5a77 100644 --- a/recipes/tinder/package.json +++ b/recipes/tinder/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tinder", | 2 | "id": "tinder", |
3 | "name": "Tinder", | 3 | "name": "Tinder", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://tinder.com" | 7 | "serviceURL": "https://tinder.com" |
diff --git a/recipes/tinder/webview.js b/recipes/tinder/webview.js index 86bb422..2a81dec 100644 --- a/recipes/tinder/webview.js +++ b/recipes/tinder/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/tixio/package.json b/recipes/tixio/package.json index 161dcc9..4b4a365 100644 --- a/recipes/tixio/package.json +++ b/recipes/tixio/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tixio", | 2 | "id": "tixio", |
3 | "name": "Tixio", | 3 | "name": "Tixio", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/hmcclungiii/franz-recipe-tixio", | 6 | "repository": "https://github.com/hmcclungiii/franz-recipe-tixio", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/tixio/webview.js b/recipes/tixio/webview.js index 86bb422..2a81dec 100644 --- a/recipes/tixio/webview.js +++ b/recipes/tixio/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/todoist/package.json b/recipes/todoist/package.json index 34aa90f..1a06223 100644 --- a/recipes/todoist/package.json +++ b/recipes/todoist/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "todoist", | 2 | "id": "todoist", |
3 | "name": "Todoist", | 3 | "name": "Todoist", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/meetfranz/recipe-todoist", | 6 | "repository": "https://github.com/meetfranz/recipe-todoist", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/todoist/webview.js b/recipes/todoist/webview.js index 27b77ad..32dc1f2 100644 --- a/recipes/todoist/webview.js +++ b/recipes/todoist/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | function getTasks() { | 8 | function getTasks() { |
3 | let todayCount = 0; | 9 | let todayCount = 0; |
@@ -17,4 +23,6 @@ module.exports = Ferdium => { | |||
17 | } | 23 | } |
18 | 24 | ||
19 | Ferdium.loop(getTasks); | 25 | Ferdium.loop(getTasks); |
26 | |||
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
20 | }; | 28 | }; |
diff --git a/recipes/toggl/package.json b/recipes/toggl/package.json index 327a91d..76297b1 100644 --- a/recipes/toggl/package.json +++ b/recipes/toggl/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "toggl", | 2 | "id": "toggl", |
3 | "name": "Toggl", | 3 | "name": "Toggl", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.toggl.com/app/timer", | 7 | "serviceURL": "https://www.toggl.com/app/timer", |
diff --git a/recipes/toggl/webview-unsafe.js b/recipes/toggl/webview-unsafe.js index f657e0c..3e39e3e 100644 --- a/recipes/toggl/webview-unsafe.js +++ b/recipes/toggl/webview-unsafe.js | |||
@@ -1,6 +1,8 @@ | |||
1 | // only try to update badge once Ferdium API has finished loading | 1 | // only try to update badge once Ferdium API has finished loading |
2 | if (window.ferdium != undefined && window.ferdium.setBadge != undefined) { | 2 | if (window.ferdium !== undefined && window.ferdium.setBadge !== undefined) { |
3 | var timerRunning = (window.toggl != undefined) && !!(window.toggl.store.getState().view.timer.timeEntry.start); | 3 | const timerRunning = |
4 | window.toggl !== undefined && | ||
5 | !!window.toggl.store.getState().view.timer.timeEntry.start; | ||
4 | 6 | ||
5 | // Treat running timer as a "non-direct" notification (default blue dot instead of urgent red "1") | 7 | // Treat running timer as a "non-direct" notification (default blue dot instead of urgent red "1") |
6 | window.ferdium.setBadge(0, timerRunning ? 1 : 0); | 8 | window.ferdium.setBadge(0, timerRunning ? 1 : 0); |
diff --git a/recipes/toggl/webview.js b/recipes/toggl/webview.js index 39ac3c3..22d5a66 100644 --- a/recipes/toggl/webview.js +++ b/recipes/toggl/webview.js | |||
@@ -1,11 +1,13 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const updateBadge = function updateBadge() { | 8 | const updateBadge = function updateBadge() { |
7 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 9 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
8 | }; | 10 | }; |
9 | 11 | ||
10 | Ferdium.loop(updateBadge); | 12 | Ferdium.loop(updateBadge); |
11 | }; | 13 | }; |
diff --git a/recipes/trakt/index.js b/recipes/trakt/index.js index 606c6e3..6ae3ad9 100644 --- a/recipes/trakt/index.js +++ b/recipes/trakt/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdium => class Trakt extends Ferdium {}; \ No newline at end of file | module.exports = Ferdium => class Trakt extends Ferdium {}; | ||
diff --git a/recipes/trakt/package.json b/recipes/trakt/package.json index 73d7d36..0e52f07 100644 --- a/recipes/trakt/package.json +++ b/recipes/trakt/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "trakt", | 2 | "id": "trakt", |
3 | "name": "Trakt", | 3 | "name": "Trakt", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://trakt.tv" | 7 | "serviceURL": "https://trakt.tv" |
diff --git a/recipes/trakt/webview.js b/recipes/trakt/webview.js index 86bb422..2a81dec 100644 --- a/recipes/trakt/webview.js +++ b/recipes/trakt/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/trello/package.json b/recipes/trello/package.json index 2dbe59a..9036085 100644 --- a/recipes/trello/package.json +++ b/recipes/trello/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "trello", | 2 | "id": "trello", |
3 | "name": "Trello", | 3 | "name": "Trello", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://trello.com/" | 7 | "serviceURL": "https://trello.com/" |
diff --git a/recipes/trello/webview.js b/recipes/trello/webview.js index 3207890..a1d1f9b 100644 --- a/recipes/trello/webview.js +++ b/recipes/trello/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const notifications = document.querySelectorAll('[class*=_3W-zkl4-bnVKzJ]'); | 9 | const notifications = document.querySelectorAll('[class*=_3W-zkl4-bnVKzJ]'); |
@@ -5,4 +11,6 @@ module.exports = Ferdium => { | |||
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/tt-rss/index.js b/recipes/tt-rss/index.js index 3b384eb..dd41f72 100644 --- a/recipes/tt-rss/index.js +++ b/recipes/tt-rss/index.js | |||
@@ -1,3 +1 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => Ferdium; | module.exports = Ferdium => Ferdium; | |
diff --git a/recipes/tt-rss/package.json b/recipes/tt-rss/package.json index a2fff77..ebc04e8 100644 --- a/recipes/tt-rss/package.json +++ b/recipes/tt-rss/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tt-rss", | 2 | "id": "tt-rss", |
3 | "name": "Tiny Tiny RSS", | 3 | "name": "Tiny Tiny RSS", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/tt-rss/webview.js b/recipes/tt-rss/webview.js index 7d90615..e0581ce 100644 --- a/recipes/tt-rss/webview.js +++ b/recipes/tt-rss/webview.js | |||
@@ -1,24 +1,22 @@ | |||
1 | "use strict"; | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
2 | 6 | ||
3 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
4 | const _notificationCategory = new URL(window.location.href).searchParams.get("ferdiumNotificationCategory"); | 8 | const _notificationCategory = new URL(window.location.href).searchParams.get( |
5 | 9 | 'ferdiumNotificationCategory', | |
6 | const getMessages = function getMessages() { | 10 | ); |
7 | if (_notificationCategory) { | ||
8 | countMessagesUnderCategory(_notificationCategory); | ||
9 | } else { | ||
10 | countMessages(); | ||
11 | } | ||
12 | }; | ||
13 | 11 | ||
14 | const countMessagesUnderCategory = (notificationCategory) => { | 12 | const countMessagesUnderCategory = notificationCategory => { |
15 | var elements = document.querySelectorAll(".dijitTreeIsRoot") | 13 | const elements = document.querySelectorAll('.dijitTreeIsRoot'); |
16 | var directMessages = 0; | 14 | let directMessages = 0; |
17 | var indirectMessages = 0; | 15 | let indirectMessages = 0; |
18 | for (var element of elements) { | 16 | for (const element of elements) { |
19 | var label = element.querySelectorAll(".dijitTreeLabel")[0]; | 17 | const label = element.querySelectorAll('.dijitTreeLabel')[0]; |
20 | var unreadNode = element.querySelectorAll(".unread")[0]; | 18 | const unreadNode = element.querySelectorAll('.unread')[0]; |
21 | var unreadAmount = Ferdium.safeParseInt(unreadNode.textContent); | 19 | const unreadAmount = Ferdium.safeParseInt(unreadNode.textContent); |
22 | if (label.textContent === notificationCategory) { | 20 | if (label.textContent === notificationCategory) { |
23 | directMessages += unreadAmount; | 21 | directMessages += unreadAmount; |
24 | } else { | 22 | } else { |
@@ -29,18 +27,28 @@ module.exports = Ferdium => { | |||
29 | }; | 27 | }; |
30 | 28 | ||
31 | const _countMessagesFromTitle = () => { | 29 | const _countMessagesFromTitle = () => { |
32 | var match = document.title.match(/^\((\d+)\) Tiny Tiny RSS$/); | 30 | const match = document.title.match(/^\((\d+)\) Tiny Tiny RSS$/); |
33 | var count = match != null && match.length > 0 ? match[1] : 0; | 31 | const count = match !== null && match.length > 0 ? match[1] : 0; |
34 | return Ferdium.safeParseInt(count); | 32 | return Ferdium.safeParseInt(count); |
35 | } | 33 | }; |
36 | 34 | ||
37 | const countMessages = () => { | 35 | const countMessages = () => { |
38 | Ferdium.setBadge(_countMessagesFromTitle()); | 36 | Ferdium.setBadge(_countMessagesFromTitle()); |
39 | }; | 37 | }; |
40 | 38 | ||
39 | const getMessages = function getMessages() { | ||
40 | if (_notificationCategory) { | ||
41 | countMessagesUnderCategory(_notificationCategory); | ||
42 | } else { | ||
43 | countMessages(); | ||
44 | } | ||
45 | }; | ||
46 | |||
41 | const loopFunc = () => { | 47 | const loopFunc = () => { |
42 | getMessages(); | 48 | getMessages(); |
43 | }; | 49 | }; |
44 | 50 | ||
45 | Ferdium.loop(loopFunc); | 51 | Ferdium.loop(loopFunc); |
52 | |||
53 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
46 | }; | 54 | }; |
diff --git a/recipes/tutanota/package.json b/recipes/tutanota/package.json index a502009..0190fe6 100644 --- a/recipes/tutanota/package.json +++ b/recipes/tutanota/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tutanota", | 2 | "id": "tutanota", |
3 | "name": "Tutanota", | 3 | "name": "Tutanota", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.tutanota.com/" | 7 | "serviceURL": "https://mail.tutanota.com/" |
diff --git a/recipes/tutanota/webview.js b/recipes/tutanota/webview.js index 46366f4..1119219 100644 --- a/recipes/tutanota/webview.js +++ b/recipes/tutanota/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; \ No newline at end of file | 9 | }; |
diff --git a/recipes/tweetdeck/package.json b/recipes/tweetdeck/package.json index b082b40..2845be6 100644 --- a/recipes/tweetdeck/package.json +++ b/recipes/tweetdeck/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "tweetdeck", | 2 | "id": "tweetdeck", |
3 | "name": "Tweetdeck", | 3 | "name": "Tweetdeck", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://tweetdeck.twitter.com/", | 7 | "serviceURL": "https://tweetdeck.twitter.com/", |
diff --git a/recipes/tweetdeck/webview.js b/recipes/tweetdeck/webview.js index 7e2a067..00abfff 100644 --- a/recipes/tweetdeck/webview.js +++ b/recipes/tweetdeck/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | // Tweetdeck redirect fix | 8 | // Tweetdeck redirect fix |
3 | Ferdium.ipcRenderer.on('redirect-url', (event, url) => { | 9 | Ferdium.ipcRenderer.on('redirect-url', (event, url) => { |
@@ -15,4 +21,6 @@ module.exports = Ferdium => { | |||
15 | }; | 21 | }; |
16 | 22 | ||
17 | Ferdium.loop(getMessages); | 23 | Ferdium.loop(getMessages); |
24 | |||
25 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | 26 | }; |
diff --git a/recipes/twist/package.json b/recipes/twist/package.json index f169607..90e7ee7 100644 --- a/recipes/twist/package.json +++ b/recipes/twist/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "twist", | 2 | "id": "twist", |
3 | "name": "Twist", | 3 | "name": "Twist", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://twistapp.com/login", | 7 | "serviceURL": "https://twistapp.com/login", |
diff --git a/recipes/twist/webview.js b/recipes/twist/webview.js index 4f3cbbe..aa74758 100644 --- a/recipes/twist/webview.js +++ b/recipes/twist/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const count = document.querySelectorAll('.switch_pane>.unread').length; | 9 | const count = document.querySelectorAll('.switch_pane>.unread').length; |
@@ -5,4 +11,6 @@ module.exports = Ferdium => { | |||
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/twitch/package.json b/recipes/twitch/package.json index d9efe7d..1ba5c71 100644 --- a/recipes/twitch/package.json +++ b/recipes/twitch/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "twitch", | 2 | "id": "twitch", |
3 | "name": "Twitch", | 3 | "name": "Twitch", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.twitch.tv/{teamId}/chat", | 7 | "serviceURL": "https://www.twitch.tv/{teamId}/chat", |
diff --git a/recipes/twitch/webview.js b/recipes/twitch/webview.js index 0652545..6778fcd 100644 --- a/recipes/twitch/webview.js +++ b/recipes/twitch/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const mentions = document.querySelectorAll('.chat-line .mentioned').length; | 9 | const mentions = document.querySelectorAll('.chat-line .mentioned').length; |
4 | Ferdium.setBadge(mentions, 0); | 10 | Ferdium.setBadge(mentions, 0); |
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/twitter-dm/package.json b/recipes/twitter-dm/package.json index 208e82d..0548348 100644 --- a/recipes/twitter-dm/package.json +++ b/recipes/twitter-dm/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "twitter-dm", | 2 | "id": "twitter-dm", |
3 | "name": "Twitter DM", | 3 | "name": "Twitter DM", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mobile.twitter.com/messages", | 7 | "serviceURL": "https://mobile.twitter.com/messages", |
diff --git a/recipes/twitter-dm/webview.js b/recipes/twitter-dm/webview.js index e8f7dd1..c29d264 100644 --- a/recipes/twitter-dm/webview.js +++ b/recipes/twitter-dm/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -10,4 +16,6 @@ module.exports = Ferdium => { | |||
10 | }; | 16 | }; |
11 | 17 | ||
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/twitter/package.json b/recipes/twitter/package.json index 76e0ce0..4a1801f 100644 --- a/recipes/twitter/package.json +++ b/recipes/twitter/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "twitter", | 2 | "id": "twitter", |
3 | "name": "Twitter", | 3 | "name": "Twitter", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/ferdium/ferdium-recipes", | 6 | "repository": "https://github.com/ferdium/ferdium-recipes", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/twitter/webview.js b/recipes/twitter/webview.js index d8341e4..7a859dc 100644 --- a/recipes/twitter/webview.js +++ b/recipes/twitter/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let direct = 0; | 9 | let direct = 0; |
@@ -21,4 +27,6 @@ module.exports = Ferdium => { | |||
21 | }; | 27 | }; |
22 | 28 | ||
23 | Ferdium.loop(getMessages); | 29 | Ferdium.loop(getMessages); |
30 | |||
31 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
24 | }; | 32 | }; |
diff --git a/recipes/udemy/package.json b/recipes/udemy/package.json index 763ed5d..4af1525 100644 --- a/recipes/udemy/package.json +++ b/recipes/udemy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "udemy", | 2 | "id": "udemy", |
3 | "name": "Udemy", | 3 | "name": "Udemy", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/gaspergrom/Franz-services/tree/master/udemy", | 6 | "repository": "https://github.com/gaspergrom/Franz-services/tree/master/udemy", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/udemy/webview.js b/recipes/udemy/webview.js index 02b9c08..1d7ff56 100644 --- a/recipes/udemy/webview.js +++ b/recipes/udemy/webview.js | |||
@@ -1,9 +1,17 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let direct = 0; | 9 | const direct = 0; |
4 | let indirect = 0; | 10 | const indirect = 0; |
5 | Ferdium.setBadge(direct, indirect); | 11 | Ferdium.setBadge(direct, indirect); |
6 | } | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
9 | } | 15 | |
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
17 | }; | ||
diff --git a/recipes/unraid/package.json b/recipes/unraid/package.json index 479b48b..7d216c9 100644 --- a/recipes/unraid/package.json +++ b/recipes/unraid/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "unraid", | 2 | "id": "unraid", |
3 | "name": "Unraid", | 3 | "name": "Unraid", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/rctneil/franz-recipe-unraid", | 6 | "repository": "https://github.com/rctneil/franz-recipe-unraid", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/unraid/webview.js b/recipes/unraid/webview.js index f3a9eb4..b78c835 100644 --- a/recipes/unraid/webview.js +++ b/recipes/unraid/webview.js | |||
@@ -1,4 +1,10 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const messages = $('#jGrowl .jGrowl-notify').length; | 9 | const messages = $('#jGrowl .jGrowl-notify').length; |
4 | 10 | ||
@@ -6,4 +12,6 @@ module.exports = (Ferdium) => { | |||
6 | }; | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 17 | }; |
diff --git a/recipes/vk/package.json b/recipes/vk/package.json index f721d6d..0d07180 100644 --- a/recipes/vk/package.json +++ b/recipes/vk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "vk", | 2 | "id": "vk", |
3 | "name": "VK", | 3 | "name": "VK", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/meetfranz/recipe-vk", | 6 | "repository": "https://github.com/meetfranz/recipe-vk", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/vk/webview.js b/recipes/vk/webview.js index aac23c3..a217d96 100644 --- a/recipes/vk/webview.js +++ b/recipes/vk/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directs = 0; | 9 | let directs = 0; |
@@ -26,4 +32,6 @@ module.exports = Ferdium => { | |||
26 | }; | 32 | }; |
27 | 33 | ||
28 | Ferdium.loop(loopFunc); | 34 | Ferdium.loop(loopFunc); |
35 | |||
36 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
29 | }; | 37 | }; |
diff --git a/recipes/voxer/package.json b/recipes/voxer/package.json index a274996..c83165c 100644 --- a/recipes/voxer/package.json +++ b/recipes/voxer/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "voxer", | 2 | "id": "voxer", |
3 | "name": "Voxer", | 3 | "name": "Voxer", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.voxer.com", | 7 | "serviceURL": "https://web.voxer.com", |
diff --git a/recipes/voxer/webview.js b/recipes/voxer/webview.js index 5474b2c..1182ef7 100644 --- a/recipes/voxer/webview.js +++ b/recipes/voxer/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
diff --git a/recipes/wakatime/package.json b/recipes/wakatime/package.json index 2bb16f9..949d5a7 100644 --- a/recipes/wakatime/package.json +++ b/recipes/wakatime/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "wakatime", | 2 | "id": "wakatime", |
3 | "name": "Wakatime", | 3 | "name": "Wakatime", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://wakatime.com/login" | 7 | "serviceURL": "https://wakatime.com/login" |
diff --git a/recipes/wakatime/webview.js b/recipes/wakatime/webview.js index 86bb422..2a81dec 100644 --- a/recipes/wakatime/webview.js +++ b/recipes/wakatime/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/webex-teams/package.json b/recipes/webex-teams/package.json index 6d3b780..429448e 100644 --- a/recipes/webex-teams/package.json +++ b/recipes/webex-teams/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "webex-teams", | 2 | "id": "webex-teams", |
3 | "name": "Webex Teams", | 3 | "name": "Webex Teams", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.webex.com", | 7 | "serviceURL": "https://web.webex.com", |
diff --git a/recipes/webex-teams/webview.js b/recipes/webex-teams/webview.js index 01ae230..b70c070 100644 --- a/recipes/webex-teams/webview.js +++ b/recipes/webex-teams/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -18,4 +24,6 @@ module.exports = Ferdium => { | |||
18 | }; | 24 | }; |
19 | 25 | ||
20 | Ferdium.loop(getMessages); | 26 | Ferdium.loop(getMessages); |
27 | |||
28 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
21 | }; | 29 | }; |
diff --git a/recipes/wechat/package.json b/recipes/wechat/package.json index cdc76b9..7e7aed9 100644 --- a/recipes/wechat/package.json +++ b/recipes/wechat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "wechat", | 2 | "id": "wechat", |
3 | "name": "WeChat", | 3 | "name": "WeChat", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/koma-private/recipe-wechat", | 6 | "repository": "https://github.com/koma-private/recipe-wechat", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/wechat/webview.js b/recipes/wechat/webview.js index 033faae..e11bf0b 100644 --- a/recipes/wechat/webview.js +++ b/recipes/wechat/webview.js | |||
@@ -1,16 +1,16 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let directCount = 0; | 9 | let directCount = 0; |
10 | let indirectCount = 0; | 10 | let indirectCount = 0; |
11 | const chat_item = document.querySelectorAll('div.chat_item'); | 11 | const chatItem = document.querySelectorAll('div.chat_item'); |
12 | 12 | ||
13 | Array.prototype.forEach.call(chat_item, item => { | 13 | Array.prototype.forEach.call(chatItem, item => { |
14 | let count = 0; | 14 | let count = 0; |
15 | const reddot = item.querySelector('i.web_wechat_reddot_middle'); | 15 | const reddot = item.querySelector('i.web_wechat_reddot_middle'); |
16 | const avatarImage = item.querySelector('img.img'); | 16 | const avatarImage = item.querySelector('img.img'); |
@@ -21,7 +21,7 @@ module.exports = Ferdium => { | |||
21 | 21 | ||
22 | if ( | 22 | if ( |
23 | avatarImage && | 23 | avatarImage && |
24 | avatarImage.getAttribute('src').search('webwxgeticon') != -1 | 24 | avatarImage.getAttribute('src').search('webwxgeticon') !== -1 |
25 | ) { | 25 | ) { |
26 | directCount += count; | 26 | directCount += count; |
27 | } else { | 27 | } else { |
diff --git a/recipes/weekplan/package.json b/recipes/weekplan/package.json index 8fa7d9c..a8cc68a 100644 --- a/recipes/weekplan/package.json +++ b/recipes/weekplan/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "weekplan", | 2 | "id": "weekplan", |
3 | "name": "Weekplan", | 3 | "name": "Weekplan", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/minipada/recipe-weekplan", | 6 | "repository": "https://github.com/minipada/recipe-weekplan", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/weekplan/webview.js b/recipes/weekplan/webview.js index 5085199..c657366 100644 --- a/recipes/weekplan/webview.js +++ b/recipes/weekplan/webview.js | |||
@@ -1,10 +1,28 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const events = document.querySelectorAll(".today")[0].querySelectorAll('.list')[0].querySelectorAll('.task-list')[0].querySelectorAll('.event-section')[0].querySelectorAll('.droppable')[0].children[0].childElementCount | 9 | const events = document |
4 | const tasks = document.querySelectorAll(".today")[0].querySelectorAll('.list')[0].querySelectorAll('.task-list')[0].querySelectorAll('.task-section')[0].querySelectorAll('.droppable')[0].children[0].childElementCount | 10 | .querySelectorAll('.today')[0] |
11 | .querySelectorAll('.list')[0] | ||
12 | .querySelectorAll('.task-list')[0] | ||
13 | .querySelectorAll('.event-section')[0] | ||
14 | .querySelectorAll('.droppable')[0].children[0].childElementCount; | ||
15 | const tasks = document | ||
16 | .querySelectorAll('.today')[0] | ||
17 | .querySelectorAll('.list')[0] | ||
18 | .querySelectorAll('.task-list')[0] | ||
19 | .querySelectorAll('.task-section')[0] | ||
20 | .querySelectorAll('.droppable')[0].children[0].childElementCount; | ||
5 | 21 | ||
6 | Ferdium.setBadge(events + tasks); | 22 | Ferdium.setBadge(events + tasks); |
7 | }; | 23 | }; |
8 | 24 | ||
9 | Ferdium.loop(getMessages); | 25 | Ferdium.loop(getMessages); |
10 | } | 26 | |
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
28 | }; | ||
diff --git a/recipes/whatsapp/index.js b/recipes/whatsapp/index.js index 80eaf51..1392dcb 100644 --- a/recipes/whatsapp/index.js +++ b/recipes/whatsapp/index.js | |||
@@ -1,18 +1,23 @@ | |||
1 | module.exports = (Ferdium) => class Messenger extends Ferdium { | 1 | module.exports = Ferdium => |
2 | overrideUserAgent() { | 2 | class Messenger extends Ferdium { |
3 | return window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | overrideUserAgent() { |
4 | } | 4 | return window.navigator.userAgent |
5 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') | ||
6 | .trim(); | ||
7 | } | ||
5 | 8 | ||
6 | modifyRequestHeaders() { | 9 | modifyRequestHeaders() { |
7 | return [ | 10 | return [ |
8 | { | 11 | { |
9 | headers: { | 12 | headers: { |
10 | 'user-agent': window.navigator.userAgent.replace(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '').trim(), | 13 | 'user-agent': window.navigator.userAgent |
14 | .replaceAll(/(Ferdium|Electron)\/\S+ \([^)]+\)/g, '') | ||
15 | .trim(), | ||
16 | }, | ||
17 | requestFilters: { | ||
18 | urls: ['*://*/*'], | ||
19 | }, | ||
11 | }, | 20 | }, |
12 | requestFilters: { | 21 | ]; |
13 | urls: ['*://*/*'], | 22 | } |
14 | }, | 23 | }; |
15 | }, | ||
16 | ]; | ||
17 | } | ||
18 | }; | ||
diff --git a/recipes/whatsapp/package.json b/recipes/whatsapp/package.json index 88a7e30..e3a8fa8 100644 --- a/recipes/whatsapp/package.json +++ b/recipes/whatsapp/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "whatsapp", | 2 | "id": "whatsapp", |
3 | "name": "WhatsApp", | 3 | "name": "WhatsApp", |
4 | "version": "3.4.11", | 4 | "version": "3.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.whatsapp.com", | 7 | "serviceURL": "https://web.whatsapp.com", |
diff --git a/recipes/whatsapp/webview-unsafe.js b/recipes/whatsapp/webview-unsafe.js index b6b365b..7382f3d 100644 --- a/recipes/whatsapp/webview-unsafe.js +++ b/recipes/whatsapp/webview-unsafe.js | |||
@@ -5,38 +5,37 @@ const PUSHSTATE_THROTTLE = 1; | |||
5 | const PUSHSTATE_THROTTLE_THRESHOLD = 1; | 5 | const PUSHSTATE_THROTTLE_THRESHOLD = 1; |
6 | 6 | ||
7 | window.shPushState = window.history.pushState; | 7 | window.shPushState = window.history.pushState; |
8 | //window.pushStateBehavior = PUSHSTATE_NORMAL; | 8 | // window.pushStateBehavior = PUSHSTATE_NORMAL; |
9 | window.pushStateBehavior = PUSHSTATE_THROTTLE; | 9 | window.pushStateBehavior = PUSHSTATE_THROTTLE; |
10 | window.pushStateCount = 0; | 10 | window.pushStateCount = 0; |
11 | 11 | ||
12 | function pushStateThrottled() { | 12 | function pushStateThrottled() { |
13 | if (window.pushStateCount < PUSHSTATE_THROTTLE_THRESHOLD) | 13 | if (window.pushStateCount < PUSHSTATE_THROTTLE_THRESHOLD) { |
14 | { | 14 | window.shPushState.apply(window.history, arguments); |
15 | window.shPushState.apply(window.history, arguments); | 15 | window.pushStateCount++; |
16 | window.pushStateCount++; | 16 | |
17 | 17 | if (window.pushStateCount == PUSHSTATE_THROTTLE_THRESHOLD) | |
18 | if (window.pushStateCount == PUSHSTATE_THROTTLE_THRESHOLD) | 18 | setTimeout(() => { |
19 | setTimeout(() => { | 19 | window.pushStateCount = 0; |
20 | window.pushStateCount = 0; | 20 | }, 5000); |
21 | }, | 21 | } else { |
22 | 5000); | 22 | // eslint-disable-next-line no-console |
23 | } | 23 | console.log('Pushstate temporarily blocked!'); |
24 | else | 24 | } |
25 | { | ||
26 | console.log("Pushstate temporarily blocked!"); | ||
27 | } | ||
28 | } | 25 | } |
29 | 26 | ||
30 | function pushStateOneShot() { | 27 | function pushStateOneShot() { |
31 | window.shPushState.apply(window.history, arguments); | 28 | window.shPushState.apply(window.history, arguments); |
32 | 29 | ||
33 | window.history.pushState = function() {}; | 30 | window.history.pushState = function () {}; |
34 | 31 | ||
35 | console.log("Pushstate Disabled!"); | 32 | // eslint-disable-next-line no-console |
33 | console.log('Pushstate Disabled!'); | ||
36 | } | 34 | } |
37 | 35 | ||
38 | if (window.pushStateBehavior != PUSHSTATE_NORMAL) | 36 | if (window.pushStateBehavior != PUSHSTATE_NORMAL) { |
39 | { | 37 | window.history.pushState = |
40 | window.history.pushState = | 38 | window.pushStateBehavior == PUSHSTATE_THROTTLE |
41 | window.pushStateBehavior == PUSHSTATE_THROTTLE ? pushStateThrottled : pushStateOneShot; | 39 | ? pushStateThrottled |
40 | : pushStateOneShot; | ||
42 | } | 41 | } |
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index e2496be..26f2a3a 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js | |||
@@ -1,42 +1,21 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : {default: obj}; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | let dbCache | 8 | let dbCache; |
9 | 9 | ||
10 | const getMessages = () => { | 10 | const getMessages = () => { |
11 | if(!dbCache) { | 11 | if (dbCache) { |
12 | const dbsPromise = indexedDB.databases() | ||
13 | dbsPromise.then((databases) => { | ||
14 | for(let index in databases) { | ||
15 | //Wait for model-storage db to be available before calling indexedDB.open(). This is to make sure whatsapp created the model-storage DB | ||
16 | if(databases[index].name === "model-storage") { | ||
17 | const request = window.indexedDB.open("model-storage"); | ||
18 | request.onsuccess = () => { | ||
19 | dbCache = request.result; | ||
20 | //This will be called when db.delete is triggered, we need to close and set dbCache to null to trigger lookup again | ||
21 | dbCache.onversionchange = () => { | ||
22 | dbCache.close() | ||
23 | dbCache = null | ||
24 | }; | ||
25 | } | ||
26 | request.addEventListener('error', () => { | ||
27 | console.error("Opening model-storage database failed:", event); | ||
28 | }) | ||
29 | } | ||
30 | } | ||
31 | }) | ||
32 | } else { | ||
33 | let unreadCount = 0; | 12 | let unreadCount = 0; |
34 | let unreadMutedCount = 0; | 13 | let unreadMutedCount = 0; |
35 | 14 | ||
36 | const txn = dbCache.transaction('chat', 'readonly'); | 15 | const txn = dbCache.transaction('chat', 'readonly'); |
37 | const store = txn.objectStore('chat'); | 16 | const store = txn.objectStore('chat'); |
38 | const query = store.getAll(); | 17 | const query = store.getAll(); |
39 | query.onsuccess = (event) => { | 18 | query.onsuccess = event => { |
40 | for (const chat of event.target.result) { | 19 | for (const chat of event.target.result) { |
41 | if (chat.unreadCount > 0) { | 20 | if (chat.unreadCount > 0) { |
42 | if (chat.muteExpiration > 0 || chat.isAutoMuted) { | 21 | if (chat.muteExpiration > 0 || chat.isAutoMuted) { |
@@ -50,11 +29,32 @@ module.exports = Ferdium => { | |||
50 | Ferdium.setBadge(unreadCount, unreadMutedCount); | 29 | Ferdium.setBadge(unreadCount, unreadMutedCount); |
51 | }; | 30 | }; |
52 | 31 | ||
53 | query.addEventListener('error', (event) => { | 32 | query.addEventListener('error', event => { |
54 | console.error("Loading data from database failed:", event); | 33 | console.error('Loading data from database failed:', event); |
55 | }) | 34 | }); |
35 | } else { | ||
36 | const dbsPromise = indexedDB.databases(); | ||
37 | dbsPromise.then(databases => { | ||
38 | for (let index in databases) { | ||
39 | //Wait for model-storage db to be available before calling indexedDB.open(). This is to make sure whatsapp created the model-storage DB | ||
40 | if (databases[index].name === 'model-storage') { | ||
41 | const request = window.indexedDB.open('model-storage'); | ||
42 | request.onsuccess = () => { | ||
43 | dbCache = request.result; | ||
44 | // This will be called when db.delete is triggered, we need to close and set dbCache to null to trigger lookup again | ||
45 | dbCache.onversionchange = () => { | ||
46 | dbCache.close(); | ||
47 | dbCache = null; | ||
48 | }; | ||
49 | }; | ||
50 | request.addEventListener('error', () => { | ||
51 | console.error('Opening model-storage database failed:', event); | ||
52 | }); | ||
53 | } | ||
54 | } | ||
55 | }); | ||
56 | } | 56 | } |
57 | } | 57 | }; |
58 | 58 | ||
59 | // inject webview hacking script | 59 | // inject webview hacking script |
60 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 60 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
@@ -74,14 +74,12 @@ module.exports = Ferdium => { | |||
74 | Ferdium.releaseServiceWorkers(); | 74 | Ferdium.releaseServiceWorkers(); |
75 | }); | 75 | }); |
76 | 76 | ||
77 | Ferdium.handleDarkMode((isEnabled) => { | 77 | Ferdium.handleDarkMode(isEnabled => { |
78 | |||
79 | if (isEnabled) { | 78 | if (isEnabled) { |
80 | document.body.classList.add('dark'); | 79 | document.body.classList.add('dark'); |
81 | } else { | 80 | } else { |
82 | document.body.classList.remove('dark'); | 81 | document.body.classList.remove('dark'); |
83 | } | 82 | } |
84 | |||
85 | }); | 83 | }); |
86 | 84 | ||
87 | Ferdium.loop(loopFunc); | 85 | Ferdium.loop(loopFunc); |
diff --git a/recipes/whereby/package.json b/recipes/whereby/package.json index 3eb3668..9330f9b 100644 --- a/recipes/whereby/package.json +++ b/recipes/whereby/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "whereby", | 2 | "id": "whereby", |
3 | "name": "Whereby", | 3 | "name": "Whereby", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://whereby.com/{teamId}", | 7 | "serviceURL": "https://whereby.com/{teamId}", |
diff --git a/recipes/whereby/webview.js b/recipes/whereby/webview.js index 6e64c6f..5dc088c 100644 --- a/recipes/whereby/webview.js +++ b/recipes/whereby/webview.js | |||
@@ -1,6 +1,8 @@ | |||
1 | var _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
diff --git a/recipes/whimsical/package.json b/recipes/whimsical/package.json index 26ac80d..b9e6840 100644 --- a/recipes/whimsical/package.json +++ b/recipes/whimsical/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "whimsical", | 2 | "id": "whimsical", |
3 | "name": "Whimsical", | 3 | "name": "Whimsical", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://whimsical.com/" | 7 | "serviceURL": "https://whimsical.com/" |
diff --git a/recipes/whimsical/webview.js b/recipes/whimsical/webview.js index 56a20b6..1119219 100644 --- a/recipes/whimsical/webview.js +++ b/recipes/whimsical/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 8 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
9 | }; | 9 | }; |
diff --git a/recipes/wire/index.js b/recipes/wire/index.js index 244fe33..dd41f72 100644 --- a/recipes/wire/index.js +++ b/recipes/wire/index.js | |||
@@ -1 +1 @@ | |||
module.exports = (Ferdium) => Ferdium; | module.exports = Ferdium => Ferdium; | ||
diff --git a/recipes/wire/package.json b/recipes/wire/package.json index d7bfce4..11a1187 100644 --- a/recipes/wire/package.json +++ b/recipes/wire/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "wire", | 2 | "id": "wire", |
3 | "name": "Wire", | 3 | "name": "Wire", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.wire.com/", | 7 | "serviceURL": "https://app.wire.com/", |
diff --git a/recipes/wire/webview.js b/recipes/wire/webview.js index 5945515..036a38f 100644 --- a/recipes/wire/webview.js +++ b/recipes/wire/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let direct = 0; | 9 | let direct = 0; |
@@ -36,4 +42,6 @@ module.exports = Ferdium => { | |||
36 | }; | 42 | }; |
37 | 43 | ||
38 | Ferdium.loop(getMessages); | 44 | Ferdium.loop(getMessages); |
45 | |||
46 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
39 | }; | 47 | }; |
diff --git a/recipes/withspectrum/package.json b/recipes/withspectrum/package.json index 4381afa..1315bee 100644 --- a/recipes/withspectrum/package.json +++ b/recipes/withspectrum/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "withspectrum", | 2 | "id": "withspectrum", |
3 | "name": "Spectrum", | 3 | "name": "Spectrum", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://spectrum.chat" | 7 | "serviceURL": "https://spectrum.chat" |
diff --git a/recipes/withspectrum/webview.js b/recipes/withspectrum/webview.js index d31d0a7..7c0def1 100644 --- a/recipes/withspectrum/webview.js +++ b/recipes/withspectrum/webview.js | |||
@@ -1,11 +1,22 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const element = document.querySelector('[href="/notifications"] > div'); | 9 | const element = document.querySelector('[href="/notifications"] > div'); |
4 | const content = window.getComputedStyle(element, ':after').getPropertyValue('content').match(/\d+/); | 10 | const content = window |
11 | .getComputedStyle(element, ':after') | ||
12 | .getPropertyValue('content') | ||
13 | .match(/\d+/); | ||
5 | const notifications = Number(content); | 14 | const notifications = Number(content); |
6 | 15 | ||
7 | Ferdium.setBadge(notifications); | 16 | Ferdium.setBadge(notifications); |
8 | }; | 17 | }; |
9 | 18 | ||
10 | Ferdium.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
11 | }; | 22 | }; |
diff --git a/recipes/workflowy/package.json b/recipes/workflowy/package.json index 82e1400..f429db8 100644 --- a/recipes/workflowy/package.json +++ b/recipes/workflowy/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "workflowy", | 2 | "id": "workflowy", |
3 | "name": "WorkFlowy", | 3 | "name": "WorkFlowy", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://workflowy.com" | 7 | "serviceURL": "https://workflowy.com" |
diff --git a/recipes/workflowy/webview.js b/recipes/workflowy/webview.js index c3e00a8..9f7ef31 100644 --- a/recipes/workflowy/webview.js +++ b/recipes/workflowy/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = () => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | // TODO: If your workflowy service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your workflowy service has unread messages, uncomment these lines to implement the logic for updating the badges |
3 | // const getMessages = () => { | 9 | // const getMessages = () => { |
4 | // // TODO: Insert your notification-finding code here | 10 | // // TODO: Insert your notification-finding code here |
5 | // Ferdium.setBadge(0, 0); | 11 | // Ferdium.setBadge(0, 0); |
6 | // }; | 12 | // }; |
7 | // Ferdium.loop(getMessages); | 13 | // Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/workplace/package.json b/recipes/workplace/package.json index ac9918c..fee0cb2 100644 --- a/recipes/workplace/package.json +++ b/recipes/workplace/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "workplace", | 2 | "id": "workplace", |
3 | "name": "Workplace", | 3 | "name": "Workplace", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.workplace.com/chat", | 7 | "serviceURL": "https://{teamId}.workplace.com/chat", |
diff --git a/recipes/workplace/webview.js b/recipes/workplace/webview.js index 8ee283b..d77cfed 100644 --- a/recipes/workplace/webview.js +++ b/recipes/workplace/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let direct = 0; | 9 | let direct = 0; |
@@ -16,16 +16,16 @@ module.exports = Ferdium => { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | if (chatsElement) { | 18 | if (chatsElement) { |
19 | if (!chatsElement.hasAttribute('aria-current')) { | 19 | if (chatsElement.hasAttribute('aria-current')) { |
20 | direct = document.querySelectorAll( | ||
21 | '[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw', | ||
22 | ).length; | ||
23 | } else { | ||
20 | const chatMessages = chatsElement.querySelector('span'); | 24 | const chatMessages = chatsElement.querySelector('span'); |
21 | 25 | ||
22 | if (chatMessages) { | 26 | if (chatMessages) { |
23 | direct = Ferdium.safeParseInt(chatMessages.textContent); | 27 | direct = Ferdium.safeParseInt(chatMessages.textContent); |
24 | } | 28 | } |
25 | } else { | ||
26 | direct = document.querySelectorAll( | ||
27 | '[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw', | ||
28 | ).length; | ||
29 | } | 29 | } |
30 | } | 30 | } |
31 | 31 | ||
diff --git a/recipes/wrike/package.json b/recipes/wrike/package.json index 48cacf6..1ef29c0 100644 --- a/recipes/wrike/package.json +++ b/recipes/wrike/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "wrike", | 2 | "id": "wrike", |
3 | "name": "Wrike", | 3 | "name": "Wrike", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/koma-private/recipe-wrike", | 6 | "repository": "https://github.com/koma-private/recipe-wrike", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/wrike/webview.js b/recipes/wrike/webview.js index 0026fff..f3e4906 100644 --- a/recipes/wrike/webview.js +++ b/recipes/wrike/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directCount = 0; | 9 | let directCount = 0; |
@@ -12,4 +18,6 @@ module.exports = Ferdium => { | |||
12 | }; | 18 | }; |
13 | 19 | ||
14 | Ferdium.loop(getMessages); | 20 | Ferdium.loop(getMessages); |
21 | |||
22 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
15 | }; | 23 | }; |
diff --git a/recipes/xing/package.json b/recipes/xing/package.json index 867e47e..ecc0f7c 100644 --- a/recipes/xing/package.json +++ b/recipes/xing/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "xing", | 2 | "id": "xing", |
3 | "name": "XING", | 3 | "name": "XING", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.xing.com/messenger/global" | 7 | "serviceURL": "https://www.xing.com/messenger/global" |
diff --git a/recipes/xing/webview.js b/recipes/xing/webview.js index 28d9265..cd84964 100644 --- a/recipes/xing/webview.js +++ b/recipes/xing/webview.js | |||
@@ -1,7 +1,17 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | function getUnreadConversations() { | 8 | function getUnreadConversations() { |
3 | Ferdium.setBadge(document.querySelector('#unread-conversations').textContent); | 9 | Ferdium.setBadge( |
10 | document.querySelector('#unread-conversations').textContent, | ||
11 | ); | ||
4 | } | 12 | } |
5 | 13 | ||
6 | Ferdium.loop(getUnreadConversations); | 14 | Ferdium.loop(getUnreadConversations); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
7 | }; | 17 | }; |
diff --git a/recipes/xmpp/package.json b/recipes/xmpp/package.json index 97bf94b..62b081b 100644 --- a/recipes/xmpp/package.json +++ b/recipes/xmpp/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "xmpp", | 2 | "id": "xmpp", |
3 | "name": "XMPP", | 3 | "name": "XMPP", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/Aman9das/ferdi-xmpp-recipe", | 6 | "repository": "https://github.com/Aman9das/ferdi-xmpp-recipe", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/xmpp/webview.js b/recipes/xmpp/webview.js index 399133d..ab59fdb 100644 --- a/recipes/xmpp/webview.js +++ b/recipes/xmpp/webview.js | |||
@@ -1,13 +1,21 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | function getMessages() { | 8 | function getMessages() { |
3 | let direct = 0; | 9 | let direct = 0; |
4 | for (const indicator of document.querySelectorAll('.msgs-indicator')) { | 10 | for (const indicator of document.querySelectorAll('.msgs-indicator')) { |
5 | direct += Ferdium.safeParseInt(indicator.textContent) | 11 | direct += Ferdium.safeParseInt(indicator.textContent); |
6 | } | 12 | } |
7 | 13 | ||
8 | direct = direct / 2 // as the messages are provided in 2 different locations.. | 14 | direct /= 2; // as the messages are provided in 2 different locations.. |
9 | Ferdium.setBadge(direct); | 15 | Ferdium.setBadge(direct); |
10 | } | 16 | } |
11 | 17 | ||
12 | Ferdium.loop(getMessages); | 18 | Ferdium.loop(getMessages); |
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
13 | }; | 21 | }; |
diff --git a/recipes/yahoo-mail/index.js b/recipes/yahoo-mail/index.js index 858fff1..8e2576a 100644 --- a/recipes/yahoo-mail/index.js +++ b/recipes/yahoo-mail/index.js | |||
@@ -1,15 +1,17 @@ | |||
1 | module.exports = (Ferdium) => class YahooMail extends Ferdium { | 1 | module.exports = Ferdium => |
2 | modifyRequestHeaders() { | 2 | class YahooMail extends Ferdium { |
3 | return [ | 3 | modifyRequestHeaders() { |
4 | { | 4 | return [ |
5 | headers: { | 5 | { |
6 | // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdium | 6 | headers: { |
7 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', | 7 | // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdium |
8 | 'user-agent': | ||
9 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', | ||
10 | }, | ||
11 | requestFilters: { | ||
12 | urls: ['*://*/*'], | ||
13 | }, | ||
8 | }, | 14 | }, |
9 | requestFilters: { | 15 | ]; |
10 | urls: ['*://*/*'], | 16 | } |
11 | }, | 17 | }; |
12 | }, | ||
13 | ]; | ||
14 | } | ||
15 | }; | ||
diff --git a/recipes/yahoo-mail/package.json b/recipes/yahoo-mail/package.json index a90df33..609e48a 100644 --- a/recipes/yahoo-mail/package.json +++ b/recipes/yahoo-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "yahoo-mail", | 2 | "id": "yahoo-mail", |
3 | "name": "Yahoo Mail", | 3 | "name": "Yahoo Mail", |
4 | "version": "1.2.2", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.yahoo.com", | 7 | "serviceURL": "https://mail.yahoo.com", |
diff --git a/recipes/yahoo-mail/webview.js b/recipes/yahoo-mail/webview.js index 9ab9b6b..fc74834 100644 --- a/recipes/yahoo-mail/webview.js +++ b/recipes/yahoo-mail/webview.js | |||
@@ -1,8 +1,18 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const count = document.querySelector('a[data-test-folder-name="Inbox"] span[data-test-id="displayed-count"]').textContent; | 9 | const count = document.querySelector( |
10 | 'a[data-test-folder-name="Inbox"] span[data-test-id="displayed-count"]', | ||
11 | ).textContent; | ||
4 | Ferdium.setBadge(count); | 12 | Ferdium.setBadge(count); |
5 | }; | 13 | }; |
6 | 14 | ||
7 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 18 | }; |
diff --git a/recipes/yammer/package.json b/recipes/yammer/package.json index 4bbd99b..bc7f532 100644 --- a/recipes/yammer/package.json +++ b/recipes/yammer/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "yammer", | 2 | "id": "yammer", |
3 | "name": "Yammer", | 3 | "name": "Yammer", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.yammer.com/login", | 7 | "serviceURL": "https://www.yammer.com/login", |
diff --git a/recipes/yammer/webview.js b/recipes/yammer/webview.js index 56c2eeb..0ec0c6b 100644 --- a/recipes/yammer/webview.js +++ b/recipes/yammer/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let directMessages = 0; | 9 | let directMessages = 0; |
@@ -23,4 +29,6 @@ module.exports = Ferdium => { | |||
23 | }; | 29 | }; |
24 | 30 | ||
25 | Ferdium.loop(getMessages); | 31 | Ferdium.loop(getMessages); |
32 | |||
33 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
26 | }; | 34 | }; |
diff --git a/recipes/yandex-mail/package.json b/recipes/yandex-mail/package.json index 88cb4e6..cb1d09e 100644 --- a/recipes/yandex-mail/package.json +++ b/recipes/yandex-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "yandex-mail", | 2 | "id": "yandex-mail", |
3 | "name": "Yandex Mail", | 3 | "name": "Yandex Mail", |
4 | "version": "1.1.1", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.yandex.ru" | 7 | "serviceURL": "https://mail.yandex.ru" |
diff --git a/recipes/yandex-mail/webview.js b/recipes/yandex-mail/webview.js index b5a5156..4e62393 100644 --- a/recipes/yandex-mail/webview.js +++ b/recipes/yandex-mail/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const button = document.querySelectorAll('[href="#unread"]')[0] ?? {}; | 9 | const button = document.querySelectorAll('[href="#unread"]')[0] ?? {}; |
@@ -7,4 +13,6 @@ module.exports = Ferdium => { | |||
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |
diff --git a/recipes/youtrack/package.json b/recipes/youtrack/package.json index 7e957ce..3317370 100644 --- a/recipes/youtrack/package.json +++ b/recipes/youtrack/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "youtrack", | 2 | "id": "youtrack", |
3 | "name": "YouTrack", | 3 | "name": "YouTrack", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.myjetbrains.com/youtrack/", | 7 | "serviceURL": "https://{teamId}.myjetbrains.com/youtrack/", |
diff --git a/recipes/youtrack/webview.js b/recipes/youtrack/webview.js index 0013bf0..214287c 100644 --- a/recipes/youtrack/webview.js +++ b/recipes/youtrack/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const unread = document.querySelectorAll('.header__bell-wrapper_unread'); | 9 | const unread = document.querySelectorAll('.header__bell-wrapper_unread'); |
@@ -5,4 +11,6 @@ module.exports = Ferdium => { | |||
5 | }; | 11 | }; |
6 | 12 | ||
7 | Ferdium.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/youtube/package.json b/recipes/youtube/package.json index 0c76ffa..68a0ab2 100644 --- a/recipes/youtube/package.json +++ b/recipes/youtube/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "youtube", | 2 | "id": "youtube", |
3 | "name": "YouTube", | 3 | "name": "YouTube", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://youtube.com/" | 7 | "serviceURL": "https://youtube.com/" |
diff --git a/recipes/youtube/webview.js b/recipes/youtube/webview.js index 86bb422..2a81dec 100644 --- a/recipes/youtube/webview.js +++ b/recipes/youtube/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/youtubemusic/package.json b/recipes/youtubemusic/package.json index d3c06ad..2d1b59b 100644 --- a/recipes/youtubemusic/package.json +++ b/recipes/youtubemusic/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "youtubemusic", | 2 | "id": "youtubemusic", |
3 | "name": "YouTube Music", | 3 | "name": "YouTube Music", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://music.youtube.com/" | 7 | "serviceURL": "https://music.youtube.com/" |
diff --git a/recipes/youtubemusic/webview.js b/recipes/youtubemusic/webview.js index 86bb422..2a81dec 100644 --- a/recipes/youtubemusic/webview.js +++ b/recipes/youtubemusic/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/zalo/package.json b/recipes/zalo/package.json index 41b60cd..76cef76 100644 --- a/recipes/zalo/package.json +++ b/recipes/zalo/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zalo", | 2 | "id": "zalo", |
3 | "name": "Zalo", | 3 | "name": "Zalo", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://chat.zalo.me/", | 7 | "serviceURL": "https://chat.zalo.me/", |
diff --git a/recipes/zalo/webview.js b/recipes/zalo/webview.js index 8e4c3cd..3c432a6 100644 --- a/recipes/zalo/webview.js +++ b/recipes/zalo/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
@@ -5,46 +11,59 @@ module.exports = Ferdium => { | |||
5 | const unreadRed = document.querySelector('.unread-red'); | 11 | const unreadRed = document.querySelector('.unread-red'); |
6 | if (unreadRed !== null) { | 12 | if (unreadRed !== null) { |
7 | switch (unreadRed.classList[1]) { | 13 | switch (unreadRed.classList[1]) { |
8 | case 'fa-num1': | 14 | case 'fa-num1': { |
9 | count = 1; | 15 | count = 1; |
10 | break; | 16 | break; |
11 | case 'fa-num2': | 17 | } |
18 | case 'fa-num2': { | ||
12 | count = 2; | 19 | count = 2; |
13 | break; | 20 | break; |
14 | case 'fa-num3': | 21 | } |
22 | case 'fa-num3': { | ||
15 | count = 3; | 23 | count = 3; |
16 | break; | 24 | break; |
17 | case 'fa-num4': | 25 | } |
26 | case 'fa-num4': { | ||
18 | count = 4; | 27 | count = 4; |
19 | break; | 28 | break; |
20 | case 'fa-num5': | 29 | } |
30 | case 'fa-num5': { | ||
21 | count = 5; | 31 | count = 5; |
22 | break; | 32 | break; |
33 | } | ||
23 | default: { | 34 | default: { |
24 | // fa-num5plus | 35 | // fa-num5plus |
25 | const convUnread = document.querySelectorAll('.conv-unread:not(.func-unread__muted)'); | 36 | const convUnread = document.querySelectorAll( |
26 | if (convUnread.length === 0) | 37 | '.conv-unread:not(.func-unread__muted)', |
27 | count = 6; // 5+ | 38 | ); |
39 | if (convUnread.length === 0) count = 6; // 5+ | ||
28 | else | 40 | else |
29 | for (const convUnreadItem of convUnread) { | 41 | for (const convUnreadItem of convUnread) { |
30 | switch (convUnreadItem.classList[1]) { | 42 | switch (convUnreadItem.classList[1]) { |
31 | case 'fa-1_24_Line': | 43 | case 'fa-1_24_Line': { |
32 | count = count + 1; | 44 | count += 1; |
33 | break; | 45 | break; |
34 | case 'fa-2_24_Line': | 46 | } |
35 | count = count + 2; | 47 | case 'fa-2_24_Line': { |
48 | count += 2; | ||
36 | break; | 49 | break; |
37 | case 'fa-3_24_Line': | 50 | } |
38 | count = count + 3; | 51 | case 'fa-3_24_Line': { |
52 | count += 3; | ||
39 | break; | 53 | break; |
40 | case 'fa-4_24_Line': | 54 | } |
41 | count = count + 4; | 55 | case 'fa-4_24_Line': { |
56 | count += 4; | ||
42 | break; | 57 | break; |
43 | case 'fa-5_24_Line': | 58 | } |
44 | count = count + 5; | 59 | case 'fa-5_24_Line': { |
60 | count += 5; | ||
45 | break; | 61 | break; |
46 | default: // fa-5plus_24_Line | 62 | } |
47 | count = count + 6; | 63 | default: { |
64 | // fa-5plus_24_Line | ||
65 | count += 6; | ||
66 | } | ||
48 | } | 67 | } |
49 | } | 68 | } |
50 | } | 69 | } |
@@ -53,4 +72,6 @@ module.exports = Ferdium => { | |||
53 | Ferdium.setBadge(count); | 72 | Ferdium.setBadge(count); |
54 | }; | 73 | }; |
55 | Ferdium.loop(getMessages); | 74 | Ferdium.loop(getMessages); |
56 | }; \ No newline at end of file | 75 | |
76 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
77 | }; | ||
diff --git a/recipes/zammad/package.json b/recipes/zammad/package.json index a77b804..c19c74e 100644 --- a/recipes/zammad/package.json +++ b/recipes/zammad/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zammad", | 2 | "id": "zammad", |
3 | "name": "Zammad", | 3 | "name": "Zammad", |
4 | "version": "1.0.0", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasNotificationSound": true, | 7 | "hasNotificationSound": true, |
diff --git a/recipes/zammad/webview.js b/recipes/zammad/webview.js index 38710d1..fb6c9c5 100644 --- a/recipes/zammad/webview.js +++ b/recipes/zammad/webview.js | |||
@@ -1,8 +1,18 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
3 | const notificationsCounter = document.querySelector('.js-notificationsCounter'); | 9 | const notificationsCounter = document.querySelector( |
10 | '.js-notificationsCounter', | ||
11 | ); | ||
4 | Ferdium.setBadge(Ferdium.safeParseInt(notificationsCounter.textContent)); | 12 | Ferdium.setBadge(Ferdium.safeParseInt(notificationsCounter.textContent)); |
5 | }; | 13 | }; |
6 | 14 | ||
7 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 18 | }; |
diff --git a/recipes/zendesk/package.json b/recipes/zendesk/package.json index aa1daca..d29c76a 100644 --- a/recipes/zendesk/package.json +++ b/recipes/zendesk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zendesk", | 2 | "id": "zendesk", |
3 | "name": "Zendesk", | 3 | "name": "Zendesk", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.zendesk.com/agent", | 7 | "serviceURL": "https://{teamId}.zendesk.com/agent", |
diff --git a/recipes/zendesk/webview.js b/recipes/zendesk/webview.js index 5493dbf..8f14952 100644 --- a/recipes/zendesk/webview.js +++ b/recipes/zendesk/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let count = 0; | 9 | let count = 0; |
diff --git a/recipes/zenhub/package.json b/recipes/zenhub/package.json index 7495bd9..ab5f2bf 100644 --- a/recipes/zenhub/package.json +++ b/recipes/zenhub/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zenhub", | 2 | "id": "zenhub", |
3 | "name": "ZenHub", | 3 | "name": "ZenHub", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/mordaroso/recipe-franz-zenhub", | 6 | "repository": "https://github.com/mordaroso/recipe-franz-zenhub", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/zenhub/webview.js b/recipes/zenhub/webview.js index 86bb422..2a81dec 100644 --- a/recipes/zenhub/webview.js +++ b/recipes/zenhub/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |
diff --git a/recipes/zeplin/package.json b/recipes/zeplin/package.json index 0cbf314..72c3797 100644 --- a/recipes/zeplin/package.json +++ b/recipes/zeplin/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zeplin", | 2 | "id": "zeplin", |
3 | "name": "Zeplin", | 3 | "name": "Zeplin", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.zeplin.io/login" | 7 | "serviceURL": "https://app.zeplin.io/login" |
diff --git a/recipes/zeplin/webview.js b/recipes/zeplin/webview.js index d66b355..83c69e6 100644 --- a/recipes/zeplin/webview.js +++ b/recipes/zeplin/webview.js | |||
@@ -1,9 +1,20 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const totalNotifications = document.querySelectorAll('#notificationList > .notification').length; | 9 | const totalNotifications = document.querySelectorAll( |
4 | const hasUnread = document.querySelectorAll('#notificationsButton.hasUnread').length > 0; | 10 | '#notificationList > .notification', |
11 | ).length; | ||
12 | const hasUnread = | ||
13 | document.querySelectorAll('#notificationsButton.hasUnread').length > 0; | ||
5 | Ferdium.setBadge(hasUnread ? totalNotifications : 0); | 14 | Ferdium.setBadge(hasUnread ? totalNotifications : 0); |
6 | }; | 15 | }; |
7 | 16 | ||
8 | Ferdium.loop(getMessages); | 17 | Ferdium.loop(getMessages); |
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 20 | }; |
diff --git a/recipes/zimbra/package.json b/recipes/zimbra/package.json index f05bb65..7c69452 100644 --- a/recipes/zimbra/package.json +++ b/recipes/zimbra/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zimbra", | 2 | "id": "zimbra", |
3 | "name": "Zimbra", | 3 | "name": "Zimbra", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasNotificationSound": true, | 7 | "hasNotificationSound": true, |
diff --git a/recipes/zimbra/webview.js b/recipes/zimbra/webview.js index 1fdbde5..6a0dcb7 100644 --- a/recipes/zimbra/webview.js +++ b/recipes/zimbra/webview.js | |||
@@ -1,3 +1,9 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | const { title } = document; | 9 | const { title } = document; |
@@ -6,4 +12,6 @@ module.exports = Ferdium => { | |||
6 | }; | 12 | }; |
7 | 13 | ||
8 | Ferdium.loop(getMessages); | 14 | Ferdium.loop(getMessages); |
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
9 | }; | 17 | }; |
diff --git a/recipes/zoho-projects/package.json b/recipes/zoho-projects/package.json index 60b26d4..2b5f97e 100644 --- a/recipes/zoho-projects/package.json +++ b/recipes/zoho-projects/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zoho-projects", | 2 | "id": "zoho-projects", |
3 | "name": "Zoho Projects", | 3 | "name": "Zoho Projects", |
4 | "version": "1.1.0", | 4 | "version": "1.2.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://projects.zoho.eu/" | 7 | "serviceURL": "https://projects.zoho.eu/" |
diff --git a/recipes/zoho-projects/webview.js b/recipes/zoho-projects/webview.js index 2d2d85f..14e4688 100644 --- a/recipes/zoho-projects/webview.js +++ b/recipes/zoho-projects/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = () => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | // TODO: If your Zoho Projects service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your Zoho Projects service has unread messages, uncomment these lines to implement the logic for updating the badges |
3 | // const getMessages = () => { | 9 | // const getMessages = () => { |
4 | // // TODO: Insert your notification-finding code here | 10 | // // TODO: Insert your notification-finding code here |
5 | // Ferdium.setBadge(0, 0); | 11 | // Ferdium.setBadge(0, 0); |
6 | // }; | 12 | // }; |
7 | // Ferdium.loop(getMessages); | 13 | // Ferdium.loop(getMessages); |
14 | |||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
8 | }; | 16 | }; |
diff --git a/recipes/zoho/package.json b/recipes/zoho/package.json index 7e4ea87..b1444d7 100644 --- a/recipes/zoho/package.json +++ b/recipes/zoho/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zoho", | 2 | "id": "zoho", |
3 | "name": "Zoho Mail", | 3 | "name": "Zoho Mail", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.zoho.com/mail/login.html", | 7 | "serviceURL": "https://www.zoho.com/mail/login.html", |
diff --git a/recipes/zoho/webview-unsafe.js b/recipes/zoho/webview-unsafe.js index eb83595..df5237b 100644 --- a/recipes/zoho/webview-unsafe.js +++ b/recipes/zoho/webview-unsafe.js | |||
@@ -1,12 +1,12 @@ | |||
1 | //wait for Ferdium and Zoho Mail to initialize | 1 | // wait for Ferdium and Zoho Mail to initialize |
2 | if ( | 2 | if ( |
3 | Object.prototype.hasOwnProperty.call(window, "ferdium") && | 3 | Object.prototype.hasOwnProperty.call(window, 'ferdium') && |
4 | Object.prototype.hasOwnProperty.call(window.ferdium, "setBadge") && | 4 | Object.prototype.hasOwnProperty.call(window.ferdium, 'setBadge') && |
5 | Object.prototype.hasOwnProperty.call(window, "zmNCenter") && | 5 | Object.prototype.hasOwnProperty.call(window, 'zmNCenter') && |
6 | Object.prototype.hasOwnProperty.call(window, "zmfolAction") | 6 | Object.prototype.hasOwnProperty.call(window, 'zmfolAction') |
7 | ) { | 7 | ) { |
8 | var unreadNotifications = window.zmNCenter.counter.count(); //General Notifications by Zoho (Bell Icon) | 8 | const unreadNotifications = window.zmNCenter.counter.count(); // General Notifications by Zoho (Bell Icon) |
9 | var unreadMail = window.zmfolAction.getUnreadViewCount(); //Unread messages count | 9 | const unreadMail = window.zmfolAction.getUnreadViewCount(); // Unread messages count |
10 | 10 | ||
11 | window.ferdium.setBadge(unreadMail, unreadNotifications); | 11 | window.ferdium.setBadge(unreadMail, unreadNotifications); |
12 | } | 12 | } |
diff --git a/recipes/zoho/webview.js b/recipes/zoho/webview.js index 02a5039..2643760 100644 --- a/recipes/zoho/webview.js +++ b/recipes/zoho/webview.js | |||
@@ -1,22 +1,26 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = (Ferdium) => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 9 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
8 | }; | 10 | }; |
9 | 11 | ||
10 | //Zoho uses different URLs for different regions. Find out which region the account belongs to and redirect to the correct URL. | 12 | // Zoho uses different URLs for different regions. Find out which region the account belongs to and redirect to the correct URL. |
11 | const redirectRegion = () => { | 13 | const redirectRegion = () => { |
12 | if (window.location.href === "https://www.zoho.com/mail/login.html") { | 14 | if (window.location.href === 'https://www.zoho.com/mail/login.html') { |
13 | const btn = document.querySelectorAll(".access-apps"); | 15 | const btn = document.querySelectorAll('.access-apps'); |
14 | if (btn.length > 0) { | 16 | if (btn.length > 0) { |
15 | window.location.assign(btn[0].href + "zm/"); | 17 | window.location.assign(`${btn[0].href}zm/`); |
16 | } | 18 | } |
17 | } | 19 | } |
18 | } | 20 | }; |
19 | 21 | ||
20 | window.addEventListener('load', redirectRegion); | 22 | window.addEventListener('load', redirectRegion); |
21 | Ferdium.loop(getMessages); | 23 | Ferdium.loop(getMessages); |
24 | |||
25 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | 26 | }; |
diff --git a/recipes/zoom/index.js b/recipes/zoom/index.js index 8fd90b1..dd41f72 100644 --- a/recipes/zoom/index.js +++ b/recipes/zoom/index.js | |||
@@ -1,2 +1 @@ | |||
1 | "use strict"; | module.exports = Ferdium => Ferdium; | |
2 | module.exports = Ferdium => Ferdium | ||
diff --git a/recipes/zoom/package.json b/recipes/zoom/package.json index 8be139d..92a9490 100644 --- a/recipes/zoom/package.json +++ b/recipes/zoom/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zoom", | 2 | "id": "zoom", |
3 | "name": "Zoom", | 3 | "name": "Zoom", |
4 | "version": "1.3.5", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://zoom.us/join", | 7 | "serviceURL": "https://zoom.us/join", |
diff --git a/recipes/zoom/webview.js b/recipes/zoom/webview.js index 45cc5b7..f606ac9 100644 --- a/recipes/zoom/webview.js +++ b/recipes/zoom/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = (Ferdium, settings) => { | 7 | module.exports = (Ferdium, settings) => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let directCount = 0; | 9 | let directCount = 0; |
@@ -27,23 +27,29 @@ module.exports = (Ferdium, settings) => { | |||
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
28 | 28 | ||
29 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences | 29 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences |
30 | document.addEventListener('click', event => { | 30 | document.addEventListener( |
31 | const link = event.target.closest('a[href^="http"]'); | 31 | 'click', |
32 | const button = event.target.closest('button[title^="http"]'); | 32 | event => { |
33 | 33 | const link = event.target.closest('a[href^="http"]'); | |
34 | if (link || button) { | 34 | const button = event.target.closest('button[title^="http"]'); |
35 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); | 35 | |
36 | 36 | if (link || button) { | |
37 | if (!Ferdium.isImage(link)) { | 37 | const url = link |
38 | event.preventDefault(); | 38 | ? link.getAttribute('href') |
39 | event.stopPropagation(); | 39 | : button.getAttribute('title'); |
40 | 40 | ||
41 | if (settings.trapLinkClicks === true) { | 41 | if (!Ferdium.isImage(link)) { |
42 | window.location.href = url; | 42 | event.preventDefault(); |
43 | } else { | 43 | event.stopPropagation(); |
44 | Ferdium.openNewWindow(url); | 44 | |
45 | if (settings.trapLinkClicks === true) { | ||
46 | window.location.href = url; | ||
47 | } else { | ||
48 | Ferdium.openNewWindow(url); | ||
49 | } | ||
45 | } | 50 | } |
46 | } | 51 | } |
47 | } | 52 | }, |
48 | }, true); | 53 | true, |
54 | ); | ||
49 | }; | 55 | }; |
diff --git a/recipes/zulip/index.js b/recipes/zulip/index.js index 13c94b7..ea3944f 100644 --- a/recipes/zulip/index.js +++ b/recipes/zulip/index.js | |||
@@ -1,21 +1,25 @@ | |||
1 | module.exports = Ferdium => class Zulip extends Ferdium { | 1 | module.exports = Ferdium => |
2 | async validateUrl(url) { | 2 | class Zulip extends Ferdium { |
3 | const baseUrl = new window.URL(url); | 3 | async validateUrl(url) { |
4 | const apiVersion = 'api/v1'; | 4 | const baseUrl = new window.URL(url); |
5 | try { | 5 | const apiVersion = 'api/v1'; |
6 | const resp = await window.fetch(`${baseUrl.origin}/${apiVersion}/server_settings`, { | 6 | try { |
7 | method: 'GET', | 7 | const resp = await window.fetch( |
8 | headers: { | 8 | `${baseUrl.origin}/${apiVersion}/server_settings`, |
9 | 'Content-Type': 'application/json', | 9 | { |
10 | }, | 10 | method: 'GET', |
11 | }); | 11 | headers: { |
12 | const data = await resp.json(); | 12 | 'Content-Type': 'application/json', |
13 | }, | ||
14 | }, | ||
15 | ); | ||
16 | const data = await resp.json(); | ||
13 | 17 | ||
14 | return Object.hasOwnProperty.call(data, 'realm_uri'); | 18 | return Object.hasOwnProperty.call(data, 'realm_uri'); |
15 | } catch (error) { | 19 | } catch (error) { |
16 | console.error(error); | 20 | console.error(error); |
17 | } | 21 | } |
18 | 22 | ||
19 | return false; | 23 | return false; |
20 | } | 24 | } |
21 | }; | 25 | }; |
diff --git a/recipes/zulip/package.json b/recipes/zulip/package.json index cbe516b..dce1826 100644 --- a/recipes/zulip/package.json +++ b/recipes/zulip/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zulip", | 2 | "id": "zulip", |
3 | "name": "Zulip", | 3 | "name": "Zulip", |
4 | "version": "1.2.1", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasNotificationSound": true, | 7 | "hasNotificationSound": true, |
diff --git a/recipes/zulip/webview.js b/recipes/zulip/webview.js index 1989809..707b723 100644 --- a/recipes/zulip/webview.js +++ b/recipes/zulip/webview.js | |||
@@ -1,4 +1,17 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | function getUnreadCount(eltClassName) { | ||
9 | const elt = document.querySelectorAll( | ||
10 | `#global_filters .${eltClassName} .unread_count`, | ||
11 | )[0]; | ||
12 | return elt === null ? 0 : Ferdium.safeParseInt(elt.textContent); | ||
13 | } | ||
14 | |||
2 | const getMessages = () => { | 15 | const getMessages = () => { |
3 | // All unread messages | 16 | // All unread messages |
4 | const unreadAll = getUnreadCount('top_left_all_messages'); | 17 | const unreadAll = getUnreadCount('top_left_all_messages'); |
@@ -17,8 +30,5 @@ module.exports = Ferdium => { | |||
17 | 30 | ||
18 | Ferdium.loop(getMessages); | 31 | Ferdium.loop(getMessages); |
19 | 32 | ||
20 | function getUnreadCount(eltClassName) { | 33 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
21 | const elt = document.querySelectorAll(`#global_filters .${eltClassName} .unread_count`)[0]; | ||
22 | return elt == null ? 0 : Ferdium.safeParseInt(elt.textContent); | ||
23 | } | ||
24 | }; | 34 | }; |
diff --git a/scripts/create.js b/scripts/create.js index 199a23b..158b2f2 100644 --- a/scripts/create.js +++ b/scripts/create.js | |||
@@ -1,3 +1,4 @@ | |||
1 | /* eslint-disable no-console */ | ||
1 | /** | 2 | /** |
2 | * Create a new recipe for your service | 3 | * Create a new recipe for your service |
3 | */ | 4 | */ |
@@ -18,19 +19,15 @@ pnpm create WhatsApp FerdiumDev | |||
18 | } | 19 | } |
19 | 20 | ||
20 | const recipeName = process.argv[2]; | 21 | const recipeName = process.argv[2]; |
21 | const recipe = recipeName.toLowerCase().replace(/\s/g, '-'); | 22 | const recipe = recipeName.toLowerCase().replaceAll(/\s/g, '-'); |
22 | const folderName = process.argv[3] || 'Ferdium'; | 23 | const folderName = process.argv[3] || 'Ferdium'; |
23 | const filesThatNeedTextReplace = [ | 24 | const filesThatNeedTextReplace = ['package.json', 'index.js', 'webview.js']; |
24 | 'package.json', | ||
25 | 'index.js', | ||
26 | 'webview.js', | ||
27 | ]; | ||
28 | 25 | ||
29 | const toPascalCase = (str) => { | 26 | const toPascalCase = str => { |
30 | const words = str | 27 | const words = str |
31 | .replace(/[^a-z]/g, '') | 28 | .replaceAll(/[^a-z]/g, '') |
32 | .split(/\W/) | 29 | .split(/\W/) |
33 | .map((word) => { | 30 | .map(word => { |
34 | if (word.length === 0) { | 31 | if (word.length === 0) { |
35 | return word; | 32 | return word; |
36 | } | 33 | } |
@@ -38,16 +35,16 @@ const toPascalCase = (str) => { | |||
38 | return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); | 35 | return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); |
39 | }); | 36 | }); |
40 | return words.join(''); | 37 | return words.join(''); |
41 | } | 38 | }; |
42 | const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only containing a-z, for usage as the JavaScript class name | 39 | const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only containing a-z, for usage as the JavaScript class name |
43 | 40 | ||
44 | (async () => { | 41 | (async () => { |
45 | // Folder paths | 42 | // Folder paths |
46 | const userData = | 43 | const userData = |
47 | process.env.APPDATA || | 44 | process.env.APPDATA || |
48 | (process.platform == 'darwin' | 45 | (process.platform === 'darwin' |
49 | ? process.env.HOME + '/Library/Application Support' | 46 | ? `${process.env.HOME}/Library/Application Support` |
50 | : process.env.HOME + '/.config'); | 47 | : `${process.env.HOME}/.config`); |
51 | const recipesFolder = path.join(userData, folderName, 'recipes'); | 48 | const recipesFolder = path.join(userData, folderName, 'recipes'); |
52 | const devRecipeFolder = path.join(recipesFolder, 'dev'); | 49 | const devRecipeFolder = path.join(recipesFolder, 'dev'); |
53 | const newRecipeFolder = path.join(devRecipeFolder, recipe); | 50 | const newRecipeFolder = path.join(devRecipeFolder, recipe); |
@@ -60,7 +57,7 @@ const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only cont | |||
60 | ); | 57 | ); |
61 | return; | 58 | return; |
62 | } | 59 | } |
63 | await fs.ensureDir(devRecipeFolder); | 60 | fs.ensureDirSync(devRecipeFolder); |
64 | 61 | ||
65 | if (fs.existsSync(newRecipeFolder)) { | 62 | if (fs.existsSync(newRecipeFolder)) { |
66 | console.log('⚠️ Recipe already exists'); | 63 | console.log('⚠️ Recipe already exists'); |
@@ -70,17 +67,17 @@ const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only cont | |||
70 | console.log('[Info] Passed pre-checks'); | 67 | console.log('[Info] Passed pre-checks'); |
71 | 68 | ||
72 | // Copy sample recipe to recipe folder | 69 | // Copy sample recipe to recipe folder |
73 | await fs.copy(sampleRecipe, newRecipeFolder); | 70 | fs.copySync(sampleRecipe, newRecipeFolder); |
74 | console.log('[Info] Copied recipe'); | 71 | console.log('[Info] Copied recipe'); |
75 | 72 | ||
76 | // Replace placeholders with the recipe-specific values | 73 | // Replace placeholders with the recipe-specific values |
77 | for (const file of filesThatNeedTextReplace) { | 74 | for (const file of filesThatNeedTextReplace) { |
78 | const filePath = path.join(newRecipeFolder, file); | 75 | const filePath = path.join(newRecipeFolder, file); |
79 | let contents = await fs.readFile(filePath, 'utf8'); | 76 | let contents = fs.readFileSync(filePath, 'utf8'); |
80 | contents = contents.replace(/SERVICE/g, recipe); | 77 | contents = contents.replace(/SERVICE/g, recipe); |
81 | contents = contents.replace(/SNAME/g, recipeName); | 78 | contents = contents.replace(/SNAME/g, recipeName); |
82 | contents = contents.replace(/SPASCAL/g, pascalCasedName); | 79 | contents = contents.replace(/SPASCAL/g, pascalCasedName); |
83 | await fs.writeFile(filePath, contents); | 80 | fs.writeFileSync(filePath, contents); |
84 | } | 81 | } |
85 | console.log('[Info] Prepared new recipe'); | 82 | console.log('[Info] Prepared new recipe'); |
86 | 83 | ||
diff --git a/scripts/package.js b/scripts/package.js index e1e3d5c..0482775 100644 --- a/scripts/package.js +++ b/scripts/package.js | |||
@@ -1,3 +1,4 @@ | |||
1 | /* eslint-disable no-console */ | ||
1 | /** | 2 | /** |
2 | * Package all recipes | 3 | * Package all recipes |
3 | */ | 4 | */ |
@@ -6,7 +7,8 @@ const fs = require('fs-extra'); | |||
6 | const path = require('path'); | 7 | const path = require('path'); |
7 | const sizeOf = require('image-size'); | 8 | const sizeOf = require('image-size'); |
8 | const simpleGit = require('simple-git'); | 9 | const simpleGit = require('simple-git'); |
9 | const pkgVersionChangedMatcher = new RegExp(/\n\+.*version.*/); | 10 | |
11 | const pkgVersionChangedMatcher = /\n\+.*version.*/; | ||
10 | 12 | ||
11 | // Publicly availible link to this repository's recipe folder | 13 | // Publicly availible link to this repository's recipe folder |
12 | // Used for generating public icon URLs | 14 | // Used for generating public icon URLs |
@@ -21,7 +23,7 @@ const compress = (src, dest) => | |||
21 | dest, | 23 | dest, |
22 | tar: { | 24 | tar: { |
23 | // Don't package .DS_Store files and .md files | 25 | // Don't package .DS_Store files and .md files |
24 | ignore: function (name) { | 26 | ignore(name) { |
25 | return path.basename(name) === '.DS_Store' || name.endsWith('.md'); | 27 | return path.basename(name) === '.DS_Store' || name.endsWith('.md'); |
26 | }, | 28 | }, |
27 | }, | 29 | }, |
@@ -63,18 +65,19 @@ const compress = (src, dest) => | |||
63 | .filter(dir => dir.isDirectory()) | 65 | .filter(dir => dir.isDirectory()) |
64 | .map(dir => dir.name); | 66 | .map(dir => dir.name); |
65 | 67 | ||
66 | for (let recipe of availableRecipes) { | 68 | for (const recipe of availableRecipes) { |
67 | const recipeSrc = path.join(recipesFolder, recipe); | 69 | const recipeSrc = path.join(recipesFolder, recipe); |
68 | const mandatoryFiles = ['package.json', 'icon.svg', 'webview.js']; | 70 | const mandatoryFiles = ['package.json', 'icon.svg', 'webview.js']; |
69 | 71 | ||
70 | // Check that each mandatory file exists | 72 | // Check that each mandatory file exists |
71 | for (let file of mandatoryFiles) { | 73 | for (const file of mandatoryFiles) { |
72 | const filePath = path.join(recipeSrc, file); | 74 | const filePath = path.join(recipeSrc, file); |
75 | // eslint-disable-next-line no-await-in-loop | ||
73 | if (!(await fs.pathExists(filePath))) { | 76 | if (!(await fs.pathExists(filePath))) { |
74 | console.log( | 77 | console.log( |
75 | `⚠️ Couldn't package "${recipe}": Folder doesn't contain a "${file}".`, | 78 | `⚠️ Couldn't package "${recipe}": Folder doesn't contain a "${file}".`, |
76 | ); | 79 | ); |
77 | unsuccessful++; | 80 | unsuccessful += 1; |
78 | } | 81 | } |
79 | } | 82 | } |
80 | if (unsuccessful > 0) { | 83 | if (unsuccessful > 0) { |
@@ -89,22 +92,24 @@ const compress = (src, dest) => | |||
89 | console.log( | 92 | console.log( |
90 | `⚠️ Couldn't package "${recipe}": Recipe SVG icon isn't a square`, | 93 | `⚠️ Couldn't package "${recipe}": Recipe SVG icon isn't a square`, |
91 | ); | 94 | ); |
92 | unsuccessful++; | 95 | unsuccessful += 1; |
93 | continue; | 96 | continue; |
94 | } | 97 | } |
95 | 98 | ||
96 | // Check that user.js does not exist | 99 | // Check that user.js does not exist |
97 | const userJs = path.join(recipeSrc, 'user.js'); | 100 | const userJs = path.join(recipeSrc, 'user.js'); |
101 | // eslint-disable-next-line no-await-in-loop | ||
98 | if (await fs.pathExists(userJs)) { | 102 | if (await fs.pathExists(userJs)) { |
99 | console.log( | 103 | console.log( |
100 | `⚠️ Couldn't package "${recipe}": Folder contains a "user.js".`, | 104 | `⚠️ Couldn't package "${recipe}": Folder contains a "user.js".`, |
101 | ); | 105 | ); |
102 | unsuccessful++; | 106 | unsuccessful += 1; |
103 | continue; | 107 | continue; |
104 | } | 108 | } |
105 | 109 | ||
106 | // Read package.json | 110 | // Read package.json |
107 | const packageJson = path.join(recipeSrc, 'package.json'); | 111 | const packageJson = path.join(recipeSrc, 'package.json'); |
112 | // eslint-disable-next-line no-await-in-loop | ||
108 | const config = await fs.readJson(packageJson); | 113 | const config = await fs.readJson(packageJson); |
109 | 114 | ||
110 | // Make sure it contains all required fields | 115 | // Make sure it contains all required fields |
@@ -112,10 +117,10 @@ const compress = (src, dest) => | |||
112 | console.log( | 117 | console.log( |
113 | `⚠️ Couldn't package "${recipe}": Could not read or parse "package.json"`, | 118 | `⚠️ Couldn't package "${recipe}": Could not read or parse "package.json"`, |
114 | ); | 119 | ); |
115 | unsuccessful++; | 120 | unsuccessful += 1; |
116 | continue; | 121 | continue; |
117 | } | 122 | } |
118 | let configErrors = []; | 123 | const configErrors = []; |
119 | if (!config.id) { | 124 | if (!config.id) { |
120 | configErrors.push( | 125 | configErrors.push( |
121 | "The recipe's package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)", | 126 | "The recipe's package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)", |
@@ -227,6 +232,7 @@ const compress = (src, dest) => | |||
227 | const relativeRepoSrc = path.relative(repoRoot, recipeSrc); | 232 | const relativeRepoSrc = path.relative(repoRoot, recipeSrc); |
228 | 233 | ||
229 | // Check for changes in recipe's directory, and if changes are present, then the changes should contain a version bump | 234 | // Check for changes in recipe's directory, and if changes are present, then the changes should contain a version bump |
235 | // eslint-disable-next-line no-await-in-loop | ||
230 | await git.diffSummary(relativeRepoSrc, (err, result) => { | 236 | await git.diffSummary(relativeRepoSrc, (err, result) => { |
231 | if (err) { | 237 | if (err) { |
232 | configErrors.push( | 238 | configErrors.push( |
@@ -239,11 +245,7 @@ const compress = (src, dest) => | |||
239 | result.deletions !== 0) | 245 | result.deletions !== 0) |
240 | ) { | 246 | ) { |
241 | const pkgJsonRelative = path.relative(repoRoot, packageJson); | 247 | const pkgJsonRelative = path.relative(repoRoot, packageJson); |
242 | if (!result.files.some(({ file }) => file === pkgJsonRelative)) { | 248 | if (result.files.some(({ file }) => file === pkgJsonRelative)) { |
243 | configErrors.push( | ||
244 | `Found changes in '${relativeRepoSrc}' without the corresponding version bump in '${pkgJsonRelative}'`, | ||
245 | ); | ||
246 | } else { | ||
247 | git.diff(pkgJsonRelative, (_diffErr, diffResult) => { | 249 | git.diff(pkgJsonRelative, (_diffErr, diffResult) => { |
248 | if (diffResult && !pkgVersionChangedMatcher.test(diffResult)) { | 250 | if (diffResult && !pkgVersionChangedMatcher.test(diffResult)) { |
249 | configErrors.push( | 251 | configErrors.push( |
@@ -251,6 +253,10 @@ const compress = (src, dest) => | |||
251 | ); | 253 | ); |
252 | } | 254 | } |
253 | }); | 255 | }); |
256 | } else { | ||
257 | configErrors.push( | ||
258 | `Found changes in '${relativeRepoSrc}' without the corresponding version bump in '${pkgJsonRelative}'`, | ||
259 | ); | ||
254 | } | 260 | } |
255 | } | 261 | } |
256 | }); | 262 | }); |
@@ -259,14 +265,14 @@ const compress = (src, dest) => | |||
259 | if (configErrors.length > 0) { | 265 | if (configErrors.length > 0) { |
260 | console.log(`⚠️ Couldn't package "${recipe}": There were errors in the recipe's package.json: | 266 | console.log(`⚠️ Couldn't package "${recipe}": There were errors in the recipe's package.json: |
261 | ${configErrors.reduce((str, err) => `${str}\n${err}`)}`); | 267 | ${configErrors.reduce((str, err) => `${str}\n${err}`)}`); |
262 | unsuccessful++; | 268 | unsuccessful += 1; |
263 | } | 269 | } |
264 | 270 | ||
265 | if (!fs.existsSync(path.join(recipeSrc, 'index.js'))) { | 271 | if (!fs.existsSync(path.join(recipeSrc, 'index.js'))) { |
266 | console.log( | 272 | console.log( |
267 | `⚠️ Couldn't package "${recipe}": The recipe doesn't contain a "index.js"`, | 273 | `⚠️ Couldn't package "${recipe}": The recipe doesn't contain a "index.js"`, |
268 | ); | 274 | ); |
269 | unsuccessful++; | 275 | unsuccessful += 1; |
270 | } | 276 | } |
271 | 277 | ||
272 | // Package to .tar.gz | 278 | // Package to .tar.gz |
@@ -289,9 +295,9 @@ const compress = (src, dest) => | |||
289 | 295 | ||
290 | // Sort package list alphabetically | 296 | // Sort package list alphabetically |
291 | recipeList = recipeList.sort((a, b) => { | 297 | recipeList = recipeList.sort((a, b) => { |
292 | let textA = a.id.toLowerCase(); | 298 | const textA = a.id.toLowerCase(); |
293 | let textB = b.id.toLowerCase(); | 299 | const textB = b.id.toLowerCase(); |
294 | return textA < textB ? -1 : (textA > textB ? 1 : 0); | 300 | return textA < textB ? -1 : textA > textB ? 1 : 0; |
295 | }); | 301 | }); |
296 | await fs.writeJson(allJson, recipeList, { | 302 | await fs.writeJson(allJson, recipeList, { |
297 | spaces: 2, | 303 | spaces: 2, |
diff --git a/scripts/sample_recipe/webview.js b/scripts/sample_recipe/webview.js index 86bb422..2a81dec 100644 --- a/scripts/sample_recipe/webview.js +++ b/scripts/sample_recipe/webview.js | |||
@@ -1,9 +1,9 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | 1 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | 2 | return obj && obj.__esModule ? obj : { default: obj }; |
5 | } | 3 | } |
6 | 4 | ||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges |
9 | // const getMessages = () => { | 9 | // const getMessages = () => { |