From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/hangouts/README.md | 5 +++++ recipes/hangouts/icon.png | Bin 0 -> 60578 bytes recipes/hangouts/icon.svg | 29 +++++++++++++++++++++++++++++ recipes/hangouts/index.js | 15 +++++++++++++++ recipes/hangouts/package.json | 13 +++++++++++++ recipes/hangouts/webview.js | 21 +++++++++++++++++++++ 6 files changed, 83 insertions(+) create mode 100644 recipes/hangouts/README.md create mode 100644 recipes/hangouts/icon.png create mode 100644 recipes/hangouts/icon.svg create mode 100644 recipes/hangouts/index.js create mode 100644 recipes/hangouts/package.json create mode 100644 recipes/hangouts/webview.js (limited to 'recipes/hangouts') diff --git a/recipes/hangouts/README.md b/recipes/hangouts/README.md new file mode 100644 index 0000000..c9b22f7 --- /dev/null +++ b/recipes/hangouts/README.md @@ -0,0 +1,5 @@ +# Hangouts for Franz +This is the official Franz recipe for Hangouts + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/hangouts/icon.png b/recipes/hangouts/icon.png new file mode 100644 index 0000000..8d68f36 Binary files /dev/null and b/recipes/hangouts/icon.png differ diff --git a/recipes/hangouts/icon.svg b/recipes/hangouts/icon.svg new file mode 100644 index 0000000..2a8bc22 --- /dev/null +++ b/recipes/hangouts/icon.svg @@ -0,0 +1,29 @@ + + + + hangouts + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/recipes/hangouts/index.js b/recipes/hangouts/index.js new file mode 100644 index 0000000..8be0a8e --- /dev/null +++ b/recipes/hangouts/index.js @@ -0,0 +1,15 @@ +module.exports = (Franz) => + class hangouts extends Franz { + modifyRequestHeaders() { + return [ + { + headers: { + 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(), + }, + requestFilters: { + urls: ['*://*/*'], + }, + }, + ]; + } + }; diff --git a/recipes/hangouts/package.json b/recipes/hangouts/package.json new file mode 100644 index 0000000..c6edbbd --- /dev/null +++ b/recipes/hangouts/package.json @@ -0,0 +1,13 @@ +{ + "id": "hangouts", + "name": "Hangouts", + "version": "1.0.4", + "description": "Hangouts", + "main": "index.js", + "author": "Stefan Malzner ", + "license": "MIT", + "config": { + "serviceURL": "https://hangouts.google.com", + "hasNotificationSound": true + } +} diff --git a/recipes/hangouts/webview.js b/recipes/hangouts/webview.js new file mode 100644 index 0000000..58f6ccf --- /dev/null +++ b/recipes/hangouts/webview.js @@ -0,0 +1,21 @@ +'use strict'; + +var _path = require('path'); + +var _path2 = _interopRequireDefault(_path); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = Franz => { + const getMessages = function getMessages() { + // get unread messages + const count = document.querySelector('#hangout-landing-chat iframe').contentWindow.document.querySelectorAll('.ee').length; + + // set Franz badge + Franz.setBadge(count); + }; + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmdvdXRzL3dlYnZpZXcuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIkZyYW56IiwiZ2V0TWVzc2FnZXMiLCJjb3VudCIsImRvY3VtZW50IiwicXVlcnlTZWxlY3RvciIsImNvbnRlbnRXaW5kb3ciLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBOzs7Ozs7QUFFQUEsT0FBT0MsT0FBUCxHQUFrQkMsS0FBRCxJQUFXO0FBQzFCLFFBQU1DLGNBQWMsU0FBU0EsV0FBVCxHQUF1QjtBQUN6QztBQUNBLFVBQU1DLFFBQVFDLFNBQVNDLGFBQVQsQ0FBdUIsOEJBQXZCLE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