Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JorikSchellekens/16640ee242712269ac1e9e9c148a5e1f to your computer and use it in GitHub Desktop.
Save JorikSchellekens/16640ee242712269ac1e9e9c148a5e1f to your computer and use it in GitHub Desktop.
Lyricist proposal for fixing issue 10

Fix lyrics view on playlists.

This is a simple proposal to fix issue #10.

The current lyrics view is injected into the DOM as the first child of the DOM element indicated by selector LYRIC_LOCATION_SELECTOR defined in constants.js. The selector is currently set to the top of the suggested videos.

Solution

A simple and aesthetically pleasing solution would be to put the lyrics above the playlist. Showing at the same width. Much as it is when the song playing is not in a playlist.

Luckily the playlist is embedded in the same DOM element that the suggested videos is in. So, the fix is simply to change the selector to the parent element whose id is simply #secondary-inner. This conveniently also puts other things that are rendered on the side under the lyrics.

Overview of Youtube DOM

The main video page of youtube is made of two columns whose ids are #primary and #secondary. The primary column

@swapnilraj
Copy link

Can you make the extension of the gist md? Yeah this seems like a easy change although I would liked some more detail about the change possibly about the hierarchy of the DOM nodes in the page.

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