Environment Marker is a free and open‐source browser extension that helps you easily differentiate between your project environments—such as development, QA, staging, and production—by placing a distinctive colored label on your browser window.
Maintainer: Bertonha
Starting January 1st, 2022, all donations will be directed to GRAACC, a Brazilian support group for teenagers and children with cancer.
Why Environment Marker?
In many IT projects, multiple environments share nearly identical interfaces—dev, QA, stage, and production. This similarity often leads to costly mistakes, such as performing tests or configurations in the wrong environment. Environment Marker visually distinguishes each environment, so you never mix them up again.
-
Ensure you have Node.js installed.
-
Install Gulp CLI globally:
npm install --global gulp-cli
-
Install the project dependencies:
npm install
This project uses Gulp to automate build tasks. Here’s a summary of the available tasks:
-
clean-dist
Clears thedist
folder. -
js
Transpiles and minifies JavaScript files (using Terser) fromapp/scripts
with source maps. -
process-firebase-config
Reads the Firebase configuration fromapp/config/firebase-config.json
and replaces the placeholder (%%FIREBASE_CONFIG%%
) inapp/background.js
before processing. -
copy-html
Copies HTML files fromapp/html
todist/html
. -
copy-css
Minifies CSS files fromapp/styles
(using UglifyCSS) and copies them todist/styles
with source maps. -
copy-images
Copies image assets fromapp/images
todist/images
. -
copy-manifest
Copies the default Chrome manifest (app/manifest.json
) todist
. -
copy-firefox-manifest
Copies the Firefox-specific manifest (app/manifest_firefox.json
), renames it tomanifest.json
, and places it indist
. -
copy-locales
Copies localization files fromapp/_locales
todist/_locales
. -
copy-libs
Copies necessary library dependencies fromnode_modules
intodist/scripts/libs
(excluding Firebase files where necessary) and adjusts paths for Firebase files. -
copy-textfit
Copies thetextFit.min.js
file from the textfit package todist/scripts/libs/textfit
. -
watch
Watches source files (CSS, HTML, images, manifests, locales, and JavaScript) and automatically runs the corresponding tasks upon changes. -
zip
Packages the entiredist
folder into a ZIP file. The ZIP is named based on the extension version from the manifest (e.g.,Environment Marker-<version>.zip
) and saved in thepackage
folder. -
build
Runs a full build for the default (Chrome) version:- Cleans
dist
- Processes JavaScript and Firebase configuration
- Copies HTML, CSS, images, the default manifest, locales, and libraries
- Also copies the textfit dependency
- Cleans
-
build:firefox
Same as the default build, but uses the Firefox-specific manifest. -
package
Runs the default build followed by the ZIP packaging task for Chrome. -
package:firefox
Runs the Firefox build followed by the ZIP packaging task for Firefox. -
default
Runs the default build and starts the file watcher.
To build the extension for Chrome, run:
gulp build
This command will:
- Clean the distribution folder.
- Process and minify your JavaScript, HTML, CSS, and images.
- Copy the default Chrome manifest, locales, libraries, and textfit dependency.
To build for Firefox (using the Firefox-specific manifest), run:
gulp build:firefox
After building the extension, package it into a ZIP file for distribution.
For the default (Chrome) build:
gulp package
For the Firefox build:
gulp package:firefox
The resulting ZIP file will be located in the package
folder and will be named according to the version specified in the manifest (e.g., Environment Marker-1.0.0.zip
).
For development, you can use the watch task to automatically rebuild when source files change:
gulp
This will run the default build and then start watching your files.
-
Installation:
Install the extension from your preferred web browser store. -
Configuration:
- Navigate to your browser’s extensions page (e.g., Browser Configurations > More Tools > Extensions).
- Click on the Environment Marker options menu.
- Configure your environments by setting URLs and choosing a colored label.
- Click the Save button to apply your settings.
Contributions, bug reports, and feature requests are welcome. Please open an issue or submit a pull request on GitHub.
This project is open-source. Please review the LICENSE file for more details.