diff options
author | 2022-11-23 17:20:12 -0500 | |
---|---|---|
committer | 2022-11-25 04:35:58 +0530 | |
commit | 35e16bd72abb23a0b39512f503b2786bec6e11d3 (patch) | |
tree | 34df494e9e0317efe57193a35125bed31f5cd4cd /recipes/snapchat/webview.js | |
parent | fix whatsapp initial loading issue (diff) | |
download | ferdium-recipes-35e16bd72abb23a0b39512f503b2786bec6e11d3.tar.gz ferdium-recipes-35e16bd72abb23a0b39512f503b2786bec6e11d3.tar.zst ferdium-recipes-35e16bd72abb23a0b39512f503b2786bec6e11d3.zip |
Added getMessages function to Snapchat
Diffstat (limited to 'recipes/snapchat/webview.js')
-rw-r--r-- | recipes/snapchat/webview.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/recipes/snapchat/webview.js b/recipes/snapchat/webview.js index 86bb422..78a2455 100644 --- a/recipes/snapchat/webview.js +++ b/recipes/snapchat/webview.js | |||
@@ -5,12 +5,14 @@ function _interopRequireDefault(obj) { | |||
5 | } | 5 | } |
6 | 6 | ||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges | 8 | const getMessages = () => { |
9 | // const getMessages = () => { | 9 | const title = document.querySelector('title').textContent.match(/\d+/); |
10 | // // TODO: Insert your notification-finding code here | 10 | const count = title !== null ? title[0] : 0; |
11 | // Ferdium.setBadge(0, 0); | 11 | |
12 | // }; | 12 | Ferdium.setBadge(count); |
13 | // Ferdium.loop(getMessages); | 13 | }; |
14 | |||
15 | Ferdium.loop(getMessages); | ||
14 | 16 | ||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
16 | }; | 18 | }; |