Skip to content

Commit

Permalink
Fix Chapters not showing after reload
Browse files Browse the repository at this point in the history
Fix code-charity#2754

`ImprovedTube.chapters` tries to call `ImprovedTube.forbidFocus` which does not exists or is not a function.
Tested with Chromium on Arch Linuxand random youtube videos.
  • Loading branch information
4yman-0 committed Jan 1, 2025
1 parent a733c67 commit 4b34319
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js&css/web-accessible/www.youtube.com/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,14 @@ ImprovedTube.transcript = function (el) { if (ImprovedTube.storage.transcript ==
CHAPTERS
--------------------------------------------------------------*/
ImprovedTube.chapters = function (el) { if (ImprovedTube.storage.chapters === true) {
const available = el.querySelector('[target-id*=chapters][visibility*=HIDDEN]') || el.querySelector('[target-id*=chapters]')?.clientHeight;
const available = el.querySelector('[target-id*=chapters][visibility*=HIDDEN]')
|| el.querySelector('[target-id*=chapters]')?.clientHeight;
if (available) {
ImprovedTube.forbidFocus(2100);
//ImprovedTube.forbidFocus(2100);
const modernChapters = el.querySelector('[modern-chapters] #navigation-button button[aria-label]');
modernChapters ? modernChapters.click() : el.querySelector('[target-id*=chapters]')?.removeAttribute('visibility');
if ( yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid === true ) { available.setAttribute('z-index', '98765') }
}
}
}};
/*------------------------------------------------------------------------------
LIVECHAT
Expand Down

0 comments on commit 4b34319

Please sign in to comment.