diff options
Diffstat (limited to 'recipes/idobata')
-rw-r--r-- | recipes/idobata/package.json | 2 | ||||
-rw-r--r-- | recipes/idobata/webview.js | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/recipes/idobata/package.json b/recipes/idobata/package.json index 17d488d..7421705 100644 --- a/recipes/idobata/package.json +++ b/recipes/idobata/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "idobata", | 2 | "id": "idobata", |
3 | "name": "Idobata", | 3 | "name": "Idobata", |
4 | "version": "0.3.0", | 4 | "version": "0.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://idobata.io", | 7 | "serviceURL": "https://idobata.io", |
diff --git a/recipes/idobata/webview.js b/recipes/idobata/webview.js index b6cbbe7..352b012 100644 --- a/recipes/idobata/webview.js +++ b/recipes/idobata/webview.js | |||
@@ -1,10 +1,18 @@ | |||
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 | const title = document.querySelector('title').textContent.match(/\d+/); | 9 | const title = document.querySelector('title').textContent.match(/\d+/); |
4 | const count = title !== null ? title[0] : 0; | 10 | const count = title === null ? 0 : title[0]; |
5 | 11 | ||
6 | Ferdium.setBadge(count); | 12 | Ferdium.setBadge(count); |
7 | }; | 13 | }; |
8 | 14 | ||
9 | Ferdium.loop(getMessages); | 15 | Ferdium.loop(getMessages); |
16 | |||
17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
10 | }; | 18 | }; |