Skip to content

Fix chapters shortcut in fullscreen - #4284

Open
jvsilva12600009 wants to merge 1 commit into
code-charity:masterfrom
jvsilva12600009:fix/4283-chapters-fullscreen
Open

Fix chapters shortcut in fullscreen#4284
jvsilva12600009 wants to merge 1 commit into
code-charity:masterfrom
jvsilva12600009:fix/4283-chapters-fullscreen

Conversation

@jvsilva12600009

Copy link
Copy Markdown

Fixes #4283

What

Fix the Chapters (Sidebar) On/Off shortcut so it can handle the chapters control while YouTube is in fullscreen.

The change also makes the shortcut safer when the chapters UI is not available, avoiding errors caused by accessing missing DOM elements.

Why

The chapters shortcut worked in the normal YouTube layout, but did not work correctly in fullscreen because the fullscreen player uses a different chapters control.

The existing implementation also assumed that the normal chapters panel was always present.

How

  • Detect YouTube fullscreen mode.
  • Look for the fullscreen chapters control and trigger it when available.
  • Preserve the existing behavior for the normal chapters sidebar.
  • Return safely when no chapters UI is available.
  • Add regression tests covering fullscreen chapters and the missing-UI case.

Testing

  • npx jest tests/unit/shortcut-chapters-fullscreen.test.js

    • 2 passed
  • npm test

    • 24 test suites passed
    • 111 tests passed
  • npm run lint

    • passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞"Chapters (Sidebar) On/Off" not working in full screen

1 participant