Skip to content

Commit

Permalink
Update shortcuts.js simplified shortcutGoToSearchBox shortcutActivate…
Browse files Browse the repository at this point in the history
…Fullscreen
  • Loading branch information
raszpl authored Jun 29, 2024
1 parent f43f6e6 commit 6544daf
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions js&css/web-accessible/www.youtube.com/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,24 +422,19 @@ ImprovedTube.shortcutResetPlaybackSpeed = function () {
4.7.19 GO TO SEARCH BOX
------------------------------------------------------------------------------*/
ImprovedTube.shortcutGoToSearchBox = function () {
var search = document.querySelector('input#search');
if (search) {
search.focus();
}
document.querySelector('input#search')?.focus();
};
/*------------------------------------------------------------------------------
4.7.20 ACTIVATE FULLSCREEN
------------------------------------------------------------------------------*/
ImprovedTube.shortcutActivateFullscreen = function () {
if (this.elements.player) {
this.elements.player.toggleFullscreen();
}
this.elements.player?.toggleFullscreen();
};
/*------------------------------------------------------------------------------
4.7.21 ACTIVATE CAPTIONS
------------------------------------------------------------------------------*/
ImprovedTube.shortcutActivateCaptions = function () {
var player = this.elements.player;
const player = this.elements.player;

if (player && player.toggleSubtitlesOn) {
player.toggleSubtitlesOn();
Expand Down

0 comments on commit 6544daf

Please sign in to comment.