Last active
September 9, 2024 17:09
-
-
Save sapslaj/0227cf1de2d997f8d091f0d6d9b9f7ae to your computer and use it in GitHub Desktop.
Auto-disable subtitles with Enhancer for YouTube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. copy/paste this into the Custom Script in Enhancer for YouTube | |
// 2. enable "Automatically execute the script when YouTube is loaded in a tab" | |
// 3. ??? | |
// 4. profit | |
const ccbutton = document.querySelector('.ytp-subtitles-button'); | |
if (ccbutton && ccbutton.attributes['aria-pressed'].value === 'true') { | |
// note: set the above to `=== 'false'` if you want subtitles to always enable | |
ccbutton.click(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment