Add video length in minutes (rounded) and Channel Name to Window Title
< Feedback on YouTube Better Window Title
I tried this out and it looks like the focus
listener can get triggered multiple times causing the setTimeout
in updateWindowTitle
to update the title too often. If you remove that setTimeout
, it doesn't get triggered often enough.
I'll likely clean up the code a bit later and replace all these setTimeout
s with a ~5 second setInterval
.
I also eventually want this script to run on all youtube URLs with the update title logic running only on actual video pages. This will fix the issue with the script not running when opening a video in the same tab from the home/subscription page. In that case a setInterval
would work better than a focus
listener. I appreciate your suggestion though.
I managed to improve the
window.addEventListener
call by adapting this suggestionSo this:
becomes this: