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/discord/README.md | 5 +++++ uncompressed/discord/icon.svg | 14 ++++++++++++++ uncompressed/discord/index.js | 10 ++++++++++ uncompressed/discord/package.json | 23 +++++++++++++++++++++++ uncompressed/discord/service.css | 3 +++ uncompressed/discord/webview.js | 16 ++++++++++++++++ 6 files changed, 71 insertions(+) create mode 100644 uncompressed/discord/README.md create mode 100644 uncompressed/discord/icon.svg create mode 100644 uncompressed/discord/index.js create mode 100644 uncompressed/discord/package.json create mode 100644 uncompressed/discord/service.css create mode 100644 uncompressed/discord/webview.js (limited to 'uncompressed/discord') diff --git a/uncompressed/discord/README.md b/uncompressed/discord/README.md new file mode 100644 index 0000000..0b49f8a --- /dev/null +++ b/uncompressed/discord/README.md @@ -0,0 +1,5 @@ +# Discord for Franz +This is the official Franz recipe for Discord + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/uncompressed/discord/icon.svg b/uncompressed/discord/icon.svg new file mode 100644 index 0000000..dc76ff8 --- /dev/null +++ b/uncompressed/discord/icon.svg @@ -0,0 +1,14 @@ + + + + discord + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/uncompressed/discord/index.js b/uncompressed/discord/index.js new file mode 100644 index 0000000..629d7c7 --- /dev/null +++ b/uncompressed/discord/index.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = Franz => class Discord extends Franz { + overrideUserAgent() { + const useragent = window.navigator.userAgent; + const parts = useragent.split('(KHTML, like Gecko)'); + return parts.join('(KHTML, like Gecko) discord/0.0.250').replace('Electron', 'Discord').replace('Franz', 'Discord'); + } + +}; \ No newline at end of file diff --git a/uncompressed/discord/package.json b/uncompressed/discord/package.json new file mode 100644 index 0000000..47818b5 --- /dev/null +++ b/uncompressed/discord/package.json @@ -0,0 +1,23 @@ +{ + "id": "discord", + "name": "Discord", + "version": "1.0.3", + "description": "Discord", + "main": "index.js", + "author": "Stefan Malzner ", + "license": "MIT", + "config": { + "serviceURL": "https://discordapp.com/login", + "message": "", + "popup": [], + "hasNotificationSound": true, + "hasDirectMessages": true, + "hasIndirectMessages": false, + "hasTeamID": false, + "hasPredefinedUrl": true, + "hasCustomUrl": false, + "webviewOptions": { + "disablewebsecurity": "" + } + } +} diff --git a/uncompressed/discord/service.css b/uncompressed/discord/service.css new file mode 100644 index 0000000..a16a615 --- /dev/null +++ b/uncompressed/discord/service.css @@ -0,0 +1,3 @@ +.notice { + display: none; +} diff --git a/uncompressed/discord/webview.js b/uncompressed/discord/webview.js new file mode 100644 index 0000000..9a72420 --- /dev/null +++ b/uncompressed/discord/webview.js @@ -0,0 +1,16 @@ +"use strict"; + +var _path = _interopRequireDefault(require("path")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = Franz => { + const getMessages = function getMessages() { + const direct = document.querySelectorAll('[class^="guildsWrapper"] [class*="badge"]').length; + const indirect = document.querySelectorAll('[class^="guildsWrapper"] [class^="guild-"]+[class*="unread-"]').length; + Franz.setBadge(direct, indirect); + }; + + Franz.loop(getMessages); + Franz.injectCSS(_path.default.join(__dirname, 'service.css')); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2