diff options
author | 2020-04-20 09:09:20 +0000 | |
---|---|---|
committer | 2020-04-20 09:09:20 +0000 | |
commit | 53560dd3d21155285eb2f65b8e1571dbb33b94b1 (patch) | |
tree | 101355f0e53bc3bd571f9910db0486c25c307f8c /uncompressed/instagram/webview.js | |
parent | Remove WhatsApp reload attempts (#118) (diff) | |
download | ferdium-recipes-53560dd3d21155285eb2f65b8e1571dbb33b94b1.tar.gz ferdium-recipes-53560dd3d21155285eb2f65b8e1571dbb33b94b1.tar.zst ferdium-recipes-53560dd3d21155285eb2f65b8e1571dbb33b94b1.zip |
Update Instagram recipe to use official web service (#111)
* initial commit
# Conflicts:
# README.md
* Adjust recipe to Ferdi
Co-authored-by: Stefan Malzner <stefan@adlk.io>
Diffstat (limited to 'uncompressed/instagram/webview.js')
-rw-r--r-- | uncompressed/instagram/webview.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/uncompressed/instagram/webview.js b/uncompressed/instagram/webview.js index aede5a5..f4f7f94 100644 --- a/uncompressed/instagram/webview.js +++ b/uncompressed/instagram/webview.js | |||
@@ -1,7 +1,15 @@ | |||
1 | const path = require("path"); | 1 | const path = require("path"); |
2 | 2 | ||
3 | module.exports = Franz => { | 3 | module.exports = (Franz) => { |
4 | // Apply fixes suggested in | 4 | const getMessages = function getMessages() { |
5 | // https://github.com/getferdi/recipes/issues/1 | 5 | const element = document.querySelector('a[href^="/direct/inbox"]'); |
6 | Franz.injectCSS(path.join(__dirname, "service.css")); | 6 | |
7 | if (element) { | ||
8 | Franz.setBadge(parseInt(element.innerText, 10)); | ||
9 | } | ||
10 | }; | ||
11 | |||
12 | Franz.loop(getMessages); | ||
13 | |||
14 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
7 | }; | 15 | }; |