A lightweight JavaScript library that attempts to prevent users from inspecting or interacting with your website using browser developer tools and common shortcuts.
This library does NOT guarantee security.
It only deters casual users. Anyone with technical knowledge can bypass these protections.
Do NOT rely on this for protecting sensitive data.
-
Disable right-click context menu
-
Block DevTools shortcuts:
F12Ctrl + Shift + ICtrl + Shift + JCtrl + Shift + CCtrl + UCtrl + S
-
Disable:
- Text selection
- Dragging
-
Detect DevTools using:
debuggerexecution delay- Window size differences
-
Clears the page if DevTools is detected
Download no-devtools.js and include it:
<script src="no-devtools.js"></script><script src="https://cdn.jsdelivr.net/gh/NTDevLops/no-devtools-js@main/no-devtools.js"></script>Simply include the script in your HTML file:
<!DOCTYPE html>
<html>
<head>
<title>Protected Page</title>
</head>
<body>
<h1>Protected Content</h1>
<script src="no-devtools.js"></script>
</body>
</html>No setup required.
no-devtools-js/
│── no-devtools.js
│── README.md
│── LICENSE
Once loaded, the script:
-
Blocks user interactions like right-click and key shortcuts
-
Monitors for DevTools activity
-
If detected, it:
- Clears the DOM
- Stops page execution
MIT License
Pull requests are welcome. Feel free to improve detection techniques or optimize performance.
If you find this useful, consider giving the repo a star ⭐