diff options
Diffstat (limited to 'recipes/guilded/webview.js')
-rw-r--r-- | recipes/guilded/webview.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/recipes/guilded/webview.js b/recipes/guilded/webview.js index a573790..eedbf8a 100644 --- a/recipes/guilded/webview.js +++ b/recipes/guilded/webview.js | |||
@@ -1,10 +1,16 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let unread = 0; | 9 | let unread = 0; |
4 | const notificationBadge = document.querySelectorAll( | 10 | const notificationBadge = document.querySelectorAll( |
5 | '.NavSelectorItem-unread-badge', | 11 | '.NavSelectorItem-unread-badge', |
6 | )[0]; | 12 | )[0]; |
7 | if (notificationBadge != undefined) { | 13 | if (notificationBadge !== undefined) { |
8 | const innerBadge = | 14 | const innerBadge = |
9 | notificationBadge.querySelectorAll('.BadgeV2-count')[0]; | 15 | notificationBadge.querySelectorAll('.BadgeV2-count')[0]; |
10 | unread = Ferdium.safeParseInt(innerBadge.textContent); | 16 | unread = Ferdium.safeParseInt(innerBadge.textContent); |
@@ -13,4 +19,6 @@ module.exports = Ferdium => { | |||
13 | }; | 19 | }; |
14 | 20 | ||
15 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |
22 | |||
23 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
16 | }; | 24 | }; |