A modular Chrome extension that extracts YouTube video transcripts and seamlessly transfers them to Claude.ai with video context.
- 🤖 Claude - One-click transcript extraction and transfer to Claude.ai
- 📝 Show - Opens YouTube's native transcript panel
- 📋 Copy - Copies formatted transcript to clipboard
- 🖼️ Hover - Toggle thumbnail hover for enlarged previews
- Floating Widget - Shows video context while chatting
- Draggable Interface - Position widget anywhere on screen
- Minimize/Restore - Collapse to mini button when not needed
- Thumbnail Preview - Click to see full-size video thumbnail
This extension follows modular architecture with clear separation of concerns:
- Configuration - Centralized settings and constants
- Logger - Configurable logging system (DEBUG/INFO/WARN/ERROR)
- Error Handler - Robust error handling with recovery strategies
- Storage Manager - Type-safe Chrome storage operations
- Transcript Extractor - YouTube transcript extraction logic
- UI Manager - Button injection and notification system
- Thumbnail Handler - Hover functionality and image loading
- Claude Widget - Floating widget management
✅ Modular Code Architecture - Each module has single responsibility ✅ Configurable Logging - Multiple verbosity levels with timestamps ✅ Centralized Configuration - All settings in CONFIG object ✅ Robust Error Handling - Graceful degradation and recovery ✅ E2E Testing Ready - Clear module boundaries for testing
- Clone this repository
- Open Chrome →
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" → Select extension directory
- Navigate to any video with transcripts
- Look for buttons in the sidebar:
- Click 🤖 Claude to send transcript to Claude
- Click 📝 to show transcript panel
- Click 📋 to copy transcript
- Click 🖼️ to toggle thumbnail hover
- A floating widget appears with video info
- Drag to reposition, minimize, or close
- Click thumbnail for full-size preview
- Click title to return to YouTube
// YouTube side
window.__YT_TRANSCRIPT_DEBUG__.setLogLevel(0); // 0 = DEBUG
// Claude side
window.__CLAUDE_WIDGET_DEBUG__.setLogLevel(0);CONFIG = {
FEATURES: {
THUMBNAIL_HOVER: true,
AUTO_HIDE_TRANSCRIPT: true,
PRELOAD_THUMBNAILS: true
},
TIMING: {
BUTTON_CHECK_INTERVAL: 1000,
TRANSCRIPT_WAIT: 1000,
NOTIFICATION_DURATION: 3000
}
}modules/
├── config.js # Centralized configuration
├── logger.js # Logging system
├── error-handler.js # Error handling
├── storage-manager.js # Chrome storage operations
├── transcript-extractor.js # Transcript extraction
├── ui-manager.js # UI components
├── thumbnail-handler.js # Thumbnail features
└── claude-widget.js # Claude.ai widget
content-youtube-modular.js # YouTube main script
content-claude-modular.js # Claude main script
// Check video data
window.__CLAUDE_WIDGET_DEBUG__.widget.videoData
// Force show widget
window.__CLAUDE_WIDGET_DEBUG__.widget.create(true)- Ensure video has transcripts available
- Check console for errors with debug logging
- Try manually opening transcript panel first
- Refresh the YouTube page
- Verify you're on
/watchURL - Check console for initialization errors
// Set to ERROR only
window.__YT_TRANSCRIPT_DEBUG__.logger.setLevel(3)// Get all logged events
window.__YT_TRANSCRIPT_DEBUG__.logger.exportLogs()- Open DevTools → Application → Storage → Local Storage
- Look for keys:
currentVideo,widgetPosition,thumbnailHoverEnabled
- Efficient DOM queries with caching
- Debounced operations to prevent overload
- Lazy thumbnail loading on demand
- Minimal background processing
- No external API calls
- All data stored locally
- No tracking or analytics
- Thumbnails cached in browser storage
This project is provided as-is for educational purposes.
Follow the Development Guidelines:
- Maintain modular architecture
- Add comprehensive error handling
- Use the logging system
- Update CONFIG for new settings
- Focus on user experience
Version 2.0 - Complete modular rewrite following best practices