This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Chrome extension called "Devola" that enhances Amazon.co.jp wishlist pages by displaying point rewards for each item. The extension fetches product pages, parses point information, and injects it into the wishlist UI.
IMPORTANT: This extension only works with Amazon.co.jp, not Amazon.com or other Amazon domains.
pnpm install- Install dependencies (faster than yarn/npm)pnpm build- Build extension for production (outputs to/dist)pnpm dev- Build extension for development with optimizations disabledpnpm watch- Build in watch mode for development with hot reloadingpnpm clean- Remove the/distdirectorypnpm type-check- Run TypeScript type checking without compilation
Note: This project uses pnpm for faster installs and better disk space efficiency.
src/index.ts- Entry point that detects wishlist pages and triggers processingsrc/wishlist.ts- Main logic for scanning wishlist items and injecting point datasrc/util.ts- Utility functions for fetching and parsing point information from product pages
Content Script Flow:
index.tsdetects if current page is a wishlist pagedoWishlist()finds all product items in the wishlist- For each item,
editItem()extracts the product URL fetchPoints()makes HTTP request to product pageparsePoints()uses DOM selectors to extract point information- Point data is injected into the wishlist item's price section
Point Parsing Strategy: The extension uses multiple CSS selectors to handle different product types:
- Normal items:
#addToCart #pointsInsideBuyBox_feature_div span.a-color-price - Kindle items:
.loyalty-points .a-align-bottom,.ebooks-aip-points-label .a-color-price
Dynamic Content Handling: Uses MutationObserver to detect when new wishlist items are dynamically added to the page.
- Uses Webpack 5 with TypeScript compilation
- CopyWebpackPlugin copies
public/folder contents todist/ - Manifest v3 Chrome extension format (compatible until 2025+)
- Target: ES2022 with modern TypeScript configuration
- Development mode includes source maps and faster compilation
- Production mode includes minification and optimization
public/manifest.json- Chrome extension manifest with content script configurationpublic/_locales/- Internationalization files (Japanese/English)public/images/- Extension icons- Content script runs on Amazon.co.jp wishlist pages only