Change tab title to show internal timers

This commit is contained in:
Tim "timmyRS" Speckhals 2020-03-06 12:51:44 +01:00
parent e57f7d392a
commit 4bcdc2f28a
2 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,7 @@ const timer=(message,secondsLeft,cancelable,callback)=>{
brws=(typeof browser=="undefined"?chrome:browser),
cancel=()=>{
clearInterval(tid)
titleElm.textContent=title
div.classList.add("uk-hidden")
},
tick=()=>{
@ -31,6 +32,7 @@ const timer=(message,secondsLeft,cancelable,callback)=>{
cancel()
callback()
}
titleElm.textContent="("+secondsLeft+") "+title
if(secondsLeft==1)
{
p.textContent=brws.i18n.getMessage(message+"Singular")+" "

View File

@ -1 +1,2 @@
document.querySelectorAll("[data-message]").forEach(e=>e.textContent=brws.i18n.getMessage(e.getAttribute("data-message")))
document.querySelectorAll("[data-message]").forEach(e=>e.textContent=brws.i18n.getMessage(e.getAttribute("data-message")))
const titleElm=document.querySelector("title"),title=titleElm.textContent