Skip to content

About

Chrome extension that blocks Amazon and everything it owns for a commitment period you choose. Emergency access exists, but it costs you.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Off Amazon

A Chrome extension that blocks Amazon, Amazon Business and everything Amazon owns for a number of days or weeks you choose. It is deliberately hard to switch off, but never impossible.

No accounts, no servers, no tracking. Everything stays in your browser.

The blocked page

What it does

  • Blocks every Amazon storefront in every country (amazon.com, .co.uk, .de, .fr, .es, .it, .ca, .co.jp, .in, .com.au and 22 more), including every subdomain: Amazon Business, Fresh, Music, Kindle, Alexa, Photos, Pay, Smile and the rest. Short links such as amzn.to and a.co are covered too.
  • Blocks what Amazon owns, each group with its own switch: Prime Video, MGM+ and Wondery, Audible, Twitch, IMDb and Goodreads, Zappos, Shopbop, Woot, AbeBooks, Whole Foods, Ring, Blink and eero.
  • Commitments. Pick 1 week, 2 weeks, 1 month, 3 months or any custom length up to a year. The toolbar badge shows which day you are on, and the dashboard keeps score of every attempt it turned away.
  • A blocked page worth landing on. Instead of a browser error you get a calm page with your progress, a short line to think about, and a way back.
  • Emergency access that costs something. It exists for the day you really do need to cancel a subscription or find a receipt. Getting there takes three steps and a forced sixty second pause, the window closes on its own, and it is recorded as a slip on your commitment.
  • Light and dark, following your system setting.

Install

The extension is not on the Chrome Web Store. You load it straight from this folder, which takes about a minute.

  1. Get the code. Either clone it:

    git clone https://github.com/DJProspero1/off-amazon.git

    or use Code → Download ZIP on GitHub and unzip it somewhere permanent. Chrome loads the extension from that folder every time it starts, so do not delete or move it afterwards.

  2. Open Chrome and go to chrome://extensions.

  3. Turn on Developer mode with the switch in the top right corner.

  4. Click Load unpacked and choose the folder that contains manifest.json.

  5. Amazon is blocked from this moment. A welcome page opens where you can pick how long you are staying away.

Optional: click the puzzle piece icon in the toolbar and pin Off Amazon so you can see the day counter.

