youtube-lyrics-extension

🎡 YouTube Lyrics

Sing along or play along. Synced karaoke lyrics for YouTube β€” plus one-click guitar tabs on Ultimate Guitar. No more searching, no more switching tabs. Just the video, the lyrics, and the tabs in one floating panel.

Browsers Manifest License

🍺 Support this project Β· πŸ› Report an issue


✨ Features

Built for karaoke and guitarists:

Plus:


🌐 Browser Support

Browser Status Install
Safari (macOS) βœ… Full Xcode build
Chrome βœ… Full Load unpacked
Edge βœ… Works Like Chrome

πŸš€ Installation

Chrome

git clone https://github.com/kl-patrickstar/youtube-lyrics-extension.git
cd youtube-lyrics-extension
  1. Open chrome://extensions
  2. Enable Developer mode (top right)
  3. Click Load unpacked and select the cloned folder
  4. Pin the toolbar icon, then open any YouTube video

Safari (macOS)

Safari doesn’t allow loading a folder directly. You have to generate an Xcode project and build it yourself.

Prerequisites

1. Clone the repository

git clone https://github.com/kl-patrickstar/youtube-lyrics-extension.git
cd youtube-lyrics-extension

2. Generate the Xcode project

Apple ships a converter that turns any WebExtension folder into a ready-to-build Xcode project:

xcrun safari-web-extension-converter . \
  --project-location ~/Desktop/YouTubeLyrics \
  --app-name "YouTube Lyrics" \
  --bundle-identifier "com.yourname.youtubelyrics" \
  --macos-only \
  --no-open

Replace com.yourname.youtubelyrics with your own unique identifier.

3. Open the project

open ~/Desktop/YouTubeLyrics/YouTube\ Lyrics.xcodeproj

Or double-click the .xcodeproj file in Finder.

4. Build and run

In Xcode:

  1. Set the scheme in the top toolbar to YouTube Lyrics (macOS)
  2. Press ⌘R to build and run
  3. A small host window appears β€” close it again
  4. If Xcode complains about signing: go to Signing & Capabilities and select your Apple team

5. Enable in Safari

  1. Safari β†’ Settings (⌘,)
  2. Open the Extensions tab
  3. Find YouTube Lyrics β†’ enable the checkbox
  4. Accept the permission prompt
  5. Optional: Safari β†’ Settings β†’ Websites β†’ YouTube Lyrics β†’ set to Allow

6. Test

  1. Open YouTube and play a music video
  2. Press βŒ˜β‡§L or click the 🎡 icon

Tip: Safari caches Web Extensions aggressively. After code changes:

  1. Disable the extension in Safari
  2. Quit Safari completely (⌘Q)
  3. In Xcode: Product β†’ Clean Build Folder (β‡§βŒ˜K)
  4. Rebuild with ⌘R
  5. Restart Safari β†’ re-enable the extension

πŸ“‚ Project Structure

youtube-lyrics-extension/
β”œβ”€β”€ manifest.json        # Manifest V3
β”œβ”€β”€ background.js        # Service worker (storage, fetch proxy, commands)
β”œβ”€β”€ content.js           # Orchestrator (refresh, resolve, render)
β”œβ”€β”€ state.js             # Global state
β”œβ”€β”€ bridge.js            # Storage + fetch messaging
β”œβ”€β”€ api.js               # LRCLIB, lyrics.ovh, iTunes
β”œβ”€β”€ lyrics.js            # LRC parser, song info heuristics
β”œβ”€β”€ youtube.js           # DOM helpers (video ID, metadata, chapters)
β”œβ”€β”€ sync.js              # Sync engine (requestVideoFrameCallback)
β”œβ”€β”€ template.js          # Shadow DOM template + CSS
β”œβ”€β”€ ui.js                # UI logic (panel, settings, drag, popover)
β”œβ”€β”€ popup.html           # Toolbar popup markup
β”œβ”€β”€ popup.js             # Toolbar popup logic
β”œβ”€β”€ icon.svg             # Vector icon
β”œβ”€β”€ icons/               # Icon set (16–512 px)
└── README.md

πŸ”§ How It Works

  1. Detect video β€” video ID + metadata via oEmbed + DOM
  2. Parse song β€” artist/title via heuristics (Topic channels, separators, ft.)
  3. Fetch lyrics β€” LRCLIB first, lyrics.ovh as fallback
  4. Sync β€” requestVideoFrameCallback for 30–60 fps timing accuracy
  5. Render β€” isolated Shadow DOM with karaoke highlighting + auto-scroll

πŸ“‘ APIs Used

All free, no API keys required:

API Purpose
LRCLIB Synced lyrics (LRC format)
lyrics.ovh Plain-text fallback
iTunes Search Album artwork + Apple Music links

πŸ”’ Privacy


🀝 Contributing

Issues and pull requests are welcome. Open an issue on GitHub for bugs or feature ideas.


🍺 Support

This extension is built and maintained in my free time. If it made your karaoke nights better or you just want to say thanks, feel free to show some love:

PayPal

Thank you, I would appreciate it!


πŸ“„ License

MIT β€” free to use, including commercially.

Note on lyrics: Lyrics are provided by third-party APIs. Commercial use of lyrics requires proper licensing (e.g. Musixmatch, LyricFind). The extension itself is open source.