-
Notifications
You must be signed in to change notification settings - Fork 0
/
webview.js
24 lines (17 loc) · 2.04 KB
/
webview.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'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.querySelectorAll('.guilds-wrapper .badge, .room-menu-options__item__unread-indicator-wrapper.has-unreads').length;
// set Franz badge
Franz.setBadge(count);
};
// check for new messages every second and update Franz badge
Franz.loop(getMessages);
// Hide download message
Franz.injectCSS(_path2.default.join(__dirname, 'service.css'));
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRpc2NvcmQvd2Vidmlldy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsImNvdW50IiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIiwiaW5qZWN0Q1NTIiwiam9pbiIsIl9fZGlybmFtZSJdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0FBRUFBLE9BQU9DLE9BQVAsR0FBa0JDLEtBQUQsSUFBVztBQUMxQixRQUFNQyxjQUFjLFNBQVNBLFdBQVQsR0FBdUI7QUFDekM7QUFDQSxVQUFNQyxRQUFRQyxTQUFTQyxnQkFBVCxDQUEwQix3QkFBMUIsRUFBb0RDLE1BQWxFOztBQUVBO0FBQ0FMLFVBQU1NLFFBQU4sQ0FBZUosS0FBZjtBQUNELEdBTkQ7O0FBUUE7QUFDQUYsUUFBTU8sSUFBTixDQUFXTixXQUFYOztBQUVBO0FBQ0FELFFBQU1RLFNBQU4sQ0FBZ0IsZUFBS0MsSUFBTCxDQUFVQyxTQUFWLEVBQXFCLGF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