The same steps work in Edge (edge://extensions), Brave (brave://extensions), Arc, Vivaldi and any other Chromium browser.

Updating

Pull or download the new version into the same folder, then open chrome://extensions and click the reload icon on the Off Amazon card. Your commitment and history are kept.

Uninstalling

Open chrome://extensions and click Remove on the Off Amazon card. That deletes the stored commitment and history as well. If you only want a break from the block, use the emergency flow instead, so the record stays intact.

Using it

The popup

Click the toolbar icon. It shows the current day of your commitment, how many attempts were blocked and how many slips you have taken. Before you have chosen a commitment it offers the presets right there.

Popup, dark Popup, light

The dashboard

Right click the icon and choose Options, or click Open dashboard anywhere. The dashboard is where you:

  • choose or extend a commitment,
  • toggle the optional groups (Prime Video, Audible, Twitch and so on),
  • allow AWS if you need the console for work,
  • see the history of finished commitments,
  • start the emergency flow.

Dashboard

Choosing a commitment

Blocking is on from the moment you install. A commitment adds a finish line and a counter. Pick a preset or type a custom number of days or weeks, up to 365 days. When it ends the block stays on, and you can extend, start a new one, or switch off with a single confirmation. Nothing nags you.

Emergency access

The quiet I have an emergency link sits at the bottom of the popup and of the blocked page. It leads to a three step flow:

  1. Are you sure? You see where you are in the commitment and pick what you need: 15 minutes, 1 hour, or ending the commitment altogether.
  2. Take a minute. A sixty second counter you cannot skip. Most urges are gone before it reaches zero. The bright button on every step is the one that keeps blocking.
  3. Say it in your own hand. Type the sentence I choose to break my commitment. Pasting is disabled.

Emergency flow, step 2

A timed window lifts the block for exactly that long and then puts it back by itself, whether or not you remember. The popup shows the countdown and a button to close the window early. Every window is recorded as a slip on the commitment and in your history.

Ending the commitment moves it to history as "ended early" and turns blocking off until you turn it back on.

Honest limits

This is a Chrome extension, not a parental control. Anyone can remove or disable it from chrome://extensions, use another browser, or use the Amazon app on a phone. The design goal is friction and a clear moment of choice, not a lock. If you need a real lock, pair it with a DNS level blocker or a supervised profile.

Privacy

The extension makes no network requests of its own. It asks for three permissions:

Permission Why
declarativeNetRequest The blocking itself. Chrome applies the rules; the extension never sees your traffic.
storage Your commitment, settings, counters and history, kept in chrome.storage.local.
alarms To wake up when an emergency window or a commitment ends.

Host permissions are listed for the blocked domains only, because Chrome requires them to redirect a request to the blocked page. There is no <all_urls>.

Customising

Adding or removing domains

Every domain lives in lib/domains.js. Add a domain to CORE_DOMAINS or to one of the groups, then regenerate the manifest so the host permission is included:

node scripts/build-manifest.mjs

Reload the extension in chrome://extensions. Subdomains are always included, so example.com also covers shop.example.com.

Changing the friction

The cooldown length, the confirmation phrase and the emergency window lengths are constants at the top of lib/state.js: COOLDOWN_SECONDS, CONFIRM_PHRASE and EMERGENCY_WINDOWS. The blocked page lines are in lib/format.js.

Look and feel

All colours, type and spacing are CSS custom properties at the top of shared.css. The light theme overrides them under prefers-color-scheme: light.

How it works

  • background.js is a Manifest V3 service worker. It watches the stored state and turns it into dynamic declarativeNetRequest rules. When the state says "blocking", each rule redirects main frame and iframe navigations to blocked.html, carrying the original URL in the fragment. When an emergency window is open or blocking is off, the rules are removed. Alarms bring the block back when a window expires.
  • lib/state.js holds the whole state model and the pure functions that change it. Pages never touch network rules; they update state and the worker reacts.
  • lib/rules.js builds the rules. An optional allow rule with higher priority carves AWS back out of the amazon.com block.
  • popup.html, blocked.html and dashboard.html are plain HTML with ES modules and no dependencies.
manifest.json           generated by scripts/build-manifest.mjs
background.js           service worker
popup.html / .css / .js toolbar popup
blocked.html / …        page shown instead of Amazon
dashboard.html / …      options page: commitment, groups, history, emergency flow
shared.css              design tokens and shared components
lib/domains.js          every blocked domain, grouped
lib/state.js            state model and mutations
lib/rules.js            state → declarativeNetRequest rules
lib/format.js, lib/ui.js  helpers
icons/                  toolbar icons (regenerate with scripts/make-icons.ps1)
test/                   unit tests and a Playwright end to end run

Development

Requirements: Node 20 or newer. Nothing needs installing to run the extension itself.

npm test                  # unit tests for the state and rule logic
npm run build:manifest    # regenerate manifest.json from lib/domains.js
npm run icons             # regenerate icons (Windows PowerShell, uses System.Drawing)

The end to end test loads the extension into a real Chromium, proves that Amazon navigations land on the blocked page, runs the commitment and emergency flows, and refreshes the screenshots in docs/screenshots:

npm i -D playwright
npx playwright install chromium
npm run e2e

Edit files, then click reload on the extension card in chrome://extensions. Popup and dashboard changes show up on the next open; service worker changes need the reload.

Contributing

Issues and pull requests are welcome. Useful contributions: domains that are missing, better copy for the blocked page, translations, and Firefox support (Firefox implements declarativeNetRequest, but redirecting to an extension page needs testing there).

License

MIT

About

Chrome extension that blocks Amazon and everything it owns for a commitment period you choose. Emergency access exists, but it costs you.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages