Web apps

Chrome extension hiding shopping prices for 24 hours

Manifest V3 Chrome extension that hides shopping prices on listed sites for 24 hours to curb impulse buying, built with plain JavaScript.

javascripthtmlcssmanifest-v3node

Built 1 time, downloaded 0 times.

Install from your terminal

Run this in your project folder. It signs you in, shows what changes and asks before it overwrites a file.

npx claude-lab add chrome-extension-hiding-shopping-prices-for-24-hours-e8add2
CLAUDE.md
# the app: project memory

## What this is

A Chrome extension (Manifest V3) that hides shopping prices on a short list of sites for 24 hours after you click Start. The goal is to reduce impulse buying. The window is firm: there is no override in v1.

## Stack

No framework was chosen, so the project uses:

- Plain JavaScript (ES modules are not required), HTML, and CSS.
- No build step and no runtime npm dependencies.
- Node 20 or newer, used only to run tests.

## Layout

- `manifest.json`: the MV3 manifest.
- `src/background.js`: service worker. Stores `hideUntil` in `chrome.storage.local` and sets the badge.
- `src/content.js`: injects a style that hides price elements on supported sites.
- `src/price-hide.js`: pure logic. Exports `HIDE_MS`, `isWithinHideWindow(hideUntilMs, nowMs)`, and `computeHideUntil(nowMs)`.
- `src/sites.js`: host names and CSS selectors for prices. Fragile; needs manual updates.
- `src/popup.html` and `src/popup.js`: Start button and time remaining.
- `tests/`: `node:test` files.
- `.claude/skills/verify/`: the verify skill.

## Commands

- Unit tests: `node --test tests/`
- Syntax check: `node --check src/*.js`
- Load the extension: open chrome://extensions, turn on Developer mode, click Load unpacked, and select this folder.

## Rules

- `src/price-hide.js` must not call any `chrome.*` API, so tests run in Node.
- No network requests, no analytics, no remote code, no `eval`, no inline scripts (MV3 content security policy).
- Request only `storage` and `activeTab`, plus host permissions for the sites in `src/sites.js`.
- Never store personal data.
- Never add secrets. If a key is ever needed, use a `YOUR_...` placeholder.

## Gotchas

- The service worker sleeps. Never keep state in global variables; always read and write through `chrome.storage`.
- After editing `content.js` or `background.js`, click reload on the extension card at chrome://extensions, then refresh the shopping tab.
- Selectors break when sites change. Expect to update `src/sites.js`.

## Working style

- Make small changes and explain each step in plain language.
- Ask before adding a dependency or changing permissions.
- Work in phases from `PLAN.md`. Start each phase in a fresh session with `/clear`.

## Done means

- `node --test tests/` passes.
- The verify skill reports all PASS.
- The relevant items in `SPEC.md` pass.

## Review standard

@REVIEW.md
Use for my project