Skip to content

gigachad80/Privacy-Veil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ™ Project Name: PrivacyVeil

PrivacyVeil: A privacy-first dark mode extension for Firefox/LibreWolf that respects ResistFingerprinting, requires zero permissions abuse, and keeps your browsing data completely localβ€”no tracking, no analytics, no compromise.

Maintenance License Firefox LibreWolf

Table of Contents


πŸ“Œ Overview

PrivacyVeil is a dark mode extension engineered specifically for privacy-conscious users running LibreWolf or Firefox with ResistFingerprinting (RFP) enabled. Unlike Dark Reader and other mainstream dark mode solutions, PrivacyVeil prioritizes security and privacy above all else.

Key Capabilities:

  • Client-side dark mode injection without exposing color scheme preferences
  • Intelligent site exclusion for pages with native dark mode
  • Real-time brightness adjustment (60-100%)
  • Context menu quick-exclude for problematic sites
  • Zero external network requests or telemetry
  • ~1,100 lines of fully auditable code (430 JS + 650 CSS/HTML)

✨ Features

🎯 Privacy-First Dark Mode

  • No Permission Abuse - Minimal permissions (storage, activeTab only)
  • Zero Tracking - No analytics, no telemetry, no data collection
  • RFP Compatible - Works perfectly with LibreWolf's ResistFingerprinting protection
  • Client-Side Only - Dark mode applied locally, websites cannot detect preferences
  • Open Source - Fully auditable ~1,100 lines of code

⚑ Intelligent Site Management

  • Auto-Detection - Automatically detects sites with native dark mode (GitHub, Reddit, YouTube, etc.)
  • Quick Exclude - Right-click context menu to exclude problematic sites
  • Per-Site Control - Exclude specific sites if they don't render well
  • Smart Defaults - Pre-configured to skip major sites with built-in dark mode

πŸ”§ User-Friendly Customization

  • Brightness Slider - Adjust darkness from 60% to 100%
  • One-Click Toggle - Enable/disable dark mode instantly
  • Easy Exclusion List - View and manage all excluded sites
  • Quick Removal - Remove individual sites from exclusion list anytime
  • Clear All - Reset all exclusions with one click

πŸ›‘οΈ Security-First Design

  • No eval() or unsafe code - Zero dynamic code execution
  • CSP Compliant - Respects Content Security Policies
  • Minimal DOM Manipulation - Limited attack surface
  • Sandboxed Execution - Runs within Firefox's secure extension sandbox
  • No Form Interception - Never accesses sensitive data or credentials

πŸš€ Performance Optimized

  • Lightweight - ~1,100 lines of code, minimal memory footprint
  • Fast Loading - Applies dark mode before page renders
  • Efficient Updates - Debounced MutationObserver for dynamic content
  • Zero CPU Impact - Minimal processing overhead
  • Automatic Cleanup - Proper resource management on page unload

πŸ—οΈ Architecture & How It Works

System Architecture Diagram

Untitled diagram-2025-10-17-062701

How It Works - Step by Step

Step 1: User Opens Website

Website Loads β†’ content.js Injects β†’ Reads Settings

Step 2: Settings Retrieved

browser.storage.local.get() β†’ Returns:
{
  enabled: true,
  brightness: 90,
  excludedSites: ['github.com', 'reddit.com']
}

Step 3: Dark Mode Decision

IF site NOT in excludedSites:
   βœ… Add data-dark-mode="true" to <html>
   βœ… Apply brightness filter if brightness β‰  100
   βœ… Inject dark-mode.css styles
ELSE:
   ❌ Skip dark mode, show original colors

Step 4: CSS Activation

dark-mode.css detects [data-dark-mode="true"]
↓
Applies dark colors to all elements:
β”œβ”€ Background: #1a1a1e
β”œβ”€ Text: #e8e6e3
β”œβ”€ Links: #58a6ff
└─ Borders: #4a4a52

Step 5: Real-Time Updates

User changes settings in popup
↓
background.js saves to storage
↓
All open tabs receive message
↓
content.js updates dark mode instantly

Step 6: Dynamic Content

