A browser extension that prevents your screen from dimming or going to sleep, using the modern Screen Wake Lock API.
- Manual Toggle: Instantly keep your screen awake with a single click.
- Rule-based Activation: Configure specific websites or pages where the screen should always remain awake.
- Cross-browser Support: Optimized for Chrome, Firefox, and Firefox for Android.
- Windows 10 or later
- macOS 12 (Monterey) or later
- Linux (e.g., Ubuntu 22.04+, Fedora 38+)
- Node.js: version
v22.xor later - pnpm: version
v10.xor later
To create an exact copy of the add-on code from source:
-
Download the source code: Clone the repository or download the source archive.
-
Open a terminal: Navigate to the root folder of the project.
-
Install dependencies: Run the following command to install all necessary technical dependencies:
pnpm install
-
Execute the build script: To build the production version specifically for Firefox:
pnpm build:firefox
The compiled code will be generated in the
.output/firefox-mv3directory. -
Create the extension package: To generate a
.zipartifact suitable for Firefox submission:pnpm zip:firefox
The final package will be created in the
.output/folder (e.g.,.output/caffeine-0.1.0-firefox-mv3.zip).
- Chrome/Chromium:
pnpm dev
- Firefox Desktop:
pnpm dev:firefox
To test the extension on Firefox for Android via Wireless Debugging:
- Connect your computer and Android device to the same Wi-Fi network.
- Go to Settings > Developer Options and ensure USB Debugging is ON.
- Enable Wireless Debugging and tap the text to enter its settings.
- Tap "Pair device with pairing code" to see your IP/Port and Pairing Code.
- On your computer, run:
adb pair [IP_ADDRESS]:[PORT]
- Enter the pairing code.
- Back on the main Wireless Debugging screen, find the Device address and run:
adb connect [IP_ADDRESS]:[PORT]
Ensure the IP in the dev:firefox:android script in package.json matches your device's address, then run:
pnpm dev:firefox:androidQuick Fixes if connection fails:
- Restart ADB:
adb kill-server && adb start-server- Toggle Wi-Fi on both devices.
- "Forget" previously paired devices in Android settings and start fresh.
pnpm dev: Start the development server (Chrome).pnpm dev:firefox: Start the development server (Firefox).pnpm build: Generate production-ready artifacts in.output/chrome-mv3.pnpm build:firefox: Generate production-ready artifacts in.output/firefox-mv3.pnpm zip:firefox: Package the Firefox version into a .zip file in.output.pnpm test: Run the Vitest suite.pnpm lint: Run linting checks usingoxlint.pnpm fmt: Format code usingoxfmt.
MIT