How noah20102021/giftcardreminder works
Purpose and Runtime
giftcardReminder is a Chromium browser extension for tracking gift-card balances, currencies, domains, and optional expiration dates. It runs entirely client-side: card data is stored in browser local storage, with no backend or external service indicated. The extension is loaded unpacked through Chrome/Edge and is defined by manifest.json.
Extension Entry Points
The manifest is the architectural dispatch point for extension pages and browser integration: manifest.json. The user-facing popup/listing is index.html, backed by index.js; dedicated extension pages support creation, deletion, and data administration:
• index.html, index.js
• add.html, delete.html
• settings.html
Gift Card Data Lifecycle
Users add card records through the add flow, which captures website domain, balance, currency, and expiry. Records are persisted in browser local storage and then rendered by the primary list view. Deletion is isolated into its own page/flow, while settings provides bulk data management:
• add.html
• delete.html
• settings.html
The storage boundary is the browser’s local storage: data remains local to the installed browser profile and is not sent to an application server. assets/storage(no longer in use).xml is explicitly legacy and should not be treated as the active persistence source.
Popup and Card Presentation
The extension’s main interaction surface is a card-based view launched from the browser toolbar. index.html supplies the structure, while index.js drives the dynamic behavior and state-backed rendering. Shared visual styling and client-side interactions are kept under assets:
• index.html, index.js
• assets/style.css
• assets/script.js
Site-Match Notification Flow
A core browser-integration behavior compares the currently visited site against saved gift-card domains. When a match exists, the extension displays an upper-right-page indicator; clicking it exposes the relevant card details. The manifest must connect this browser/page-context behavior to the extension’s packaged scripts and permissions:
• manifest.json
• index.js
• assets/script.js
Import, Export, and Storage Administration
The settings surface imports gift-card data by adding imported JSON records to existing local data, exports records as a JSON file, and can clear all stored cards. This is a client-only serialization/import boundary and should preserve compatibility with the locally stored card schema:
• settings.html
• assets/script.js
• assets/style.css
Packaging and Development
This is a static HTML/CSS/JavaScript extension rather than a bundled web application. package.json and scripts/watcher.js suggest optional Node-based local development/watch support, but the runtime artifact remains the extension directory loaded by Chromium. Packaged icons support browser UI identity:
• package.json
• scripts/watcher.js
• icons
Main entry points: manifest.json Extension manifest · index.html Card list popup · settings.html Settings and data admin · script.js Shared interactions
Components 15
Chromium extension
Static files loaded unpacked by Chrome or Edge.
- Extension manifest · Dispatches extension pages, scripts, permissions, and browser integration.
manifest.json - Chromium browser · Hosts the extension and provides the active-tab context.
- Site-match indicator · Shows matching saved-card details on visited domains.
- Extension icons · Browser UI identity assets.
icons
User surfaces
- Card list popup · Primary toolbar-launched card view.
index.html - Popup state and rendering · Renders stored cards and drives popup behavior.
index.js - Add card flow · Captures domain, balance, currency, and expiry.
add.html - Delete card flow · Isolated card removal workflow.
delete.html - Settings and data admin · Imports, exports, and clears card data.
settings.html - Shared interactions · Supports page behavior and site-match indicator interactions.
assets/script.js - Shared styles
assets/style.css
Local data lifecycle
- Browser local storage · Stores gift-card records only in the local browser profile.
- JSON import/export · Merges imported records and exports the local card schema.
Development support
- Node development metadata · Optional local development/watch support.
package.json - Development watcher
scripts/watcher.js
Connections 19
- Extension manifest → Chromium browser: installed in
- Extension manifest → Card list popup: declares
- Extension manifest → Site-match indicator: enables · Connects packaged scripts and permissions to page-context behavior.
- Extension manifest → Extension icons: packages
- Chromium browser → Card list popup: opens from toolbar
- Card list popup → Popup state and rendering: runs
- Card list popup → Shared styles: uses
- Popup state and rendering → Browser local storage: reads and renders
- Add card flow → Browser local storage: creates card records
- Delete card flow → Browser local storage: removes card records
- Settings and data admin → Shared interactions: uses
- Settings and data admin → Shared styles: uses
- Shared interactions → Browser local storage: manages
- Settings and data admin → JSON import/export: offers
- JSON import/export → Browser local storage: imports to and exports from
- Chromium browser → Site-match indicator: provides current site
- Site-match indicator → Browser local storage: matches saved domains
- Site-match indicator → Shared interactions: shows details through
- Node development metadata → Development watcher: supports