diff options
Diffstat (limited to 'recipes/lineworks/webview.js')
-rw-r--r-- | recipes/lineworks/webview.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes/lineworks/webview.js b/recipes/lineworks/webview.js new file mode 100644 index 0000000..41683ef --- /dev/null +++ b/recipes/lineworks/webview.js | |||
@@ -0,0 +1,19 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | const elements = document.querySelectorAll( | ||
10 | 'div#chat_list > ul#chat_grp_lst > li#item_chat > dl#chat_count > span#new', | ||
11 | ); | ||
12 | let count = elements[0] ? count = Ferdium.safeParseInt(elements[0].textContent): 0; | ||
13 | |||
14 | Ferdium.setBadge(count); | ||
15 | }; | ||
16 | Ferdium.loop(getMessages); | ||
17 | |||
18 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
19 | } | ||