How mindstudio-ai/mindstudio-chrome-extension works
Project type and purpose
• This is a browser‐based Chrome Extension (“MindStudio Chrome Extension”) whose primary function is to inject a UI launcher into any webpage, open a persistent side panel, capture page context, and relay that context to MindStudio’s AI backend. In other words, it’s not a traditional server‐client web app but a client‐only browser extension with multiple pieces (background script, content scripts, side panel HTML/JS, shared libraries).
File structure
─ Top‐level config:
• package.json, tsconfig.json, webpack.*.cjs
• manifest.json (Chrome extension manifest)
─ src/background: background service worker (persistent or event‐driven tasks, listens for extension lifecycle events, handles cross‐origin fetches, and relays messages)
─ src/content: content scripts injected into every matching page. Within content:
· launcher/ui: multiple UI widgets (buttons, tooltips, context menus) that form the in‐page launcher
· modules: expansion manager, drag handler, position manager (UI behavior logic)
─ src/sidepanel: HTML + TS for the Chrome side panel (persistent “app” view)
─ src/shared: cross‐cutting services & types (API service, auth, messaging, storage, notifications, common utils for DOM and url filtering)
─ Build configurations: webpack.common/dev/prod for bundling each piece
README for additional insights
• Features: side panel integration, smart context capture, cross‐origin support, customizable settings.
• Development scripts: build, dev watch, type‐check, lint, format.