How amiransarpour/coursera-subtitle-extensions works
Project type and purpose
• This is a browser extension (manifest.json, index.html, css/, js/) whose sole purpose is to translate Coursera video subtitles on the fly using the Google Translate API.
File structure
• Top‑level files
• manifest.json – defines the extension, permissions (e.g., "activeTab", "storage", cross‑origin access to Google Translate), content‑script matches, and popup page.
• index.html – the extension’s popup UI.
• README.md – high‑level project description and install instructions.
• Directories
• css/index.css – styles for the popup UI.
• js/index.js – logic for the popup (list supported languages, read user choice, send commands).
• js/main.js – content script injected into Coursera pages (extracts subtitle text, manipulates DOM, listens for messages).
README for additional insights
• The user selects a target language in the popup and clicks “Translate.”
• The extension then must fetch the current subtitles from the video page, call Google Translate, and inject translated text back into the page.