How dreuxx/grammar-checker-v1 works
Project type and purpose
• This is a Chrome browser extension (“Grammar Checker”) that provides in‐browser grammar and spelling correction for user‐selected text. It uses the OpenAI API as an external service for natural language processing.
File structure
• manifest.json: Declares extension metadata, permissions (e.g., storage, activeTab), background scripts, content scripts, UI pages.
• background.js: Runs in the extension’s background context (service worker), handles installation events, stores/retrieves the API key in Chrome storage, mediates communication between UI and content scripts.
• content.js: Injected into web pages, handles text selection, underlines errors in page, listens for messages from popup or background to highlight suggestions.
• options.html & options.js: The settings page where the user enters and saves their OpenAI API key (persisted in Chrome storage).
• styles.css: Shared CSS for popup.html and possibly for injected highlights.
README for additional insights
• Confirms the API‐driven grammar correction workflow: detect language, send text to OpenAI, parse suggestions.
• Highlights major features: multi-language support, error highlighting without modifying original text, secure storage of API key.