How jumpingcodes/url-hider works
Project type and purpose
• URL-Hider is a Chrome browser extension whose purpose is to let users add URLs to a “hidden list,” automatically hide those URLs when those pages load, and allow the user to copy back the original URL on demand.
File structure
• manifest.json: describes extension metadata, permissions (tabs, storage), and entry points (background and popup).
• background.js: runs in the background context, listens for tab events, applies the hiding logic, and mediates storage.
• popup.html / popup.js / styles.css: the user‐facing popup UI where you add URLs to hide and copy them back.
• jsconfig.json: configures module resolution for any JS tooling.
• README.md: usage instructions.
README for additional insights
• No external services or servers—all logic runs client-side.
• Data persistence is implicit (Chrome Storage API).
• No content scripts—the background script directly uses the Chrome Tabs API to detect when a hidden URL is loaded.
Main components and their relationships
a. Components:
• Manifest (configuration)
• Popup UI (popup.html, popup.js, styles.css)
• Background Script (background.js)
• Chrome Runtime & Tabs APIs (built-in browser services)
• Storage (chrome.storage.local)
b. Interactions:
2. popup.js reads/writes hidden-URL list via chrome.storage.local.
3. background.js subscribes to chrome.tabs.onUpdated or chrome.tabs.onActivated events.
5. When the user clicks “copy original URL,” popup.js retrieves it (from a temporary in-memory map or storage) and writes it to the clipboard.
c. Architectural patterns:
• Event-driven messaging between popup UI and background script via Chrome runtime messaging or direct storage API.
• Clear separation: UI logic in popup, core logic in background, data layer in storage.
d. Key technologies:
• Chrome Extension Manifest v3 (or v2 if older)
• Chrome Storage API (chrome.storage.local)
• Chrome Tabs and Runtime APIs
• Vanilla JS for UI & background logic