From 155c4b832281348c16be1f4ef667e6e23dbf1bd8 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Fri, 27 Aug 2021 18:13:24 +0530 Subject: chore: normalized all recipes to ensure compatibility with es6 (#639) - Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm. --- recipes/superhuman-email/index.js | 17 ++++++----------- recipes/superhuman-email/package.json | 2 +- recipes/superhuman-email/webview.js | 11 ++++------- 3 files changed, 11 insertions(+), 19 deletions(-) (limited to 'recipes/superhuman-email') diff --git a/recipes/superhuman-email/index.js b/recipes/superhuman-email/index.js index 7277aa7..44bc55d 100644 --- a/recipes/superhuman-email/index.js +++ b/recipes/superhuman-email/index.js @@ -1,11 +1,6 @@ -// 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"; } }; +module.exports = Ferdi => class SuperHuman extends Ferdi { + overrideUserAgent() { + // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdi + 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'; + } +}; diff --git a/recipes/superhuman-email/package.json b/recipes/superhuman-email/package.json index 06eccfd..53509cb 100644 --- a/recipes/superhuman-email/package.json +++ b/recipes/superhuman-email/package.json @@ -1,7 +1,7 @@ { "id": "superhuman", "name": "superhuman", - "version": "1.0.2", + "version": "1.1.0", "license": "MIT", "repository": "https://github.com/CrystalLarsh/franz-superhuman-recipe", "config": { diff --git a/recipes/superhuman-email/webview.js b/recipes/superhuman-email/webview.js index 8a6ba8e..697efa6 100644 --- a/recipes/superhuman-email/webview.js +++ b/recipes/superhuman-email/webview.js @@ -1,11 +1,8 @@ -module.exports = (Franz, options) => { +module.exports = (Ferdi) => { const getMessages = () => { - // Get the number of mentions const mentions = document.querySelectorAll('.chat-line .mentioned').length; - - Franz.setBadge(mentions, 0); + Ferdi.setBadge(mentions, 0); }; - // check for new messages every second and update Franz badge - Franz.loop(getMessages); + + Ferdi.loop(getMessages); }; -// # sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXRjaC93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsIm9wdGlvbnMiLCJnZXRNZXNzYWdlcyIsIm1lbnRpb25zIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQWlCLENBQUNDLEtBQUQsRUFBUUMsT0FBUixLQUFvQjtBQUNuQyxRQUFNQyxjQUFjLE1BQU07QUFDeEI7QUFDQSxVQUFNQyxXQUFXQyxTQUFTQyxnQkFBVCxDQUEwQix1QkFBMUIsRUFBbURDLE1BQXBFOztBQUVBTixVQUFNTyxRQUFOLENBQWVKLFFBQWYsRUFBeUIsQ0FBekI7QUFDRCxHQUxEO0FBTUE7QUFDQUgsUUFBTVEsSUFBTixDQUFXTixXQUFYO0FBQ0QsQ0FURCIsImZpbGUiOiJ0d2l0Y2gvd2Vidmlldy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm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