๐ก๏ธ web-protect
๐ค Author: Nikola Lukiฤ โ 2025
$3
๐ผ Currently looking for a job
$3
web-protect is a lightweight security helper designed to make runtime debugging and tampering more difficult on web pages.
It provides:
๐ Debugger detection
๐ซ Optional console disabling
๐๏ธ Tab visibility tracking
โ ๏ธ Runtime tamper-protection
๐น๏ธ Useful for multiplayer game UIs, sensitive dashboards, or anti-cheat logic
โ ๏ธ Disclaimer
This package is intended solely for protective purposes.
Use it at your own responsibility.
Do not use it to harm, disrupt, or interfere with legitimate users.
Ensure compliance with local laws and platform policies.
$3
npm install web-protect
or
yarn add web-protect
๐ง API
protect(disableDebugger, disableConsole, onVisibilityChange)
Parameter Type Description
disableDebugger boolean Enables debugger freeze/detection.
disableConsole boolean Disables console functions to make debugging harder.
onVisibilityChange function Custom callback when the tab is hidden or shown.
๐งช Usage Example
``
js
import { protect } from "web-protect";
let hiddenAt = null;
protect(true, true, () => {
if (document.visibilityState === "visible") {
if (hiddenAt !== null) {
const now = Date.now();
const hiddenDuration = (now - hiddenAt) / 1000;
if (hiddenDuration > 1) {
console.log(๐ขโ ๏ธ Tab was hidden for ${hiddenDuration.toFixed(2)} sec.
);
document.title = document.title.replace("๐ข", "๐ก");
}
hiddenAt = null;
} else {
console.log("๐ข Tab is visible โ first activation.");
}
} else {
hiddenAt = Date.now();
}
});
``
$3
When disableConsole = true, these console functions are silenced:
log, info, warn, debug, trace
This makes runtime debugging significantly harder for attackers.
Debugger freeze/detection logic is also included internally.
$3
If you find this tool useful, consider starring the repository or sharing feedback.
๐ Contact: zlatnaspirala@gmail.com
๐งโ๐ป GitHub: https://github.com/zlatnaspirala