Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored Dec 15, 2024
1 parent a733c67 commit 7b01d82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ ImprovedTube.playerOnPause = function (event) {
if (document.documentElement.dataset.pageType === 'video'
&& (ImprovedTube.storage.description === "expanded" || ImprovedTube.storage.transcript === true || ImprovedTube.storage.chapters === true )) {

Check warning on line 409 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Trailing spaces not allowed
ImprovedTube.forbidFocus = function (ms) {

Check warning on line 410 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Multiple spaces found before 'function'

Check warning on line 410 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Trailing spaces not allowed
const originalFocus = HTMLElement.prototype.focus; // Backing up default method - other methods: Element.prototype.scrollIntoView window.scrollTo window.scrollBy
originalFocus = HTMLElement.prototype.focus; // Backing up default method - other methods: Element.prototype.scrollIntoView window.scrollTo window.scrollBy
// Override YouTube's scroll method:
HTMLElement.prototype.focus = function() {console.log("Preventing YouTube's scripted scrolling, when expanding the video description for you"); }

Check warning on line 413 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Missing space before function parentheses
if(document.hidden) ms = 3*ms;

Check warning on line 414 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Expected space(s) after "if"
Expand Down
3 changes: 2 additions & 1 deletion js&css/web-accessible/www.youtube.com/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ ImprovedTube.shortcutResetPlaybackSpeed = function () {
4.7.19 GO TO SEARCH BOX
------------------------------------------------------------------------------*/
ImprovedTube.shortcutGoToSearchBox = function () {
document.querySelector('input#search')?.focus();
if (originalFocus) { HTMLElement.prototype.focus = originalFocus }
document.querySelector('input#search')?.focus(); //alternatively .click()
};
/*------------------------------------------------------------------------------
4.7.20 ACTIVATE FULLSCREEN
Expand Down

0 comments on commit 7b01d82

Please sign in to comment.