A Chrome Extension that generates student lesson notes for theCoderSchool Notes+ portal using the Google Gemini API.
For my job at theCoderSchool, I need to write lesson notes for my students. I don't like writing notes, so I decided to make an extension to help me write them. All I need to do is write bullet points about what the student did, and the extension will write the note for me!
- Injects a "Generate Note" button natively into the Notes+ writeNote.php page.
- Reads bullet points directly from the TinyMCE rich text editor.
- Generates a professional, supportive lesson summary paragraph using Gemini 2.5 Flash.
- Auto-extracts the native student name, coding language, and project name from the website and displays them cleanly in the extension popup for quick context.
- Fully customizable AI prompt accessible from the extension popup, supporting
{studentName}and{language}variables. - Automatically injects coding concepts (e.g., Variables, Loops) directly into the native concept tag input field via simulated keystrokes.
- Clone or download this repository.
- Open Google Chrome and navigate to
chrome://extensions/. - Enable Developer mode in the top right corner.
- Click Load unpacked and select the directory containing the extension files.
- Obtain a Google Gemini API Key from Google AI Studio.
- Click the extension icon in your Chrome toolbar.
- Paste your API key and click Save Settings. This is a one-time setup; the key is saved locally.
- Open the extension popup by clicking its icon in Chrome.
- In the provided text area, you can review or modify the default system prompt used to instruct Gemini.
- Use the dynamic variables
{studentName},{language},{project}, and{bullets}anywhere in your prompt. The extension will automatically inject the scraped website data when generating the note. - Click Save Settings to persist your custom prompt.
- Navigate to a student's
writeNote.phppage in the Notes+ portal. - Type rough bullet points outlining the lesson into the main text box.
- Click the green Generate Note button at the bottom of the page.
- The extension will read your points, replace them with a formatted paragraph, and automatically populate the concept tags!
During development, several technical hurdles were overcome to ensure seamless, native integration within the Notes+ portal:
- Iframe Manipulation: The portal uses a TinyMCE rich text editor embedded within an
iframe. Reading and rewriting the raw bullet points required bypassing the primary DOM and dynamically querying thecontentDocumentof the isolated iframe object. - Simulating Native User Input: The portal's "Concepts" input field strictly relies on specialized JavaScript
keyuplisteners. Standard DOM manipulation (e.g.,input.value = "Loops") bypassed their event listeners entirely. We countered this by building a custom, delayed asynchronous loop that manually triggers simulatedKeyboardEventobjects (acting like the 'Enter' key) to trick the native listeners into registering the AI-generated concepts. - Strict JSON Output Enforcement: Preventing the Google Gemini model from returning conversational filler or markdown blocks required strict prompt engineering and specifically supplying the
responseMimeType: "application/json"configuration flag so the resulting data could be reliably parsed by the extension.
