Last active
March 2, 2025 14:35
-
-
Save noraworld/e6d0f0f778a7e0edf1f72c17cceb0b72 to your computer and use it in GitHub Desktop.
It allows you to toggle CC (closed caption) on watch.pokemon.com by pressing "c" key
This file contains hidden or 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
// Toggle closed caption on watch.pokemon.com by pressing "c" key | |
let count = 0 | |
document.addEventListener('keydown', (event) => { | |
if (event.key === 'c') { | |
count++ | |
if (count % 2 === 0) { | |
document.querySelector('.vjs-menu-item.vjs-subtitles-menu-item').previousElementSibling.click() | |
} | |
else { | |
document.querySelector('.vjs-menu-item.vjs-subtitles-menu-item').click() | |
} | |
document.activeElement.blur() | |
} | |
}) |
Author
noraworld
commented
Jun 26, 2022
- ScriptAutoRunner
- Chrome Web Store
- GitHub
- Qiita
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment