A Chrome browser extension that helps users make more thoughtful purchasing decisions on Amazon by providing behavioral nudges, delayed gratification tools, and purchase alternatives.
ThinkTwice intervenes at the moment of purchase to help users pause and reconsider whether they truly need an item. The extension appears on Amazon product pages and presents users with:
- Behavioral nudges - Thoughtful prompts to reconsider the purchase
- "Sleep on it" reminders - Set timed reminders to reconsider purchases after 24 hours (or custom durations)
- Alternative considerations - Explore DIY, refurbished, or rental options
- Investment opportunities - Learn about investing the money you save
The extension is designed around behavioral economics principles:
- Delayed gratification: Research shows 3 out of 4 people change their mind within 24 hours
- Conscious consumption: Make intentional decisions rather than impulse purchases
- Financial wellness: Redirect saved money toward long-term goals
- Product page intervention - Overlay appears on Amazon product pages with decision options
- Behavioral nudges - Random nudges displayed to encourage thoughtful consideration
- Three decision paths:
- "I don't really need it" β Investment options view
- "Sleep on it" β Reminder system with browser notifications
- "I need it" β Confirmation and proceed to purchase
- Reminder scheduling with customizable durations:
- 1 minute (debug/testing)
- 1 hour, 6 hours, 24 hours
- 3 days, 1 week
- Product data extraction - Automatically captures product name, price, image, and URL
- Chrome Alarms API integration - Reliable scheduled notifications
- Browser notifications - Alerts when it's time to reconsider
- Extension badge count - Shows number of pending due reminders
- Popup interface - View all pending reminders with actions:
- "Still interested" β Opens product page
- "Not interested" β Dismisses reminder
- Chrome Storage API integration - All data stored locally
- Storage abstraction layer with TypeScript interfaces
- Message passing architecture for content scripts
- Normalized data structure - Products stored separately from reminders
- Investment options flow - UI exists but handlers are basic (console logs only)
- Close/dismiss behavior - Handler exists but needs refinement
- Alternative purchase options - DIY, Refurbished, Rent/Borrow flows
- Settings page - Customize notification preferences and reminder durations
- Statistics dashboard - Track money saved, purchases avoided
- Enhanced nudges system - Context-aware, personalized nudges
- Multi-marketplace support - Expand beyond Amazon (eBay, Walmart, etc.)
- Social features - Share decisions, group savings challenges
See docs/user-flows.md for detailed feature roadmap.
- Framework: Plasmo - Modern Chrome Extension framework
- UI Library: React 19 with TypeScript
- Storage: Chrome Storage API (local persistence)
- Notifications: Chrome Alarms & Notifications APIs
- Build Tool: Parcel (via Plasmo)
- Linting: ESLint with TypeScript and React plugins
- Formatting: Prettier with import sorting
- Node.js: Version 22.18.0 (exact version specified in
package.json)node --version # Should output v22.18.0 - npm: Comes with Node.js
- Google Chrome: Latest version
-
Clone the repository
cd /home/verte/Desktop/Thinktwice/plugin-3 -
Install dependencies
npm install
-
Start development server
npm run dev
This will:
- Start Plasmo development server
- Watch for file changes
- Build extension to
build/chrome-mv3-dev/ - Hot reload changes automatically
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right corner)
- Click "Load unpacked"
- Select the
build/chrome-mv3-dev/directory - The ThinkTwice extension should now appear in your extensions list
- Make changes to source files (
.tsx,.ts,.css) - Plasmo will automatically rebuild
- Reload the extension in Chrome:
- Click the refresh icon on the extension card in
chrome://extensions/ - Or use the keyboard shortcut:
Ctrl+R(Windows/Linux) orCmd+R(Mac) while focused on the extension
- Click the refresh icon on the extension card in
-
Visit an Amazon product page
https://www.amazon.com/dp/B0XXXXXXX -
Test the intervention flow
- ThinkTwice overlay should appear
- Click "Sleep on it" button
- Select a reminder duration (try "1 minute" for quick testing)
- Click "Set Reminder"
-
Test reminder notifications
- Wait for the reminder duration to elapse
- Browser notification should appear
- Extension badge should show "1"
- Click extension icon to see reminder in popup
-
Test reminder actions
- "Still interested" β Opens product page
- "Not interested" β Removes reminder
# Development
npm run dev # Start development server with hot reload
# Production
npm run build # Build production-ready extension
npm run package # Package extension for distribution
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint errors automatically
npm run format # Format code with Prettier
npm run format:check # Check code formattingplugin-3/
βββ assets/ # Static assets (icons, images)
β βββ icons/ # Extension icons and UI icons
βββ components/ # Reusable React components
β βββ Nudge.tsx # Behavioral nudge display
β βββ ui/ # UI component library
βββ contents/ # Content scripts (injected into web pages)
β βββ amazon.tsx # Main Amazon product page content script
βββ docs/ # Documentation
β βββ ARCHITECTURE.md # System architecture overview
β βββ sleep-on-it-implementation.md # Feature implementation details
β βββ user-flows.md # User flows and feature roadmap
βββ hooks/ # Custom React hooks
β βββ useStorage.ts # Chrome storage hook
β βββ usePendingReminder.ts # Reminder state management
βββ storage/ # Storage abstraction layer
β βββ IStorage.ts # Storage interface
β βββ BrowserStorage.ts # Chrome storage implementation
β βββ types.ts # Data models
β βββ index.ts # Storage singleton export
βββ utils/ # Utility functions
β βββ productExtractor.ts # Extract product data from Amazon DOM
βββ views/ # View components (screen-level)
β βββ ProductView.tsx # Main decision screen
β βββ IDontNeedIt.tsx # Investment options screen
β βββ SleepOnIt.tsx # Reminder duration selection
β βββ INeedIt.tsx # Confirmation screen
β βββ Celebration.tsx # Success/celebration screen
βββ background.ts # Background service worker
βββ popup.tsx # Extension popup (click icon)
βββ style.css # Global styles
βββ design-system.ts # Design tokens and theme
βββ package.json # Dependencies and scripts
Amazon Product Page
β
ProductView (Content Script)
β
User clicks "Sleep on it"
β
SleepOnIt View (Duration Selection)
β
productExtractor.ts (Extract product data)
β
BrowserStorage (Save product + reminder)
β
Message to Background Service Worker
β
Chrome Alarms API (Schedule notification)
β
[Time elapses...]
β
Alarm fires β Browser Notification
β
User opens popup β View reminders
β
User takes action β Update reminder status
- Context-aware: Automatically detects execution context (content script vs popup)
- Message passing: Content scripts communicate with background worker for storage operations
- Normalized data: Products stored separately from reminders to avoid duplication
- Type-safe: Full TypeScript interfaces for all data structures
See docs/ARCHITECTURE.md for detailed architecture documentation.
{
id: string // Amazon product ID (e.g., "B0XXXXXXX")
name: string // Product title
price: string | null // Price string (e.g., "$99.99")
image: string | null // Product image URL
url: string // Full Amazon product URL
timestamp: number // When saved (Date.now())
}{
id: string // UUID for reminder
productId: string // References Product.id
reminderTime: number // When to remind (Date.now() + duration)
duration: number // Duration in milliseconds
status: "pending" | "completed" | "dismissed"
}- Local storage only - No data sent to external servers
- No tracking - No analytics or telemetry
- User control - Users can dismiss reminders and clear data
- Minimal data collection - Only stores what's necessary for functionality
- ARCHITECTURE.md - System architecture and data flow
- sleep-on-it-implementation.md - Implementation details
- user-flows.md - User flows and feature roadmap
Built with Plasmo - The browser extension framework
Last Updated: November 2, 2025