How minprocess/notessidepanel works
Project type and purpose
• This is a browser extension (Chrome & Edge) that injects a side panel into the browser UI.
• Its purpose is to let users type and save notes per tab, persisting them in local storage.
File structure
• manifest.json: registers the extension, grants permissions (storage, tabs, sidePanel) and declares sidepanel.html as the side panel entry point.
• sidepanel.html: the HTML for the UI loaded into the side panel.
• sidepanel.js: the single script controlling UI behavior and API calls.
• styles.css: styling for the panel.
• No background scripts or content scripts—logic lives entirely in the side panel.
README for additional insights
• Uses Chrome Extension APIs: sidePanel, storage, tabs.
• On panel load, reads chrome.tabs to get the current tab’s ID, then chrome.storage.local to fetch that tab’s saved note.
• “Save Note” writes the textarea contents to chrome.storage.local under a key derived from the tab ID.
• No worker threads or message-passing beyond direct API calls in sidepanel.js.
Components & interactions
a. Main components
• Browser Host (Chrome/Edge)
• Extension Side Panel (UI + JS)
• Chrome Extension APIs (tabs, sidePanel, storage)
• Local Storage (chrome.storage.local)
b. Relationships & data flows
• Side Panel UI ←→ sidepanel.js logic
• sidepanel.js → chrome.tabs.query() to get tab ID
• sidepanel.js → chrome.storage.local.get/ .set() to read/write notes
• chrome.storage.local persists data inside the browser
c. Architectural patterns / principles
• Single-page UI component loaded on demand (sidePanel API)
• Simple client-side MVC: HTML/CSS = view, JS = controller/business logic, storage = model
• Key-based storage partitioned by tab ID
d. Key technologies/frameworks
• Chrome Extension Manifest v3 (permissions, side_panel declaration)
• Chrome Extension APIs: sidePanel, tabs, storage
• Vanilla HTML/CSS/JavaScript