Skip to content

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

License

Notifications You must be signed in to change notification settings

devacc8/coinpeek

Repository files navigation

CoinPeek - Bitcoin Price Badge & Gas Tracker

Version License: MIT Chrome Web Store

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

CoinPeek Screenshot

πŸš€ 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)

  1. Download or clone this repository
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable "Developer mode" in the top right corner
  4. Click "Load unpacked" and select the extension folder
  5. 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

Performance Optimizations (v1.1.0)

  • βœ… 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

  1. Clone the repository
  2. Make your changes
  3. Reload extension in chrome://extensions/
  4. 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

About

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

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •