diff options
Diffstat (limited to 'uncompressed/gmailinbox/webview.js')
-rw-r--r-- | uncompressed/gmailinbox/webview.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/uncompressed/gmailinbox/webview.js b/uncompressed/gmailinbox/webview.js new file mode 100644 index 0000000..efaebb3 --- /dev/null +++ b/uncompressed/gmailinbox/webview.js | |||
@@ -0,0 +1,18 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | let count = 0; | ||
6 | |||
7 | if (document.querySelectorAll('.DsPmj').length > 0) { | ||
8 | count = document.querySelectorAll('.DsPmj')[0].querySelectorAll('div.G3').length; | ||
9 | } | ||
10 | |||
11 | // set Franz badge | ||
12 | Franz.setBadge(count); | ||
13 | }; | ||
14 | |||
15 | // check for new messages every second and update Franz badge | ||
16 | Franz.loop(getMessages); | ||
17 | }; | ||
18 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdtYWlsaW5ib3gvd2Vidmlldy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsImNvdW50IiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQWtCQyxLQUFELElBQVc7QUFDMUIsUUFBTUMsY0FBYyxTQUFTQSxXQUFULEdBQXVCO0FBQ3pDLFFBQUlDLFFBQVEsQ0FBWjs7QUFFQSxRQUFJQyxTQUFTQyxnQkFBVCxDQUEwQixRQUExQixFQUFvQ0MsTUFBcEMsR0FBNkMsQ0FBakQsRUFBb0Q7QUFDbERILGNBQVFDLFNBQVNDLGdCQUFULENBQTBCLFFBQTFCLEVBQW9DLENBQXBDLEVBQXVDQSxnQkFBdkMsQ0FBd0Qs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