AniwatchPlus/enhancements/notifications.js

10 lines
407 B
JavaScript
Raw Normal View History

runAfterLoad(() => {
displayNotificationsInTitle();
}, ".*");
function displayNotificationsInTitle(){
2020-07-29 23:09:13 +02:00
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.title = notificationText.split(" ")[1] + ' ' + document.title;
}