How sssungjin/velog-stats works
Project type and purpose
• This is a Chrome extension (“Velog Stats”) that fetches and displays real-time statistics (views, likes, comments) for a user’s Velog blog posts.
• It consists of a popup UI, background scripts, helper modules, and a small set of static pages (documentation, release notes, privacy policy).
File structure
• Manifest (manifest.json): defines extension permissions, scripts, pages.
• UI components:
• popup.html / popup.js – the extension’s main interface where the user enters a Velog ID and clicks “조회.”
• pages/index.html (+ CSS), pages/release-notes.html – documentation and landing pages served from the extension.
• Background logic:
• background.js – listens for events (e.g., popup requests), orchestrates API calls.
• api.js – encapsulates HTTP calls to the Velog API, retrieving posts and stats.
• logManager.js – processes, caches, and sorts the fetched statistical data.
• utils.js – shared helper functions (e.g., cookie retrieval).
• Privacy policy and static HTML are extra pages registered in the manifest.
Key dependencies & interactions (from README)
• Uses Chrome extension APIs for message passing, cookie access, and storage.
• Relies on the Velog site’s access_token cookie for authentication when calling Velog’s REST endpoints.
• No external build tools—pure HTML/JS/CSS loaded by the browser.
Detail
• Which Chrome extension APIs are in use (e.g., chrome.runtime.sendMessage, chrome.cookies.get).
• Error or loading states if they affect architecture (e.g., error handling in background.js).