diff options
Diffstat (limited to 'recipes/pulse-sms/webview.js')
-rw-r--r-- | recipes/pulse-sms/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes/pulse-sms/webview.js b/recipes/pulse-sms/webview.js new file mode 100644 index 0000000..e2d7f40 --- /dev/null +++ b/recipes/pulse-sms/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | Ferdium.setBadge( | ||
10 | document.querySelector('#unread_count').textContent.replaceAll(/\s/g, ''), | ||
11 | ); | ||
12 | }; | ||
13 | |||
14 | Ferdium.loop(getMessages); | ||
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
17 | }; | ||