aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/good-reads/webview.js
diff options
context:
space:
mode:
authorLibravatar Tania R. Zúñiga <25267490+TanZng@users.noreply.github.com>2021-10-14 12:25:04 -0500
committerLibravatar GitHub <noreply@github.com>2021-10-14 19:25:04 +0200
commit13b71aecef941c863a26b7b99dfa374e41af0299 (patch)
tree5bad6f22d54bed9800765bd27c74780147c58b34 /recipes/good-reads/webview.js
parentAdd Dropbox recipe #369 (#739) (diff)
downloadferdium-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.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};