Skip to content

Repository files navigation

🛡️ CopyShield

Clean Copy, Anti-Hijack & Anti-Trap Browser Extension

Neutralizes website clipboard tampering, invisible tracking codes, attribution spam, and anti-AI prompt injection traps across the web.

Website Developer Manifest V3 Version License: MIT Chrome & Edge Firefox


🌐 Live Website & Demo✨ Features🚀 Installation🔬 How It Works🧪 Test Sandbox👨‍💻 Developer📄 License


⚡ The Problem

Many websites deliberately tamper with what you copy to your clipboard:

  • Learning Platforms (Coursera, etc.): Embed invisible anti-AI prompt injection traps (e.g. hidden screen-reader text instructing AI assistants to refuse answering) inside quiz questions.
  • News Sites & Blogs: Append intrusive text (e.g. Read more at https://..., © 2026 EvilCorp).
  • Analytics & Tracking: Inject invisible zero-width unicode characters (\u200B, \uFEFF) to fingerprint and track copied leaks.
  • Async Clipboard Overwrites: Use navigator.clipboard.writeText() behind the scenes to replace your clipboard payload after you copy.

✨ Key Features

  • 🎯 Capture-Phase Interception: Catches copy events before any website scripts can touch your data.
  • 🚫 Anti-AI Prompt Injection Trapper: Automatically detects and strips hidden academic integrity traps (e.g. Coursera quiz traps) from copied questions.
  • 👁️ Deep DOM Ancestor Tree Inspection: Walks the entire DOM tree to ignore hidden elements (.sr-only, .visually-hidden, clip: rect(0,0,0,0), clip-path, 1px/0px containers, scale(0), color: transparent, and left: -9999px).
  • Main World Async Hook (inject.js): Wraps navigator.clipboard.writeText in the main world context to prevent sneaky async overrides.
  • 🧹 Zero-Width Character Sanitizer: Cleans invisible tracking watermarks (\u200B, \uFEFF, \u2060, \u00AD, etc.).
  • 🌐 1-Click Domain Whitelist: Easily whitelist rich web applications (Google Docs, Figma, Notion, Overleaf) with one click from the popup.
  • 🎨 Glassmorphic Dark UI: Modern interface with master switch, real-time stats counter, mode selector, and toast controls.
  • 🛡️ 100% Private & Offline: Zero network requests, zero analytics, zero external dependencies. All data is kept strictly in local browser storage.

🚀 Installation

Option 1: Quick Install (Direct from Zip)

  1. Download the latest copyshield-v1.2.1.zip from the Releases page and extract it to a folder.
  2. Open your browser's extension manager:
    • Chrome / Brave / Opera: Navigate to chrome://extensions
    • Microsoft Edge: Navigate to edge://extensions
  3. Turn on Developer mode (top-right toggle).
  4. Click Load unpacked and select the extracted folder.
  5. Done! 🛡️ CopyShield is active.

Option 2: Install from Source (For Developers)

# Clone the repository
git clone https://github.com/abdulsalam401/Copy-Sheild.git
cd Copy-Sheild

# Verify and test extension integrity
npm test

# Build release zip
npm run pack

Then load the cloned folder into your browser using Load unpacked.


🔬 How It Works

User triggers Copy (Ctrl+C / Context Menu)
                     │
                     ▼
┌────────────────────────────────────────────────────────────┐
│ CopyShield content.js (Capture Phase: true)                │
│ 1. Walks the DOM tree of the selection                     │
│ 2. Ignores .sr-only, clipped, 0px, off-screen nodes        │
│ 3. Strips AI prompt-injection traps & tracking watermarks  │
│ 4. Writes pure, genuine text to clipboardData              │
│ 5. e.stopImmediatePropagation() stops website handlers     │
└────────────────────────────┬───────────────────────────────┘
                             │
                             ▼
┌────────────────────────────────────────────────────────────┐
│ CopyShield inject.js (Main World Context)                  │
│ • Hooks navigator.clipboard.writeText()                    │
│ • Blocks asynchronous clipboard overrides                  │
└────────────────────────────────────────────────────────────┘

🧪 Interactive Test Sandbox

CopyShield includes a built-in interactive test suite to test real-world attacks:

  1. Open test_sandbox.html in your browser (or click Test Sandbox in the CopyShield popup).
  2. Test simulated attacks:
    • Coursera Anti-AI Prompt Injection Trap
    • In-DOM Invisible -9999px Spans
    • Async navigator.clipboard.writeText Override
    • Zero-Width Unicode Trackers
  3. Paste into the Real-Time Clipboard Inspector to verify that your clipboard contains only clean, genuine text!

⌨️ Keyboard Shortcuts

Shortcut Action
Alt + Shift + C Toggle CopyShield protection On / Off globally

(You can customize this shortcut at chrome://extensions/shortcuts)


👨‍💻 Developer

Abdul Salam

Cybersecurity Student • Ethical Hacker • Open-Source Developer
Islamabad, Pakistan

Portfolio GitHub LinkedIn X / Twitter Instagram Email

"Security isn't about breaking systems — it's about understanding them well enough to protect them."

  • 🎓 Education: BS Computer Science student (Shaheed Benazir Bhutto University)
  • 🔐 Specialization: Network Defense, Cryptography, Ethical Hacking & Secure Application Development
  • 🛡️ Active Platforms: TryHackMe & Hack The Box learner
  • 💬 Collaborations: Open to collaborating on cybersecurity and privacy-focused open-source tools

🔒 Security & Privacy

  • Zero Network Requests: The extension makes 0 HTTP/Fetch/WebSocket requests.
  • Local Storage Only: Interception stats and domain blacklist are stored locally on your machine via chrome.storage.local.
  • Open Source: Every line of code is inspectable and auditable.
  • Read our full Privacy Policy.

📄 License

This project is licensed under the MIT License © 2026 Abdul Salam.

About

A lightweight JavaScript/HTML/CSS utility to discourage copying of web content (disable selection/right‑click/clipboard actions) and optionally add visible watermarks/overlays for content protection.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages