From 728d339739b63e9bb59e457e4a84fe9a65b93fc9 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Sat, 28 Sep 2019 12:10:25 +0200 Subject: Add uncompressed recipes --- uncompressed/msteams/icon.svg | 1 + uncompressed/msteams/index.js | 8 ++++++++ uncompressed/msteams/package.json | 13 +++++++++++++ uncompressed/msteams/service.css | 3 +++ uncompressed/msteams/webview.js | 29 +++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 uncompressed/msteams/icon.svg create mode 100644 uncompressed/msteams/index.js create mode 100644 uncompressed/msteams/package.json create mode 100644 uncompressed/msteams/service.css create mode 100644 uncompressed/msteams/webview.js (limited to 'uncompressed/msteams') diff --git a/uncompressed/msteams/icon.svg b/uncompressed/msteams/icon.svg new file mode 100644 index 0000000..09b454e --- /dev/null +++ b/uncompressed/msteams/icon.svg @@ -0,0 +1 @@ +icon \ No newline at end of file diff --git a/uncompressed/msteams/index.js b/uncompressed/msteams/index.js new file mode 100644 index 0000000..0afc5c9 --- /dev/null +++ b/uncompressed/msteams/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = Franz => class MicrosoftTeams extends Franz { + overrideUserAgent() { + return window.navigator.userAgent.replace(/(Franz|Electron)([^\s]+\s)/g, '').replace(/(Chrome\/)([^ ]*)/g, '$163.0.3239.84'); + } + +}; \ No newline at end of file diff --git a/uncompressed/msteams/package.json b/uncompressed/msteams/package.json new file mode 100644 index 0000000..037b3c4 --- /dev/null +++ b/uncompressed/msteams/package.json @@ -0,0 +1,13 @@ +{ + "id": "msteams", + "name": "Microsoft Teams", + "version": "1.1.0", + "description": "Microsoft Teams", + "main": "index.js", + "author": "Stefan Malzner ", + "license": "MIT", + "config": { + "serviceURL": "https://teams.microsoft.com", + "hasNotificationSound": true + } +} diff --git a/uncompressed/msteams/service.css b/uncompressed/msteams/service.css new file mode 100644 index 0000000..533004f --- /dev/null +++ b/uncompressed/msteams/service.css @@ -0,0 +1,3 @@ +notification-banner { + display: none !important; +} diff --git a/uncompressed/msteams/webview.js b/uncompressed/msteams/webview.js new file mode 100644 index 0000000..d614097 --- /dev/null +++ b/uncompressed/msteams/webview.js @@ -0,0 +1,29 @@ +"use strict"; + +const path = require('path'); + +window.electronSafeIpc = { + send: () => null, + on: () => null +}; +window.desktop = undefined; + +module.exports = Franz => { + const getMessages = () => { + let messages = 0; + const badge = document.querySelector('.activity-badge.dot-activity-badge .activity-badge'); + + if (badge) { + const value = parseInt(badge.innerHTML, 10); + + if (!isNaN(value)) { + messages = value; + } + } + + Franz.setBadge(messages); + }; + + Franz.injectCSS(path.join(__dirname, 'service.css')); + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2