A browser extension that helps developers easily switch between production and development environments while providing clear visual indicators of the current environment.
- 🚦 Clear visual indicators: Red banner for production, green for development environments
- 🔄 Quick environment switching with a single click
- 🎨 Customizable banner size and position (top or bottom of the page)
- 🔗 Maintains URL paths when switching environments
- 🎯 Support for multiple production-development URL pairs
- 🌐 Support for both Chrome and Firefox browsers
- 🔍 Wildcard domain pattern matching
- 🔒 Local storage variable monitoring
- 📍 Flexible banner positioning
The extension will be available in the Chrome Web Store.
The extension will be available in the Firefox Add-ons store.
- Run
npm run build:chrometo build the extension - Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked"
- Select the
dist/chromefolder
- Run
npm run build:firefoxto build the extension - Open Firefox and navigate to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Select any file from the
dist/firefoxfolder
- Node.js (v14 or higher)
- npm (v6 or higher)
├── src/
│ ├── shared/ # Shared code between Chrome and Firefox
│ │ ├── content.ts # Content script
│ │ ├── background.ts # Background script
│ │ ├── options.ts # Options page logic
│ │ ├── popup.ts # Popup logic
│ │ ├── html/ # HTML templates
│ │ ├── css/ # Styles
│ │ └── images/ # Icons and images
│ └── platform/ # Platform-specific code
│ ├── chrome/ # Chrome-specific implementation
│ └── firefox/ # Firefox-specific implementation
├── dist/ # Built extensions
│ ├── chrome/ # Chrome build output
│ └── firefox/ # Firefox build output
└── webpack configs # Build configuration
npm install- Install dependenciesnpm run build- Build both Chrome and Firefox extensionsnpm run build:chrome- Build Chrome extension onlynpm run build:firefox- Build Firefox extension onlynpm run watch:chrome- Watch Chrome files and rebuild on changesnpm run watch:firefox- Watch Firefox files and rebuild on changesnpm run package:chrome- Create Chrome extension ZIP for store submissionnpm run package:firefox- Create Firefox extension ZIP for store submission
- Click the extension icon in your browser toolbar
- Click "Open Options" or right-click the extension icon and select "Options"
- In the options page, you can:
- Add production-development URL pairs
- Configure banner sizes for both environments
- Set banner position (top or bottom)
- Configure localStorage variables to monitor
You can use wildcards (*) to match dynamic parts of domains. For example:
Production URL Development URL
*.production.example.com *.dev.example.com
*.bestcompany.io *.bestcompany.io.s3-website.eu-west-2.amazonaws.com
When switching environments, the extension will preserve the dynamic part that matches the wildcard.
You can configure specific localStorage keys to monitor. The extension will:
- Display the key-value pairs in the banner
- Show bright text when value is '1' or 'true'
- Show dim text when value is '0' or 'false'
Example keys to monitor:
bestcompany-production-enabled
use-prod-database
env-mode
You can customize:
- Banner position: Top or bottom of the page
- Banner size: 50px, 100px, or 150px (separate settings for production and development)
- Red Banner: Indicates you're on a production environment
- Green Banner: Indicates you're on a development environment
- Warning Text: Shows monitored localStorage values with brightness indicating their state
- The extension preserves your current path when switching environments
- New environment pages open in a new tab
- The banner adjusts the page layout automatically without breaking the site's design
- Fixed and absolute positioned elements are automatically adjusted to account for the banner
- Wildcard domain patterns allow matching dynamic subdomains
- Local storage monitoring provides visual feedback about environment configuration
- Banner can be positioned at top or bottom of the page
If you encounter any issues:
-
Banner Not Showing:
- Verify the extension is enabled
- Check if the current URL matches your configured patterns
- Try refreshing the page
-
Layout Issues:
- Try refreshing the page
- Check if the banner size setting is appropriate for the site
- Try changing the banner position (top/bottom)
-
Switching Not Working:
- Verify your URL pairs are correctly configured
- Check if your wildcard patterns match the current URL
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.