How koffeejava/tuxtility works
Project type and purpose
• Tuxtility is a browser extension (for Scratch or similar block-based environments) written in JavaScript. Its goal is to inject new “blocks” and UI into the host page, with an optional permission manager (TPM) that controls what user/system information the extension may display.
File structure
• Top-level scripts:
• base.js – the minimal or “base” extension loader
• main.js – the full release build that includes all features (blocks, TPM, UI)
• archive/ – all past releases (1.0 → 1.5.x, betas), useful for version history but not part of the runtime
• Version-test/ – sandbox for validation tests or experimental scripts
• .github/ – issue templates and CI/workflow configs
• README.md, LICENSE, To Do.md – documentation and project roadmap
README for additional insights
• TPM (Tuxtility Permission Manager): modular feature for users to opt in/out of data collection
• “Flavors”: forks must comply with extension-ID, crediting, and anti-malware rules
• Release process: GitHub releases for “Full” and “Nightly” channels
a. Main components
1. Browser Extension Container
– Manifest (implicit) + base.js loader
– Content Script(s) (main.js when full release)
2. Permission Manager (TPM Module)
3. Block Registry & Injector
4. UI Layer (e.g., modal dialogs, settings panel)
5. Host Page (Scratch or target website DOM)
6. External Services
• GitHub (for version check and updates)
• Discord (support/issue reporting)
b. Relationships and data flows
– On page load, base.js loads content scripts → main.js registers blocks
– TPM intercepts any calls to collect user info → checks user preferences
– Block Injector manipulates host-page DOM to insert new block palette
– UI Layer reads/writes TPM settings (in localStorage or extension storage)
– Background/Updater polls GitHub API for new releases → notifies UI if updates exist
– User actions in UI may open external links (Discord, issues page)
c. Architectural patterns and principles
– Modular separation: core loader vs. feature modules (blocks, TPM)
– Single-page injection: all logic runs client-side in the browser context
– Extension storage for user preferences
– Versioning via separate release channels (stable vs. nightly)
d. Key technologies and frameworks
– JavaScript (ES6 modules if used)
– Browser extension APIs (chrome.* or browser.*)
– GitHub Releases & Badges for distribution
– Discord API (for support badge link)