MutationObserver watches for new DOM nodes
↓
If page structure changes, re-apply dark mode
↓
Debounced to prevent performance issues

Data Flow Diagram

Untitled diagram-2025-10-17-063032

Security Architecture

WEBSITE CONTEXT (Untrusted)
β”œβ”€ Can read data-dark-mode attribute βœ“
β”œβ”€ Cannot access extension storage βœ—
β”œβ”€ Cannot intercept communication βœ—
└─ Cannot steal any data βœ—

CONTENT SCRIPT (Sandboxed)
β”œβ”€ Can modify DOM βœ“
β”œβ”€ Can read storage βœ“
β”œβ”€ Cannot access website localStorage βœ—
β”œβ”€ Cannot make external requests βœ—
└─ Cannot execute website code βœ—

EXTENSION CONTEXT (Trusted)
β”œβ”€ Controls all storage βœ“
β”œβ”€ Manages all communication βœ“
β”œβ”€ Enforces settings βœ“
β”œβ”€ No external access βœ—
└─ No tracking capability βœ—

Z-Index Layer Stack

Untitled diagram-2025-10-17-065950

βš™οΈ Browser Compatibility

PrivacyVeil supports both Manifest V2 and V3, making it compatible with:

Manifest V3 (Modern)

  • βœ… Firefox 109+ (Full support)
  • βœ… LibreWolf (All versions with MV3 support)
  • βœ… Chrome 88+ (Full support)
  • βœ… Edge 88+ (Full support)

Manifest V2 (Legacy)

  • βœ… Firefox Developer Edition (with MV2 enabled)
  • βœ… Older Firefox versions (pre-109)
  • βœ… Chrome <88 (Legacy support)

πŸ“š Requirements & Dependencies

  • Firefox 109+ OR LibreWolf (latest) OR Chrome 88+
  • ResistFingerprinting support (optional but recommended for LibreWolf)
  • No external dependencies
  • No npm packages required
  • No CDN resources
  • ~1,100 lines of self-contained code

πŸ“₯ Installation Guide

⚑ Quick Install

Install addon from here : https://addons.mozilla.org/en-US/firefox/addon/privacy-veil/ πŸ₯°


⚠️ Important Note: Known Limitations

Warning

Z-Index Layer & Search UI

The z-index layering system (used for proper visual hierarchy) may occasionally cause UI overlap issues during search operations, particularly when using browser search bars or autocomplete dropdowns on complex websites. This is a known trade-off between maintaining privacy protections and achieving pixel-perfect UI rendering.

Why This Trade-Off Exists: Privacy and security must sometimes take precedence over UI perfection. Implementing proper DOM isolation and z-index management protects your data and fingerprinting vectors, but can occasionally interact unexpectedly with complex website structures. We believe protecting your privacy is worth this minor visual compromise.

Contributing & Feedback: If you encounter UI issues or have suggestions for improvement, please open an issue or submit a PR on GitHub. We continuously work to improve PrivacyVeil while maintaining our privacy-first approach. Feel free to fork and modify the code to better suit your needs.

Philosophy: To gain better privacy and security protection, some UI refinement may need to be sacrificed. This is an intentional design choiceβ€”we prioritize your privacy over flawless aesthetics.

πŸš€ Usage

Basic Usage

# Enable/Disable Dark Mode
1. Click PrivacyVeil icon in toolbar
2. Toggle "Dark Mode" on/off
3. Changes apply instantly

# Adjust Brightness
1. Open PrivacyVeil popup
2. Drag brightness slider (60-100%)
3. Lower = darker, Higher = lighter

# Exclude a Site
Method A (Popup):
  1. Open problematic site
  2. Click PrivacyVeil icon
  3. Click "Exclude Current Site"
  4. Page reloads without dark mode

Method B (Context Menu):
  1. Right-click anywhere on page
  2. Select "Exclude this site from dark mode"
  3. Site added to exclusion list

# Manage Exclusions
1. Open PrivacyVeil popup
2. Scroll to "Excluded Sites" section
3. Click "Remove" to re-enable dark mode
4. Click "Clear All Exclusions" to reset

