How floaredor/ventrilo-interview works
Project type + purpose (what you’re diagramming)
This repo is a Chrome Extension (Manifest V3) whose purpose is to extract visible text from the currently active web page and display it in the extension popup, with a copy-to-clipboard action.
That implies a system made of browser-controlled runtime components (popup UI, extension runtime, injected script running in the page) rather than a traditional client/server split.
Read the file tree as architecture signals
From the tree + README, the “real” runtime components are:
• Extension UI
• popup.html (view)
• popup.ts (controller/logic; compiled to dist/popup.js)
• Injected / content execution
• content_script_main.ts (entry point; compiled into dist/content_script.js)
• text_extraction.ts (pure-ish library module for DOM text extraction; bundled into content script)
• Extension definition + permissions
• manifest.json (MV3; defines popup, permissions like activeTab, scripting, clipboardWrite)
• Build/tooling
• package.json, package-lock.json (scripts + dependencies: esbuild, typescript, @types/chrome)
• tsconfig.json
• dist/ is generated (not in tree, but referenced in README)
• Assets
The architecture is best described as event-driven:
• User opens popup → popup triggers injection → injected script extracts → sends message back → popup renders + enables copy.
Extension Popup Context
• Runs in its own isolated document (popup.html + dist/popup.js)
• Has access to Chrome extension APIs (subject to permissions)
Chrome Extension Platform / APIs
• chrome.scripting.executeScript
• chrome.runtime.sendMessage / onMessage
• (Potentially) activeTab permission boundary
Target Web Page Context (tab)
• Where the injected script executes (isolated world, but reading page DOM)
• Contains the DOM you’re extracting from
popup.html loads dist/popup.js
3. dist/popup.js → Chrome Scripting API: chrome.scripting.executeScript({ target: activeTab, files: ['dist/content_script.js'] })
Copy click → clipboard write (navigator.clipboard.writeText or fallback)
• popup.ts → esbuild → dist/popup.js
• content_script_main.ts + text_extraction.ts → esbuild → dist/content_script.js
This is important because in extensions, runtime files referenced by manifest / scripting injection must be the compiled artifacts.
Architectural patterns / principles used
• Multi-context architecture (Popup context vs Page context)
• Command + response via messaging
• Popup issues command (inject script)
• Content script returns result (message)
• Separation of concerns
• text_extraction.ts is a reusable “domain/library” module
• content_script_main.ts is orchestration glue
• popup.ts is UI/controller + platform API usage
• Permission-gated capabilities
• activeTab and scripting enable injection
• clipboard permission / API usage for copy
Relevant technologies/frameworks/libraries
• Chrome Extension Manifest V3 (manifest.json)
• Chrome Extension APIs: chrome.scripting, chrome.runtime
• TypeScript source → esbuild bundle → JS artifacts in dist/
• Clipboard: navigator.clipboard (+ document.execCommand fallback)
• Shows popup open → injection → extraction → message → display → copy
• Shows how TS sources become dist/*.js and which artifact is injected/loaded
• manifest.json → “Extension Definition (MV3): popup entry + permissions”
• popup.html → “Popup View”
• popup.ts → “Popup Logic”
• content_script_main.ts → “Injected Script Entry”
• text_extraction.ts → “Text Extraction Library”
• package.json / tsconfig.json → “Tooling/Build Config”