Skip to content

Repository files navigation

Spendemon

Spendemon is a local-first browser extension for Firefox, Chrome, and Chromium. It introduces a deliberate pause before an online purchase, without tracking money, collecting personal data, or touching payment details.

Instead of telling you what to buy, it asks one useful question: would you still want it tomorrow?

Available on Firefox Add-ons.

Screenshots

Spendemon reflection overlay on a shopping cart page

Highlights

  • Works across online shops. Purchase-intent buttons are classified locally from their accessible text in Italian and English. Amazon, Zalando, and AliExpress also have more precise product-title detection.
  • Creates a moment of reflection. Checkout and payment actions open a short, accessible dialog with a yes/no reflection, a configurable delay, and clear choices to cancel, defer, or continue.
  • Keeps a local quarantine list. An item can be put aside for 24 or 48 hours and revisited later from the dashboard.
  • Never tracks spending. There are no prices, budgets, spending totals, or purchase recommendations. Only decisions avoided, deferred, or continued.
  • Respects privacy by design. All data stays in the browser profile. Password fields, card fields, and payment iframes are ignored.

Install for development

Requirements: a current Node.js LTS release and npm.

npm install
npm run build

The production build creates:

  • dist/: Firefox extension bundle
  • dist-chromium/: Chrome and Chromium extension bundle
  • artifacts/: versioned ZIP archives for distribution

Load the extension

Firefox

  1. Open about:debugging#/runtime/this-firefox.
  2. Select Load Temporary Add-on.
  3. Choose dist/manifest.json.

Chrome or Chromium

  1. Open chrome://extensions.
  2. Enable Developer mode.
  3. Select Load unpacked and choose dist-chromium/.

Development workflow

npm run build:dev     # development build with sourcemaps
npm run format        # format source code and project files
npm run format:check  # verify formatting without changing files
npm run typecheck     # run the TypeScript compiler
npm test              # run the Vitest unit suite

Run the full local verification before sharing a change:

npm run format:check && npm run typecheck && npm test && npm run build:dev

How it works

  1. A lightweight content script watches for clicks on likely purchase buttons.
  2. It classifies the clicked button as add-to-cart, checkout, or payment intent.
  3. Add-to-cart receives a non-blocking nudge. Checkout and payment can show the reflection overlay.
  4. The background worker stores settings, decision history, message cooldowns, and deferred items in browser.storage.local / chrome.storage.local.
  5. The dashboard and popup read the same local state; no request is sent to an external service.

The overlay is mounted in a closed Shadow DOM to avoid style conflicts with the shop, traps keyboard focus while it is open, and respects prefers-reduced-motion.

Privacy and permissions

Spendemon is intentionally local-only.

Permission Why it is needed
storage Stores settings, the deferred-item list, message history, and local decision statistics.
tabs Lets the popup identify the active tab and confirm whether the content script is available.
HTTP/HTTPS host access Lets the content script detect purchase intent locally on supported web pages.

The extension does not send telemetry or analytics. It does not read password fields, card fields, or payment iframes, and it cannot submit, cancel, or alter an order.

Project structure

src/
  adapters/    Site-specific product-page detection and generic button classification
  background/  Message routing and deferred-item creation
  content/     Click interception and the Shadow DOM overlay
  messages/    Italian message catalogue and selection engine
  shared/      Types, risk scoring, URL handling, and browser API wrapper
  storage/     Serialised local-state mutations
  ui/          Popup, settings page, dashboard, and shared UI primitives
  tests/       Vitest unit tests
public/        Extension manifest, HTML entry points, and icons
scripts/       Build and packaging script

To support a shop with more accurate product detection, add a SiteAdapter in src/adapters/ and register it in src/adapters/index.ts. The button classifier remains generic, so an adapter is optional for basic purchase-intent detection.

Firefox publishing

npm run build
npm run lint:ext

Upload artifacts/spendemon-firefox-<version>.zip through the Firefox Developer Hub. For an AMO submission, provide the repository source and these reproducible build instructions:

npm ci
npm run build

Firefox uses background.scripts; Chrome and Chromium use background.service_worker. The build script creates the appropriate manifest for each target.

Safety boundaries

  • Spendemon pauses interaction; it never makes a purchase decision for the user.
  • The original click is replayed at most once, and only after an explicit “continue” choice.
  • Fully embedded payment flows inside iframes are deliberately left untouched.
  • The extension never uses prices or shopping totals in its messaging or scoring.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages