How kmzk-dev/disc-post works
Project type and purpose
• DiscPost is a single-extension full-client Chrome browser extension (Manifest V3).
• Its purpose is to let users send quick messages to Discord channels via Webhook URLs without leaving the browser.
File structure
• Top-level files:
• manifest.json (in dist/) – Chrome extension manifest
• popup.html, setting.html – UI entry points
• statics/js/{background.js, popup.js, setting.js} – background service worker and UI scripts
• statics/css/root.css, statics/img – styling and assets
• No server-side code: all logic runs in the browser extension context.
• chrome.storage.local is the persistent datastore.
README for additional insights
• Technical stack: Manifest V3, chrome.storage.local.
• UI flow: popup for message input, settings page for Webhook management.
• Network flow: extension → Discord Webhook endpoint (external HTTP POST).
Main components
a. Chrome Browser (host environment)
b. Extension Package
– manifest.json
– Popup UI (popup.html + popup.js)
– Settings UI (setting.html + setting.js)
– Background Service Worker (background.js)
– Static assets (CSS, images)
c. Local Data Store
– chrome.storage.local
d. External Service
– Discord Webhook endpoints (HTTPS)
Relationships and interactions
• Popup UI reads registered Webhooks from chrome.storage.local.
• User types message and selects Webhook → popup.js sends a message to background.js.
• Background Service Worker receives the payload → reads any additional config from chrome.storage.local → issues HTTPS POST to the selected Discord Webhook URL.
• Settings UI reads/writes webhook entries to chrome.storage.local.
• (Optional) Background worker can send status back to popup.js to show success/failure.
Architectural patterns and design principles
• MV*-style separation between UI pages and background logic.
• Single source of truth in chrome.storage.local.
• Event-driven messaging between UI scripts and background service worker.
• Clear separation of concerns:
• Popup UI – transient user input
• Settings UI – configuration management
• Background – network I/O and storage orchestration
Relevant technologies
• Google Chrome Extension Manifest V3
• chrome.storage.local API
• Fetch API or XHR for Webhook calls
• HTML/CSS/Vanilla JS for popup and settings