This Chrome extension hides prices on webpages by masking currency amounts in text content. It works on static and dynamically updated pages, providing a clean browsing experience without distracting price information.
Automatically detects and hides prices in multiple currencies and formats:
- Symbols: $, €, £, ¥, ₹, ₩, ₽, ₺, ₫, ₪, ₱, ฿, ₴, ₦, ₲, ₵, ₡, ₭, ₮, ₨, ₸, ₼, ₥, ₧, ₯, ₠, ₢, ₣, ₤
- Currency codes: USD, EUR, GBP, JPY, CAD, AUD, NZD, CHF, CNY, RMB, HKD, SGD, SEK, NOK, DKK
- Handles both prefix format (
$100) and suffix format (100€) - Supports various number formats (commas, periods, spaces as separators)
- Text-based masking: Automatically finds and masks prices in any text content
- Site-specific optimizations: Enhanced support for popular sites like Amazon with special price element handling
- Non-destructive approach: Original price data is preserved in the DOM and only visually hidden using CSS
- Dynamic content support: Automatically detects and masks prices added after page load via AJAX/SPA updates
Exclude specific sections from price masking by adding data-price-hider-ignore to any parent element:
<div data-price-hider-ignore>
<!-- prices here won't be masked -->
<p>Sale: $50.00</p>
</div>- No data collection
- No external network requests
- All processing happens locally in your browser
- No permissions beyond content script injection
- Efficient DOM traversal and mutation observation
- Skips non-relevant elements (scripts, styles, inputs, etc.)
- Minimal performance impact on page load and rendering
The extension will be available on the Chrome Web Store.
- Clone this repository
- Open Chrome and go to
chrome://extensions - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked
- Select the
price-hiderfolder - Visit any webpage with prices - they should be masked as
•••
For developers who want to package the extension:
# Install dependencies (for testing)
npm install
# Run tests
npm test
# Build production package (excludes test files)
npm run buildThis creates price-hider-chrome-store.zip containing only production files (manifest, content script, icons). See PACKAGING.md for details.
The extension uses a combination of techniques to hide prices effectively:
- Pattern Matching: Sophisticated regex patterns detect various price formats
- CSS Masking: Prices are wrapped in spans and visually replaced with
•••using CSS - Mutation Observer: Monitors the page for dynamic content changes
- Element-Level Detection: Identifies known price container elements (e.g., Amazon's
.a-priceclass)
When the extension is disabled or removed, all original prices automatically become visible again since the masking is CSS-based.
This extension includes a comprehensive test suite with over 100 tests covering:
- Pattern matching for various currencies and formats
- DOM manipulation and masking logic
- Edge cases and error handling
- Real-world e-commerce scenarios
- Performance testing
# Install dependencies
npm install
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageCurrent Test Coverage:
- 98.42% statement coverage
- 84.94% branch coverage
- 100% function coverage
- 98.4% line coverage
See TESTING.md for more details about the test suite.