Advanced Configuration

Manually Edit Settings

Navigate to about:debugging β†’ Inspect Extension β†’ Storage tab:

// Default settings stored in browser.storage.local:
{
  enabled: true,           // Dark mode on/off
  brightness: 90,          // 60-100 (60=darkest, 100=lightest)
  excludedSites: [         // Sites to skip dark mode
    "github.com",
    "reddit.com",
    "youtube.com"
  ]
}

Customize Dark Mode Colors

Edit dark-mode.css to change colors:

:root {
  --dm-bg: #1a1a1e;        /* Background color */
  --dm-text: #e8e6e3;      /* Text color */
  --dm-link: #58a6ff;      /* Link color */
}


πŸ” Security & Privacy

What We Protect

βœ… No Fingerprinting - Dark mode applied client-side only
βœ… RFP Compatible - Works with LibreWolf ResistFingerprinting
βœ… No Data Collection - Zero tracking or analytics
βœ… No Network Requests - Completely offline operation
βœ… Minimal Permissions - Only storage and activeTab

Security Audit Results

βœ… No eval() or unsafe code execution
βœ… No external dependencies
βœ… No network access
βœ… No localStorage/sessionStorage (web APIs)
βœ… No form interception
βœ… No credential theft
βœ… No tracking pixels
βœ… CSP compliant
βœ… Sandboxed execution
βœ… ~1,100 lines of auditable code

Comparison with Dark Reader

Feature PrivacyVeil Dark Reader
Privacy 🟒 Zero tracking 🟑 Unknown
Permissions 🟒 Minimal 🟑 Broad
Code Size 🟒 ~1,100 lines πŸ”΄ 50,000+ lines
RFP Compatible 🟒 Yes πŸ”΄ Conflicts
Network Requests 🟒 Zero πŸ”΄ Potential
Open Source 🟒 Fully 🟒 Fully

πŸ€” Why This Name?

PrivacyVeil represents a protective layer that:

  • πŸŒ™ Veils your eyes from harsh light
  • πŸ”’ Veils your privacy from fingerprinting
  • πŸ›‘οΈ Veils your data from tracking

The name captures the essence: Privacy Protection + Dark Mode working together as one unified shield for your browsing experience.


⌚ Development Time

Total Time: 2 hrs 50 mins 33 secs

Breakdown:

  • Development: 34 mins 33 secs
  • Firefox Submission: 45 mins
    This was my first time publishing an extension, and I encountered several issues:
    • The manifest.json file wasn't being detected in the root directory.
    • Faced multiple validation errors.
    • Versioning issues also occurred.
  • README Writing: 31 mins
  • Mermaid.js Diagram Creation: 1 hr
    I wasn't familiar with Mermaid.js syntax, so extra time was needed to vibe code the mermaid js diagram.

πŸ™ƒ Why I Created This

During my OSINT research , I prefer to maintain privacy with LibreWolf and ResistFingerprinting enabled. I faced a dilemma:

The Problem:

  • Dark Reader requires broad permissions and makes external requests
  • Native Firefox dark mode is blocked by ResistFingerprinting (intentionally)
  • Other extensions either tracked me or didn't respect RFP
  • I was forced to use light mode for sensitive OSINT work
  • I needed dark mode that was completely private and auditable

The Solution: I created PrivacyVeil - a dark mode extension that:

  • Works perfectly with ResistFingerprinting
  • Requires zero permissions abuse
  • Makes zero external requests
  • Is completely auditable (~1,100 lines)
  • Keeps all data local

πŸ“ž Contact

πŸ“§ Email: pookielinuxuser@tutamail.com

🐱 GitHub: @gigachad80


πŸ“„ License

Licensed under the MIT License.
See LICENSE.md for details.

First Published: October 17, 2025
Last Updated: October 17, 2025
Version: 1.0.0
Status: βœ… Published on Firefox Add-ons Store


Made with ❀️ for privacy-conscious security researchers, OSINT practitioners, and anyone who refuses to compromise privacy for comfort.

πŸ”’ PrivacyVeil: Your Privacy, Protected. Your Eyes, Comfortable.