From 786ca4fd25323d919ca6d9ec1851e6e53b70a303 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 4 Oct 2020 18:20:12 +0530 Subject: Added recipe for yahoo mail. --- recipes/yahoo-mail/LICENSE | 21 ++ recipes/yahoo-mail/icon.png | Bin 0 -> 49847 bytes recipes/yahoo-mail/icon.svg | 697 ++++++++++++++++++++++++++++++++++++++++ recipes/yahoo-mail/index.js | 15 + recipes/yahoo-mail/package.json | 24 ++ recipes/yahoo-mail/webview.js | 11 + 6 files changed, 768 insertions(+) create mode 100644 recipes/yahoo-mail/LICENSE create mode 100644 recipes/yahoo-mail/icon.png create mode 100644 recipes/yahoo-mail/icon.svg create mode 100644 recipes/yahoo-mail/index.js create mode 100644 recipes/yahoo-mail/package.json create mode 100644 recipes/yahoo-mail/webview.js diff --git a/recipes/yahoo-mail/LICENSE b/recipes/yahoo-mail/LICENSE new file mode 100644 index 0000000..99d6f23 --- /dev/null +++ b/recipes/yahoo-mail/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Vijay Raghavan Aravamudhan + +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/yahoo-mail/icon.png b/recipes/yahoo-mail/icon.png new file mode 100644 index 0000000..5f8a431 Binary files /dev/null and b/recipes/yahoo-mail/icon.png differ diff --git a/recipes/yahoo-mail/icon.svg b/recipes/yahoo-mail/icon.svg new file mode 100644 index 0000000..6db3cf5 --- /dev/null +++ b/recipes/yahoo-mail/icon.svg @@ -0,0 +1,697 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/recipes/yahoo-mail/index.js b/recipes/yahoo-mail/index.js new file mode 100644 index 0000000..599e93c --- /dev/null +++ b/recipes/yahoo-mail/index.js @@ -0,0 +1,15 @@ +module.exports = (Franz) => + class YahooMail extends Franz { + modifyRequestHeaders() { + return [ + { + headers: { + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', + }, + requestFilters: { + urls: ['*://*/*'], + } + } + ] + } + }; diff --git a/recipes/yahoo-mail/package.json b/recipes/yahoo-mail/package.json new file mode 100644 index 0000000..c4b4d0f --- /dev/null +++ b/recipes/yahoo-mail/package.json @@ -0,0 +1,24 @@ +{ + "id": "yahooMail", + "name": "yahoo-mail", + "version": "1.0.0", + "description": "Yahoo Mail recipe for Franz", + "main": "index.js", + "author": "Vijay Raghavan Aravamudhan ", + "license": "MIT", + "config": { + "serviceURL": "https://mail.yahoo.com", + "serviceName": "YahooMail", + "message": "", + "popup": [], + "hasNotificationSound": true, + "hasIndirectMessages": false, + "hasTeamID": false, + "customURL": false, + "hostedOnly": false, + "webviewOptions": { + "disablewebsecurity": "" + }, + "openDevTools": false + } +} diff --git a/recipes/yahoo-mail/webview.js b/recipes/yahoo-mail/webview.js new file mode 100644 index 0000000..1027838 --- /dev/null +++ b/recipes/yahoo-mail/webview.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = (Franz) => { + const getMessages = function getMessages() { + let count = document.querySelector('a[data-test-folder-name="Inbox"]').getAttribute('data-test-unread-count'); + Franz.setBadge(count); + }; + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; -- cgit v1.2.3-54-g00ecf