New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@wprimadi/lockdown

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wprimadi/lockdown

LOCKDOWN (Log Obfuscation & Console Kill-switch with Devtools Override Warning Network) - Lightweight JavaScript library to secure your website by blocking DevTools access, disabling context menu, shortcuts, text copy/cut/select, and more. Built for front

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

LOCKDOWN 🛡️

Log Obfuscation & Console Kill-switch with Devtools Override Warning Network

License Quality Gate BARRICADE CDN npm version npm downloads

LOCKDOWN is a lightweight JavaScript library designed to protect your website from unwanted user interactions such as opening DevTools, copying text, right-clicking, and more. This library helps you add an extra layer of front-end security in just a few lines of code.

✨ Features

  • 🔒 Detect and block browser DevTools
  • 🖱️ Disable right-click (context menu)
  • 🧠 Block keyboard shortcuts like F12, Ctrl+Shift+I, Ctrl+U, etc.
  • 📋 Prevent text copy and cut
  • ❌ Disable text selection
  • 🚫 Block mouse down actions
  • 🔄 Optional redirect when DevTools is detected

🚀 Getting Started

1. Install

You can include it directly in your HTML file:

<script src="lockdown.js"></script>

Or serve it via NPM/CDN:

CDN

You can include B.A.R.R.I.C.A.D.E from a CDN:

<script src="https://cdn.jsdelivr.net/gh/wprimadi/lockdown@v1.0.0/lockdown.min.js"></script>

Or the latest version:

<script src="https://cdn.jsdelivr.net/gh/wprimadi/lockdown/lockdown.min.js"></script>

NPM

Install via NPM:

npm install @wprimadi/lockdown

Or use it from the CDN NPM package:

<script src="https://cdn.jsdelivr.net/npm/@wprimadi/lockdown/lockdown.min.js"></script>

For more details, visit the NPM page.

2. Initialize

window.addEventListener('DOMContentLoaded', () => {
    lockdown.init({
        redirectUrl: '/access_denied',       // URL to redirect when DevTools is opened
        disableContextMenu: true,            // Default: true
        disableShorcuts: true,               // Default: true
        disableTextCopy: true,               // Default: true
        disableTextCut: true,                // Default: true
        disableTextSelection: true,          // Default: true
        disableMouseDown: true,              // Default: true
        disableDevTools: true                // Default: true
    });
});

All options are optional. If omitted, they will use the default values.

⚙️ Configuration Options

OptionTypeDefaultDescription
redirectUrlstringempty stringURL to redirect when DevTools is detected. Leave empty to skip redirect.
disableContextMenubooltrueDisable right-click menu.
disableShorcutsbooltrueBlock developer tool-related keyboard shortcuts.
disableTextCopybooltruePrevent users from copying text.
disableTextCutbooltruePrevent users from cutting text.
disableTextSelectionbooltrueDisable text selection on the page.
disableMouseDownbooltrueDisable mouse down interaction.
disableDevToolsbooltrueEnable/disable DevTools detection mechanism.

🔐 Use Case

LOCKDOWN is perfect for:

  • Web-based quizzes or assessments
  • SaaS dashboards with sensitive UI elements
  • Public landing pages where copying or debugging is discouraged
  • Frontend-only applications requiring extra client-side security

🌐 Compatibility

LOCKDOWN has been tested and verified on the following browsers:

Chrome Edge Firefox Opera

⚠️ Disclaimer

This library only provides basic obfuscation and deterrence. It is not a foolproof security solution and should be used alongside proper backend validation and security best practices.

📄 License

MIT License © 2025 Wahyu Primadi

Keywords

lockdown

FAQs

Package last updated on 19 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts