Darkument is a free, open source browsers & extensions project written in JavaScript and released under MIT. It has 1,323 GitHub stars, 2 forks and 0 open issues, and was last pushed 3 months ago. On this registry it ranks #120 of 145 tracked projects in Browsers & Extensions, with 5 head-to-head comparisons available.

What is Darkument?

Darkument is a free, MIT-licensed Manifest V3 browser extension for Chromium, Opera and Edge that applies a GPU-accelerated dark overlay to PDFs and web documents, built for students, researchers and professionals who read long documents late at night.

What it is

Darkument is a JavaScript browser extension written to the Chrome Extension Manifest V3 standard, using a decoupled background service worker plus content script injection rather than a persistent background page. It was designed and developed by Ahmad Hassan (B-Ted) and lives in the browser-extension ecosystem, distributed through the Chrome Web Store and Edge Addons and listed under Productivity & Utilities / Browsers & Extensions. The project carries the topics browser-extension, chrome-extension, dark-mode, edge-extension, opera-addon, privacy, ui and ux.

The concrete problem it targets is the behaviour of traditional dark mode extensions, which the README says frequently break complex page layouts, consume significant CPU resources, or fail to render inside browser-embedded PDF viewer environments. Darkument replaces that stylesheet-parsing approach with a mathematical overlay strategy: it injects a #darkument-overlay element as a direct child of the page body and applies mix-blend-mode: difference, so the rendered pixel is computed as Pixel_Final = |255 - Pixel_Original| without altering the page's structural CSS rules.

Key capabilities

  • High-fidelity inversion through GPU-accelerated CSS blend modes, using mix-blend-mode: difference on an injected #darkument-overlay element instead of editing stylesheets.
  • Native PDF integration that works inside the browser's built-in PDF viewer for both local file:// documents and remote document URLs.
  • Volatile per-tab state management held in a Map inside the background service worker, so inverting one document does not affect other active tabs.
  • Zero privacy footprint: the extension operates 100% locally with no trackers, no telemetry and no data collection.
  • An action button and badge UI that sets the badge to "ON" and swaps to an active icon while inversion is enabled for the current tab.
  • A Manifest V3 architecture that injects scripts on demand via chrome.scripting.executeScript and reacts to tab lifecycle events such as onUpdated and onRemoved.
  • A minimalist onboarding guide that walks users through configuring the local file permissions needed for file:// documents.

Who uses it and how

  • Students reading academic PDFs during late-night study sessions, the audience the README explicitly names as the reason the extension was built.
  • Researchers and professionals working through reference sheets and long documents, where a layout-breaking dark mode extension would disrupt reading.
  • Readers who open local PDFs from disk in the browser and therefore need to grant file permissions through the onboarding guide before file:// inversion will work.
  • Multi-document workflows in which several PDFs are open across tabs and per-tab state keeps inverted and normal documents side by side.
  • Individual users installing from the Chrome Web Store or Edge Addons listing rather than building the extension from source.

Getting started

Darkument is installed from its Chrome Web Store listing or the Edge Addons listing. After installation, the bundled onboarding guide explains how to configure local file permissions so that file:// PDFs can be inverted.

How it compares

The supplied facts do not name any comparable dark-mode extensions or paid products, so no licence, self-hosting or cost comparison can be drawn. On the evidence available, Darkument stands alone in this registry as an entry for in-browser document inversion.

When to use it — and when not to

Darkument suits anyone who wants a local-only way to darken PDFs and documents inside a Chromium-based browser, because it needs no server, database, account or other infrastructure to operate beyond the extension itself. It is a poor fit for users who expect settings to persist, since inversion state is held only in a volatile per-tab Map, or who need Firefox support, which the facts do not claim. Prospective users should also weigh that file:// use depends on manually granting permissions through the onboarding guide, and that the repository shows 2 forks and 0 open issues, so third-party contribution and community support are thin.

project readme (upstream, from github) — read inline

Darkument

A production-grade, Manifest V3 browser extension engineered for high-fidelity color inversion on PDFs and web documents.

Chrome Web Store Edge Addons Manifest V3 License: MIT



Core Purpose & Story

Bright, glaring screens pose a major challenge for late-night productivity, particularly when reading academic PDFs or reference sheets. Traditional dark mode extensions frequently break complex page layouts, consume significant CPU resources, or fail to render inside browser-embedded PDF viewer environments.

Designed and developed by Ahmad Hassan (B-Ted), Darkument offers a lightweight, high-performance solution. Built as a gift for students, researchers, and professionals working into the early hours, it converts harsh light into comfortable dark tones without altering structural CSS rules or tracking user activity.


Features

  • High-Fidelity Inversion: Utilizes GPU-accelerated CSS blend modes for instant color shifting without structural layout breaking.
  • Native PDF Integration: Works inside the browser's native PDF viewer, supporting both local (file://) and remote document URLs.
  • Volatile State Management: Remembers toggle preferences per tab. Inverting one document does not affect other active tabs.
  • Zero Privacy Footprint: Operating 100% locally. No trackers, no telemetry, and no data collection.
  • Frictionless Setup: Includes a minimalist onboarding guide to assist with configuring local file permissions.

