#19 changing the title via document.title

This commit is contained in:
kaffem 2020-08-01 02:36:40 +02:00
parent 1715e8fa7f
commit 05a4a730ec

View file

@ -6,5 +6,5 @@ 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] + ' ');
document.title = notificationText.split(" ")[1] + ' ' + document.title;
}