diff --git a/enhancements/notifications.js b/enhancements/notifications.js new file mode 100644 index 0000000..310dffd --- /dev/null +++ b/enhancements/notifications.js @@ -0,0 +1,10 @@ +runAfterLoad(() => { + displayNotificationsInTitle(); +}, ".*"); + +function displayNotificationsInTitle(){ +let menu = document.getElementById('materialize-menu-dropdown'); +let menuDropdowns = Array.from(menu.querySelectorAll('ul.dropdown')).slice(-1)[0]; +let notificationText = menuDropdowns.innerText.split(" ")[3]; +document.querySelector('head > title').insertAdjacentText('afterbegin', notificationText.split(" ")[1] + ' '); +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index 22d1468..a975e11 100644 --- a/manifest.json +++ b/manifest.json @@ -22,7 +22,8 @@ ], "js": [ "enhancements/quickSearch.js", - "enhancements/animeRequests.js" + "enhancements/animeRequests.js", + "enhancements/notifications.js" ], "run_at": "document_end" }