Architecture Overview

Darkument adheres to the modern Chrome Extension Manifest V3 standard, employing a decoupled background service worker and content script injection model.

flowchart TD
    subgraph Browser ["Browser Environment"]
        Action["Action Button / Badge UI"]
        Tabs["Tab Lifecycle Events"]
        DOM["Active Document DOM"]
    end

    subgraph ServiceWorker ["Service Worker (background.js)"]
        Tracker["volatile State Tracker (Map)"]
        Engine["Script Injection Handler"]
    end

    subgraph InjectedScript ["Injected Content Execution"]
        Overlay["Overlay <div> Element"]
        CSS["mix-blend-mode: difference"]
    end

    Action -->|onClicked| ServiceWorker
    Tabs -->|onUpdated / onRemoved| ServiceWorker
    ServiceWorker -->|Reads/Writes| Tracker
    ServiceWorker -->|chrome.scripting.executeScript| DOM
    DOM --> InjectedScript
    Overlay -->|GPU Blend Mode| CSS

Request Lifecycle & Data Flow

When the action button is toggled, the background script checks the volatile state map to determine the action required for the active tab.

sequenceDiagram
    autonumber
    actor User as User Action
    participant BG as Service Worker (background.js)
    participant State as volatile tabStates (Map)
    participant DOM as Active Tab DOM
    
    User->>BG: Click Extension Icon
    BG->>State: Query Tab ID State
    State-->>BG: Return Current State (Active/Inactive)
    
    alt Active (Currently Inverted)
        BG->>DOM: Execute script to fade out & remove #darkument-overlay
        BG->>State: Set Tab ID State to False
        BG->>User: Set badge to empty / Reset Icon
    else Inactive (Normal Mode)
        BG->>DOM: Execute script to create overlay & apply mix-blend-mode
        BG->>State: Set Tab ID State to True
        BG->>User: Set badge to "ON" / Set Active Icon
    end

Technical Working Mechanism

The "Difference" Strategy

Instead of parsing and modifying stylesheets, Darkument applies a Mathematical Overlay Strategy. The overlay elements are injected as direct children of the page body.

Pixel_Final = | 255 - Pixel_Original |

This negation transforms white pages to black and vice-versa, leaving medium grays and midtones relatively stable to preserve structural legibility.

PDF & Local Document Injection

Browsers render PDFs using internal HTML5 parsers (such as PDF.js). Because these documents are exposed within the standard web frame DOM, the service worker is able to inject negation overlays directly into local document frames once the user has allowed local file access.


Repository Structure

Darkument/
├── src/                  # Extension source code
│   ├── background.js     # Volatile state service worker
│   ├── manifest.json     # Manifest V3 extension configuration
│   ├── icons/            # Action and badge visual assets
│   └── pages/            # Onboarding and documentation views
│       ├── thankyou.html # Local file permissions guide
│       └── thankyou.js   # Dynamic permission listener
├── assets/               # Brand and web store promo banners
├── build/                # Production release ZIP artifacts
├── docs/                 # Architectural specifications
└── .github/              # Issue and support configurations

Installation

Google Chrome (Recommended)

The extension can be installed directly from the Chrome Web Store: Download on Chrome Web Store

Microsoft Edge

The extension can be installed directly from Microsoft Edge Addons: Download on Microsoft Edge Addons

Manual Installation (Developer Mode)

  1. Download the latest source package from the Releases page.
  2. Open chrome://extensions or edge://extensions in the browser.
  3. Toggle Developer Mode on in the upper-right corner.
  4. Click Load Unpacked and select the /src directory of the project.

Development & Build Pipeline

Prerequisites

  • Node.js installed locally.
  • Windows PowerShell or compatible shell environments.

Package Configuration

Scripts are managed using the package configuration file:

Command Action Platform
npm run build Compiles the files from src/ into a release .zip archive inside build/ PowerShell
npm run clean Deletes any compiled .zip archives within the build/ folder Bash/PowerShell

Contributing

Contributions that optimize GPU rendering, expand compatibility, or enhance the accessibility features are highly valued.

  1. Fork the project.
  2. Create a feature branch (git checkout -b feature/AmazingFeature).
  3. Commit the changes (git commit -m 'feat: add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

Designed and maintained by Ahmad Hassan (B-Ted)

Frequently asked questions

Is Darkument free to use?

Darkument is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does Darkument do?

A sleek, privacy-focused browser extension that brings a native dark mode experience to online documents. Built with clean UI/UX principles for Chromium and Ope

What is Darkument written in?

Darkument is primarily written in JavaScript. Its source is publicly available at https://github.com/AhmadHassan-BTed/Darkument, and it has 1,323 GitHub stars.