From 13b71aecef941c863a26b7b99dfa374e41af0299 Mon Sep 17 00:00:00 2001 From: "Tania R. Zúñiga" <25267490+TanZng@users.noreply.github.com> Date: Thu, 14 Oct 2021 12:25:04 -0500 Subject: 📖 Add Good Reads (#743) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- recipes/good-reads/webview.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 recipes/good-reads/webview.js (limited to 'recipes/good-reads/webview.js') 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 @@ +var _path = _interopRequireDefault(require("path")); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +module.exports = (Ferdi) => { + const getMessages = () => { + const notificationBadge = document.querySelector( + ".siteHeader__topLevelItem--profileIcon .headerPersonalNav .modalTrigger .headerPersonalNav__icon .headerPersonalNav__flag" + ); + let notification = notificationBadge + ? Number.parseInt(notificationBadge.textContent) + : 0; + + Ferdi.setBadge(notification); + }; + Ferdi.loop(getMessages); + + Ferdi.injectCSS(_path.default.join(__dirname, "service.css")); +}; -- cgit v1.2.3-70-g09d2