Skip to content

Instantly share code, notes, and snippets.

@sapslaj
Last active November 1, 2023 08:13
Show Gist options
  • Save sapslaj/0227cf1de2d997f8d091f0d6d9b9f7ae to your computer and use it in GitHub Desktop.
Save sapslaj/0227cf1de2d997f8d091f0d6d9b9f7ae to your computer and use it in GitHub Desktop.
Auto-disable subtitles with Enhancer for YouTube
// 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