I have this script that I used to paste in dev console and youtube ads used to get skipped if the ‘Skip Ads’ button was visible.
setInterval(()=>{try{ var elements = document.getElementsByClassName("ytp-skip-ad-button__text"); var skipAdBtn = elements?.[0];console.log("skip ad:",skipAdBtn);skipAdBtn.click(); } catch(err){} },5000)
However since the past few months, this has stopped working completely.
I checked that the Skip Ads button is in fact selected by the script (see 1 in the below image) just that the click does not happen. Also, when I click manually, the ad is skipped:
I am using Google Chrome. I tried incognito and even Microsoft Edge, but still the same problem.
Any help would be highly appreciated.