How moseoridev/icampuscheck works
Main Components
• Background Script (background.js): Acts as the core controller. It handles browser events, manages caching, and coordinates asynchronous requests for performance improvement.
• Content Script (content.js): Injects code into canvas.skku.edu pages to extract course information from the designated tab (“강의콘텐츠”). It is the link between the extension and the web page’s DOM.
• Auxiliary Scripts (executescript.js & utils.js): These scripts contain utility functions and extra execution logic to facilitate core operations such as DOM manipulations, asynchronous operations, or data formatting.
• Dependency/Build Management: Files like package.json, pnpm-lock.yaml, .prettierrc, and .prettierignore indicate that the project uses JavaScript tooling for ensuring code quality and managing dependencies.
Understand the Component Interactions
• The manifest.json defines the behavior and permissions, linking to the background script, content script, and popup UI.
• The background script performs asynchronous operations (parallel requests, caching data) and communicates with both the popup UI and content scripts via message passing.
• The content script interacts directly with the target website (canvas.skku.edu), retrieving information from the "강의콘텐츠" tab.
• The popup script gathers processed data from the background or content scripts and renders the user interface for deadlines, including features like dark mode and visual emphasis on items with impending deadlines.
• Utilities and execution helper scripts provide supporting functions used by both foreground and background components.
Architectural Patterns and Key Design Principles
• Modular Design: Each script (background, content, popup, utilities) serves a distinct role, ensuring separation of concerns.
• Asynchronous & Event-Driven Behavior: Highlight how parallel asynchronous requests improve performance and how event listeners trigger reactive behaviors.
• Caching Strategy: Emphasize the use of caching mechanisms so that reopened windows don’t trigger full reloads.
• Manifest V3 Compliance: Note how the manifest governs permissions, service workers (if used), and updated extension APIs.