Part 1: Splitting the Extensions, Manifest V3 & the Botanical Forest UI
Part 1: Splitting the Extensions, Manifest V3 & the Botanical Forest UI
When I wrote the first working version of SpringBored in October 2026 (commits 486ac7c and f8a11a7), it was a single Chrome extension that sped up Infosys Springboard video lectures and clicked through reading slides. A few days later, when I started building the Google Gemini AI quiz and assessment solver, my first thought was to just add an "Assessment Mode" tab inside that same extension popup.
After testing that combined build for two days, I realized bundling course completion and AI exam solving into one extension was a mistake. In commit 62f1112 ("Separate AI and non-AI extension versions"), I split the project into two completely independent Manifest V3 extensions: SpringBored (Course Edition) and SpringBored - Assessment (Assessment Edition).
In this first part of the Building SpringBored series, we will look at why splitting the extensions made both tools better, how our zero-dependency Manifest V3 runtime handles sleeping service workers and already-open tabs, how the first-run consent gate works, and how we landed on the Botanical Forest UI design.
1. Why Two Extensions Beat One Monolith
Splitting the codebase into SpringBored/ and SpringBored - Assessment/ solved three real headaches right away:
- A clean boundary between lectures and graded exams: A lot of students want a tool that speeds through unskippable video lectures and clicks "Confirm" on reading timers, but want to take graded quizzes themselves. In Course Edition,
isAssignment(el)checks every table-of-contents item and viewer icon and automatically skips every quiz, test, and assessment. - Zero setup for Course Edition: Course Edition doesn't use AI at all—you load it, click Run course, and it works immediately. Assessment Edition needs a Google Gemini API key (
AIzaSy...), a model selector, and an in-page fullscreen HUD. Keeping them separate means Course Edition users never have to configure an API key they don't need. - Tighter browser permissions: Course Edition only needs
all_frames: falseonhttps://infyspringboard.onwingspan.com/*. Assessment Edition, on the other hand, has to reach inside third-party cross-origin exam iframes (*.techademy.com,*.techademyone.com,*.yaksha.com,*.iiht.com), which requiresall_frames: truepaired with a top-frame domain guard.
2. Keeping It 100% Vanilla JS Under Manifest V3
Both extensions are written in plain JavaScript, HTML, and CSS with zero NPM packages and zero build bundlers, locked down with a strict Content Security Policy ("extension_pages": "script-src 'self'; object-src 'self'"). When someone downloads a release .zip from GitHub or clones the repo, the files on disk are the exact files Chrome runs—no minified webpack bundles hiding network calls.
Each extension has three parts that talk to each other over chrome.runtime and chrome.tabs messages:
SpringBored/ (or SpringBored - Assessment/)
├── manifest.json # Manifest V3 permissions, CSP, and content_scripts registration
├── background.js # MV3 service worker (Gemini calls, telemetry, update checks, frame locks)
├── content.js # In-page DOM engine (TOC traversal, 16x video seeker, or scraper + HUD)
├── popup.html # Toolbar popup markup (Consent Gate + Control Dashboard)
├── popup.css # Botanical Forest CSS variables and layout
└── popup.js # Popup controller, live progress bar, and auto-injection recovery
Dealing with Already-Open Tabs & Service Worker Restarts
In Manifest V3, background.js is an ephemeral service worker that Chrome puts to sleep after ~30 seconds of idle time. Worse, if a user installs or reloads the extension while an Infosys Springboard tab is already open, Chrome does not automatically inject content.js into that existing tab—so clicking "Run" would normally fail with a Could not establish connection error until the user refreshes the page.
To make sure the buttons work even right after an install or reload, popup.js and background.js use chrome.scripting.executeScript to inject content.js on the fly, paired with a global flag at the top of content.js so running the script twice in the same frame is a safe no-op:
// Guard at the top of SpringBored/content.js so re-injection never duplicates listeners
(function () {
'use strict';
if (window.__SPRINGBORED_COURSE_LOADED__) return;
window.__SPRINGBORED_COURSE_LOADED__ = true;
const ON_VIEWER_PAGE = /\/viewer\//.test(window.location.pathname);
// ...
})();
In SpringBored - Assessment/background.js, whenever a START action is dispatched, the service worker injects content.js across all frames (allFrames: true) before broadcasting the start command. That way, even if an exam just mounted a fresh cross-origin Techademy iframe a second ago, the child frame receives the solver script immediately:
if ((action === 'START' || action === 'START_ASSESSMENT_SOLVER') && chrome.scripting?.executeScript) {
try {
await chrome.scripting.executeScript({
target: { tabId, allFrames: true },
files: ['content.js']
});
await new Promise((r) => setTimeout(r, 180));
} catch (_) {}
}
3. The First-Run Privacy & Terms Gate
Because browser extensions run inside logged-in tabs, I wanted users to see exactly what the extension does before it touches a single element on the page. Both extensions enforce a first-run consent gate stored in chrome.storage.local (sbConsent):
1. Locked by default on install: Right after installation, sbConsent.accepted is false. The extension puts an attention badge (!) on its toolbar icon, hides the main controls in the popup, and blocks all automation in content.js.
2. Plain-English summary card: Opening the popup shows a short card explaining that execution happens locally in your browser, your Gemini API key stays in chrome.storage.local, and you are responsible for following your institution's academic honor code.
3. One-click revoke anytime: Checking "I have read and agree to the Privacy & Terms" and clicking Agree & continue writes { accepted: true, version: "1.0.0", acceptedAt: Date.now() }, clears the ! badge, and unlocks the controls. If you ever want to lock it back up or clear your state, clicking Privacy & terms → Withdraw consent in the popup footer resets everything in one click.
4. Designing the Botanical Forest Theme
My earliest builds used a generic dark-blue/gray theme that looked like every default dark-mode template on GitHub. In commit dfd4820 ("Update SpringBored logo, extension icons, and botanical forest UI palette"), I redesigned both extension popups, the floating in-page HUD, and the website (springbored.ojasdeshpande.in) around a Botanical Forest color palette:
:root {
--sb-forest-deep: #162b21; /* Deep forest background */
--sb-forest-card: #244534; /* Elevated card & header surface */
--sb-forest-border: #2d5540; /* Subtle border divider */
--sb-cream: #f3ebd3; /* Warm cream primary text */
--sb-sage: #96c99e; /* Running / verified status & progress fill */
--sb-muted: #84987c; /* Secondary labels */
--sb-gold: #e5a952; /* Primary buttons, AI highlights & NEW badge */
--sb-coral: #e6926d; /* Stop / warning buttons & sponsor accents */
}
Beyond looking distinctive, those colors serve a practical purpose during exams:
- Easy on the eyes over white exam screens: When the Assessment Edition renders its draggable HUD over a bright white Infosys Springboard or Techademy test page, the deep forest green (
#162b21) and warm cream (#f3ebd3) text give crisp contrast without the harsh glare of pure black on white. - Color-coded states at a glance: You don't even have to read the status text to know what the extension is doing—sage green (
#96c99e) means running or verified, ochre gold (#e5a952) means Gemini is thinking or a new release is out, and terracotta coral (#e6926d) means paused, stopped, or rate-limited.
Quick Takeaways
- Split extensions when permissions and audiences diverge: Keeping Course Edition free of AI keys and cross-origin host permissions made it much simpler to install and trust.
- Never assume
content.jsis already mounted in an open tab: Callingchrome.scripting.executeScriptwith an idempotency guard saves users from having to refresh tabs after installing or updating.
Series Navigation: ← Previous: Series Overview & Living Release Index | Next: Part 2: Course Edition — Angular TOC Trees, 16× Video Beacons & Modals → | All Articles