your mute was also not working for me. Didn't follow your logic exactly, but tweaked it to something similar that works for me
setInterval(function(){ var adCountdown = document.querySelector('.ad-countdown__remaining-time') var muteButton = document.querySelector('button.playback-button[aria-label="Mute Sound"]') var unmuteButton = document.querySelector('button.playback-button[aria-label="Unmute Sound"]')
your mute was also not working for me. Didn't follow your logic exactly, but tweaked it to something similar that works for me
setInterval(function(){
var adCountdown = document.querySelector('.ad-countdown__remaining-time')
var muteButton = document.querySelector('button.playback-button[aria-label="Mute Sound"]')
var unmuteButton = document.querySelector('button.playback-button[aria-label="Unmute Sound"]')
if(adCountdown === null & unmuteButton != null){
unmuteButton.click()
}
if(adCountdown != null & muteButton != null){
muteButton.click()
}
}, 1000)