
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@trap_stevo/devlock
Advanced tools
Protect modern web applications from inspection, tampering, and unauthorized access through real-time detection, checksum enforcement, and customizable response strategies. Monitor developer tools, block key combinations, freeze console output, and enforc
The Guardian of Frontend Integrity
A powerful real-time defense system that detects devtools, locks down source visibility, and executes fully customizable countermeasures against inspection and tampering.
npm install @trap_stevo/devlock
import { DevLock } from "@trap_stevo/devlock";
const devLock = new DevLock({
freezeConsole : true,
verifyChecksum : true,
checksumMode : "dynamic",
redirectURL : "/unauthorized",
violationMethod : "overlay,external",
overlayMessage : "⚠️ Unauthorized action detected.",
onDevToolsOpen : () => console.warn("DevTools access blocked."),
onViolation : (status) => console.log("Violation triggered:", status)
});
devLock.start();
Method | Description |
---|---|
redirect | Navigate to a specified URL |
replace | Replace the page with about:blank |
blank | Wipe the DOM contents |
close | Attempt to close the window |
overlay | Show a full-screen warning overlay |
external | Redirect to browser homepage or URL |
lockStorage | Block access to localStorage/sessionStorage |
Multiple methods may be combined: "overlay,external"
fixed
— compare script hashes against provided listdynamic
— remember initial hashes per session and alert on changesexpectedChecksums : {
"https://yourdomain.com/js/app.js" : "abc123..."
}
overlayMessage : "Access denied. Contact administrator.",
overlayConfigurationSettings : {
background : "#1A1A1A",
color : "#FF4444",
fontSize : "28px"
},
overlayNode : "<div style='...'>Custom HTML content</div>"
Method | Description |
---|---|
start() | Activates detection and begins monitoring for violations. |
stop() | Deactivates monitoring and restores modified behaviors. |
status() | Returns an object containing the current lock status. |
checkNow() | Forces an immediate check for DevTools. |
runViolationMethods(string) | Manually runs one or more violation actions (e.g., "overlay,blank" ). |
Option | Type | Description |
---|---|---|
devMode | boolean | Enables or disables detection during development. |
redirectURL | string | Target URL for redirection. |
violationMethod | string | Comma-separated list of response methods. |
freezeConsole | boolean | Disables console output methods. |
verifyChecksum | boolean | Enables runtime checksum verification. |
checksumMode | "fixed" | "dynamic" | Determines if static or dynamic checksums are enforced. |
expectedChecksums | object | Map of script URLs to expected hashes. |
overlayMessage | string | Message shown in the default overlay. |
overlayConfigurationSettings | object | CSS styles for the overlay. |
overlayNode | HTMLElement | string | Custom node or markup to override default overlay. |
onDevToolsOpen | function | Callback triggered when DevTools opens. |
onDevToolsClosed | function | Callback triggered when DevTools closes. |
onViolation | function | Callback triggered before violation methods execute. |
onRightClick | function | Callback for right-click blocking. |
onBlockedShortcut | function | Callback for blocked key combinations. |
onBeforePrint | function | Callback for beforeprint interception. |
onDragStart | function | Callback for drag start prevention. |
See License in LICENSE.md
FAQs
Protect modern web applications from inspection, tampering, and unauthorized access through real-time detection, checksum enforcement, and customizable response strategies. Monitor developer tools, block key combinations, freeze console output, and enforc
The npm package @trap_stevo/devlock receives a total of 1 weekly downloads. As such, @trap_stevo/devlock popularity was classified as not popular.
We found that @trap_stevo/devlock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.