From 5e56414aa64b339dfdd817a8e49e08c5179d3bdd Mon Sep 17 00:00:00 2001 From: Vijay A Date: Tue, 29 Jun 2021 13:27:15 +0530 Subject: Adding new recipe: Superhuman (Fixes #573) --- recipes/superhuman-email/LICENSE | 21 +++++++++++++++++++++ recipes/superhuman-email/README.md | 5 +++++ recipes/superhuman-email/icon.png | Bin 0 -> 750994 bytes recipes/superhuman-email/icon.svg | 31 +++++++++++++++++++++++++++++++ recipes/superhuman-email/index.js | 11 +++++++++++ recipes/superhuman-email/package.json | 13 +++++++++++++ recipes/superhuman-email/webview.js | 13 +++++++++++++ 7 files changed, 94 insertions(+) create mode 100644 recipes/superhuman-email/LICENSE create mode 100644 recipes/superhuman-email/README.md create mode 100644 recipes/superhuman-email/icon.png create mode 100644 recipes/superhuman-email/icon.svg create mode 100644 recipes/superhuman-email/index.js create mode 100644 recipes/superhuman-email/package.json create mode 100644 recipes/superhuman-email/webview.js (limited to 'recipes') diff --git a/recipes/superhuman-email/LICENSE b/recipes/superhuman-email/LICENSE new file mode 100644 index 0000000..fcf56e2 --- /dev/null +++ b/recipes/superhuman-email/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 CrystalLarsh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/recipes/superhuman-email/README.md b/recipes/superhuman-email/README.md new file mode 100644 index 0000000..d83f846 --- /dev/null +++ b/recipes/superhuman-email/README.md @@ -0,0 +1,5 @@ +# Custom Websites for Franz +This is the official Franz recipe for adding Superhuman to Franz + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/superhuman-email/icon.png b/recipes/superhuman-email/icon.png new file mode 100644 index 0000000..0229b72 Binary files /dev/null and b/recipes/superhuman-email/icon.png differ diff --git a/recipes/superhuman-email/icon.svg b/recipes/superhuman-email/icon.svg new file mode 100644 index 0000000..b27dc23 --- /dev/null +++ b/recipes/superhuman-email/icon.svg @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/recipes/superhuman-email/index.js b/recipes/superhuman-email/index.js new file mode 100644 index 0000000..311ff8f --- /dev/null +++ b/recipes/superhuman-email/index.js @@ -0,0 +1,11 @@ +// just pass through Franz - Superhuman tab appears, says needs Chrome +// module.exports = Franz => Franz; + +// tried the whole string from the issue example - Superhuman tab appears, says needs Chrome +// module.exports = Franz => class useragent extends Franz { overrideUserAgent() { 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"; } }; + +// updated class name to superhuman - Superhuman tab appears, says needs Chrome +module.exports = Franz => class superhuman extends Franz { overrideUserAgent() { 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"; } }; + +// Tried shortening to just Chrome lol - Superhuman tab appears, says needs Chrome +// module.exports = Franz => class superhuman extends Franz { overrideUserAgent() {return "Chrome"; } }; diff --git a/recipes/superhuman-email/package.json b/recipes/superhuman-email/package.json new file mode 100644 index 0000000..8f0b2c5 --- /dev/null +++ b/recipes/superhuman-email/package.json @@ -0,0 +1,13 @@ +{ + "id": "superhuman", + "name": "superhuman", + "version": "1.0.0", + "description": "View tool for Gmail", + "main": "index.js", + "author": "Crystal Larsh ", + "license": "MIT", + "repository": "https://github.com/CrystalLarsh/franz-superhuman-recipe", + "config": { + "hasCustomUrl": true + } +} diff --git a/recipes/superhuman-email/webview.js b/recipes/superhuman-email/webview.js new file mode 100644 index 0000000..2719e25 --- /dev/null +++ b/recipes/superhuman-email/webview.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = (Franz, options) => { + const getMessages = () => { + // Get the number of mentions + const mentions = document.querySelectorAll('.chat-line .mentioned').length; + + Franz.setBadge(mentions, 0); + }; + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXRjaC93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsIm9wdGlvbnMiLCJnZXRNZXNzYWdlcyIsIm1lbnRpb25zIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQWlCLENBQUNDLEtBQUQsRUFBUUMsT0FBUixLQUFvQjtBQUNuQyxRQUFNQyxjQUFjLE1BQU07QUFDeEI7QUFDQSxVQUFNQyxXQUFXQyxTQUFTQyxnQkFBVCxDQUEwQix1QkFBMUIsRUFBbURDLE1BQXBFOztBQUVBTixVQUFNTyxRQUFOLENBQWVKLFFBQWYsRUFBeUIsQ0FBekI7QUFDRCxHQUxEO0FBTUE7QUFDQUgsUUFBTVEsSUFBTixDQUFXTixXQUFYO0FBQ0QsQ0FURCIsImZpbGUiOiJ0d2l0Y2gvd2Vidmlldy5qcyIsInNvdXJjZXNDb250ZW50Ijp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