diff options
author | 2021-10-14 12:25:04 -0500 | |
---|---|---|
committer | 2021-10-14 19:25:04 +0200 | |
commit | 13b71aecef941c863a26b7b99dfa374e41af0299 (patch) | |
tree | 5bad6f22d54bed9800765bd27c74780147c58b34 /recipes/good-reads/webview.js | |
parent | Add Dropbox recipe #369 (#739) (diff) | |
download | ferdium-recipes-13b71aecef941c863a26b7b99dfa374e41af0299.tar.gz ferdium-recipes-13b71aecef941c863a26b7b99dfa374e41af0299.tar.zst ferdium-recipes-13b71aecef941c863a26b7b99dfa374e41af0299.zip |
📖 Add Good Reads (#743)
Diffstat (limited to 'recipes/good-reads/webview.js')
-rw-r--r-- | recipes/good-reads/webview.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/recipes/good-reads/webview.js b/recipes/good-reads/webview.js new file mode 100644 index 0000000..338b634 --- /dev/null +++ b/recipes/good-reads/webview.js | |||
@@ -0,0 +1,21 @@ | |||
1 | var _path = _interopRequireDefault(require("path")); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = (Ferdi) => { | ||
8 | const getMessages = () => { | ||
9 | const notificationBadge = document.querySelector( | ||
10 | ".siteHeader__topLevelItem--profileIcon .headerPersonalNav .modalTrigger .headerPersonalNav__icon .headerPersonalNav__flag" | ||
11 | ); | ||
12 | let notification = notificationBadge | ||
13 | ? Number.parseInt(notificationBadge.textContent) | ||
14 | : 0; | ||
15 | |||
16 | Ferdi.setBadge(notification); | ||
17 | }; | ||
18 | Ferdi.loop(getMessages); | ||
19 | |||
20 | Ferdi.injectCSS(_path.default.join(__dirname, "service.css")); | ||
21 | }; | ||