diff options
Diffstat (limited to 'uncompressed/twitter-dm/webview.js')
-rw-r--r-- | uncompressed/twitter-dm/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uncompressed/twitter-dm/webview.js b/uncompressed/twitter-dm/webview.js new file mode 100644 index 0000000..ef66836 --- /dev/null +++ b/uncompressed/twitter-dm/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | let count = 0; | ||
6 | const elem = document.querySelector('a[href="/messages"] div div'); | ||
7 | |||
8 | if (elem) { | ||
9 | count = parseInt(elem.innerText, 10); | ||
10 | } | ||
11 | |||
12 | Franz.setBadge(count); | ||
13 | }; | ||
14 | |||
15 | Franz.loop(getMessages); | ||
16 | }; | ||
17 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXR0ZXItZG0vd2Vidmlldy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsImNvdW50IiwiZWxlbSIsImRvY3VtZW50IiwicXVlcnlTZWxlY3RvciIsInBhcnNlSW50IiwiaW5uZXJUZXh0Iiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQWtCQyxLQUFELElBQVc7QUFDMUIsUUFBTUMsY0FBYyxTQUFTQSxXQUFULEdBQXVCO0FBQ3pDLFFBQUlDLFFBQVEsQ0FBWjtBQUNBLFVBQU1DLE9BQU9DLFNBQVNDLGFBQVQsQ0FBdUIsNkJBQXZCLENBQWI7O0FBRUEsUUFBSUYsSUFBSixFQUFVO0FBQ1JELGNBQVFJLFNBQVNILEtBQUtJLFNBQWQsRUFBeUIsRUFBekIsQ0FBUjtBQUNEOztBQUVEUCxVQUFNUSxRQUFOLENBQWVOLEtBQWY7QUFDRCxHQ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