CoinPeek - Bitcoin Price Badge & Gas Tracker

A fast, lightweight Chrome extension that shows real-time Bitcoin price on the extension badge, plus ETH prices, gas fees, and a crypto converter.

π Features
- Real-time Prices: Monitor Bitcoin and Ethereum prices with 24-hour change indicators
- Gas Fee Tracking: View current network fees for both Bitcoin and Ethereum networks
- Smart Converter: Convert between BTC, ETH, and USD with live exchange rates
- Modern Interface: Clean, responsive design with gradient styling
- Background Updates: Automatic price updates every minute via service worker
- Badge Display: Bitcoin price shown in extension badge for quick reference
- Optimized Performance: Enhanced codebase with reduced memory footprint
π¦ Installation
From Chrome Web Store (Recommended)
Install from Chrome Web Store
Manual Installation (Developer Mode)
- Download or clone this repository
- Open Chrome and navigate to
chrome://extensions/
- Enable βDeveloper modeβ in the top right corner
- Click βLoad unpackedβ and select the extension folder
- The extension icon will appear in your Chrome toolbar
π― Usage
Basic Usage
- View Prices: Click the extension icon to see current BTC/ETH prices
- Check Gas Fees: Network fees are displayed inline with each currency
- Convert Currencies: Use the bottom converter for quick calculations
- Manual Refresh: Click the refresh button (β») for instant updates
Advanced Features
- Swap Currencies: Click the β button to quickly reverse conversion direction
- Badge Monitoring: Bitcoin price is always visible in the extension badge
- Offline Support: Last known prices cached for offline viewing
π§ Technical Stack
Architecture
- Frontend: Vanilla JavaScript (ES6+), CSS3 with modern gradients
- Backend: Chrome Service Worker (Manifest V3)
- Storage: Chrome Storage API for data persistence
- Updates: Chrome Alarms API for background synchronization
- β
Eliminated code duplication (removed ~25% of codebase)
- β
Centralized configuration management
- β
Optimized DOM element caching
- β
Unified API call architecture
- β
Enhanced error handling with fallbacks
π API Integration
Primary Data Sources
| Service | Purpose | Fallback Available |
|βββ|βββ|ββββββ-|
| CoinGecko | BTC/ETH prices | β (Primary only) |
| Blocknative | Ethereum gas fees | β
(Default values) |
| mempool.space | Bitcoin gas fees | β
(2 additional APIs) |
Reliability Features
- Multiple Bitcoin gas fee APIs with automatic failover
- Graceful degradation to cached data during outages
- Default gas values when all APIs are unavailable
π οΈ Development
Project Structure
coinpeek/
βββ manifest.json # Extension configuration
βββ background-simple.js # Optimized service worker
βββ popup/ # User interface
β βββ popup.html
β βββ popup.css
β βββ popup.js
βββ config/
β βββ constants.js # Centralized configuration
βββ utils/
β βββ formatters.js # Shared utilities
βββ icons/ # Extension icons (16, 48, 128px)
βββ dev-tools/ # Development utilities (optional)
βββ docs/
βββ README.md # This file
βββ TECHNICAL_DOCS.md # Developer documentation
Development Setup
- Clone the repository
- Make your changes
- Reload extension in
chrome://extensions/
- Test functionality in popup and background service
Adding Features
- Review
TECHNICAL_DOCS.md for architecture guidelines
- Use centralized constants in
config/constants.js
- Follow the established DOM caching patterns
- Implement proper error handling
π Privacy & Security
- No Data Collection: No user data is collected or transmitted
- Local Storage Only: All data stored locally in Chrome storage
- Secure APIs: All API calls use HTTPS encryption
- Minimal Permissions: Only requests necessary Chrome permissions
- Open Source: Full source code available for review
Permissions Explained
This extension requests only two minimal permissions:
| Permission |
Why Itβs Needed |
What It Does |
storage |
Cache prices locally |
Saves last known prices so you see data instantly when opening the popup. Data never leaves your device. |
alarms |
Background updates |
Refreshes prices every minute automatically. Uses Chromeβs efficient alarm system, not a constant background process. |
Host Permissions (API access only):
| API | Purpose |
|ββ|βββ|
| api.coingecko.com | Fetch BTC/ETH prices (public API) |
| api.blocknative.com | Fetch ETH gas fees |
| mempool.space | Fetch BTC network fees |
| api.blockchain.info | Fallback for BTC fees |
| api.blockchair.com | Fallback for BTC fees |
What we DONβT request:
- No
<all_urls> - we canβt access your browsing
- No
tabs - we canβt see your open tabs
- No
history - we canβt see your browsing history
- No
cookies - we canβt access your cookies
π Version History
v1.1.1 (Current)
- π§ Fixed Bitcoin badge not displaying on extension icon
- π Improved CoinGecko API reliability with response validation
- β‘ Intelligent data refresh (only when data >45s old)
- π Reduced API calls by ~70% with smart caching
- π Enhanced debug system and error handling
v1.1.0
- π Performance optimizations
- π§ Code refactoring and deduplication
- π± Enhanced DOM element caching
- π― Centralized configuration management
- π Improved error handling
v1.0.2
- Initial release with basic functionality
- Real-time price monitoring
- Gas fee tracking
- Currency conversion
π Troubleshooting
Common Issues
- Prices not updating: Check internet connection and refresh manually
- Extension badge not showing: Ensure extension has proper permissions
- Gas fees showing dashes: Multiple API failures, data will restore automatically
Getting Help
- Check the browser console for error messages
- Reload the extension from
chrome://extensions/
- Clear Chrome storage if data appears corrupted
π Support
- Issues: Create an issue in the GitHub repository
- Feature Requests: Submit suggestions via GitHub Issues
- Documentation: See
TECHNICAL_DOCS.md for developer information
Contributing
Contributions are welcome! Please read our Contributing Guide for details on how to submit pull requests, report bugs, and suggest features.
Support
If you find this extension useful, consider supporting its development:
License
This project is open source under the MIT License.
Privacy
See our Privacy Policy for details on data handling.
CoinPeek - Built for the crypto community