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 /recipes/msteams | |
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>
Diffstat (limited to 'recipes/msteams')
-rw-r--r-- | recipes/msteams/index.js | 37 | ||||
-rw-r--r-- | recipes/msteams/package.json | 2 | ||||
-rw-r--r-- | recipes/msteams/webview.js | 11 |
3 files changed, 28 insertions, 22 deletions
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 | }; |