aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/good-reads/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/good-reads/webview.js')
-rw-r--r--recipes/good-reads/webview.js21
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 @@
1var _path = _interopRequireDefault(require("path"));
2
3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
6
7module.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};