How to do it in this code so that the timer is shown but the name itself does not disappear

tabs, can I do something like this?

// ==UserScript== // @include * // ==/UserScript== start=(new Date()).getTime(); window.setInterval(function(){ document.title=Math.floor(((new Date()).getTime()-start)/1000); }, 340); 

    1 answer 1

    Because the time you display in seconds. change the title more often than once a second it makes no sense

     defTitle=document.title; startTime=new Date().getTime(); setInterval(function(){ document.title=defTitle+' - '+Math.round((new Date().getTime()-startTime)/1000); }, 1000); 

    in general, if such problems are caused by troubles - programming needs at least a little tightening