Here is a solution when added in the custom code section, will block the following:
F12 – Opens Developer Tools
Ctrl+Shift+I – Opens Developer Tools (Inspect)
Ctrl+Shift+J – Opens Developer Tools (Console)
Ctrl+C – Copy
Ctrl+X – Cut
Ctrl+U – View Page Source
Ctrl+S – Save Page
Right-Click – Context menu
<script>
// Block keyboard shortcuts
document.addEventListener("keydown", function (e) {
const key = e.key.toLowerCase();
// Block F12
if (key === "f12") {
console.log("Blocked: F12");
e.preventDefault();
return false;
}
// Block DevTools: Ctrl+Shift+I / Ctrl+Shift+J
if (e.ctrlKey && e.shiftKey && (key === "i" || key === "j")) {
console.log(`Blocked: Ctrl+Shift+${key.toUpperCase()}`);
e.preventDefault();
return false;
}
// Block Ctrl+C, Ctrl+X, Ctrl+U, Ctrl+S
if (e.ctrlKey && ["c", "x", "u", "s"].includes(key)) {
console.log(`Blocked: Ctrl+${key.toUpperCase()}`);
e.preventDefault();
return false;
}
// Log Ctrl+V
if (e.ctrlKey && key === "v") {
console.log("Paste attempt detected: Ctrl+V");
}
});
// Extra: Block paste event for security logging
document.addEventListener("paste", function (e) {
console.log("Paste event captured");
// You can prevent paste here if needed:
// e.preventDefault();
});
// Block right-click
document.addEventListener("contextmenu", function (e) {
e.preventDefault();
console.log("Blocked: Right-click");
return false;
});
</script>