From 05a4a730ec6eec8933242311fd4fbb261ceca5d3 Mon Sep 17 00:00:00 2001 From: kaffem <29717789+kaffem@users.noreply.github.com> Date: Sat, 1 Aug 2020 02:36:40 +0200 Subject: [PATCH] #19 changing the title via document.title --- enhancements/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enhancements/notifications.js b/enhancements/notifications.js index af1b7e5..2e63723 100644 --- a/enhancements/notifications.js +++ b/enhancements/notifications.js @@ -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; } \ No newline at end of file