ZeroClick is an easy way to deter site visitors from accessing sensitive or important parts of your website.
There are two different suites of ZeroClick you can use:
The ZeroClick Basic Suite is the standard version of ZeroClick and comes with one-size-fits-all protections (meaning features cannot be disabled). These versions are perfect for small businesses and developers who just want to “set it and forget it.” Console Basic does not disable access to the developer tools, just displays a warning message when they are opened. Education Basic is designed for school websites and prevents access to the right-click/context menu and developer tools.
The ZeroClick Premium Suite is the advanced version of ZeroClick and allows for customization of features and functions. Standard Premium includes protections against right-click/context menu access, developer tools access, page source access, basic copy/pasting, and customization for console messages, denied pages, and keyboard shortcuts. Enterprise Premium includes heavier protections and customizations for keyboard shortcuts, the context menu, mouse shortcuts, clipboard interceptions, and advanced developer tools heuristics with support for allowed element rule exceptions. Both versions offer customization options via an on-page JavaScript config, but Enterprise Premium is more powerful.
Once you have chosen a version of ZeroClick, include the JavaScript library in your site head.
https://zeroclick.pages.dev/lib/basic.api.jshttps://zeroclick.pages.dev/lib/console.api.jshttps://zeroclick.pages.dev/lib/education.api.jshttps://zeroclick.pages.dev/lib/premium.min.jshttps://zeroclick.pages.dev/lib/enterprise.api.jsBasic versions of ZeroClick cannot be customized. This section is for Premium versions only.
In your HTML code, include the config settings before the library. Put both in the head section.
<!-- Custom ZeroClick Configuration -->
<script>
window.ZeroClickConfig = {
// Show content automatically
showContentOnLoad: true,
// Protection settings
disableRightClick: true,
blockDevTools: true,
blockViewSource: true,
blockCopyPaste: false,
// Console warning
showConsoleWarning: false,
// Custom denied page
deniedPage: '/access-denied.html',
// Custom blocked shortcuts
blockedShortcuts: [
{ ctrl: true, key: 'S' }, // Ctrl+S
{ ctrl: true, key: 'P' }, // Ctrl+P
{ ctrl: true, shift: true, key: 'I' }, // Ctrl+Shift+I
{ key: 'F5' } // Refresh
]
};
</script>
<!-- Load the library -->
<script src="https://cdn.example.com/zeroclick.min.js"></script>
In your HTML code, include the library in your head and the config in your body.
<script>
// Initialize ZeroClick with a custom configuration
const guard = ZeroClick.init({
// Disable right-click menu
disableContextMenu: true,
// Custom blocked keyboard shortcuts
blockKeyCombos: [
'ctrl+u',
'f12',
'ctrl+shift+i',
'ctrl+shift+j',
'ctrl+shift+c',
'ctrl+s'
],
// Allow normal behavior inside form fields
allowWhenFocusedOn: ['input', 'textarea', '[contenteditable]'],
// Enable DevTools detection
detectDevTools: true,
devToolsDetectorOptions: {
interval: 1000,
threshold: 200
},
onDevToolsOpen: () => {
console.warn("Developer tools detected. Access may be restricted.");
document.body.style.filter = "blur(4px)";
},
onDevToolsClose: () => {
console.log("Developer tools closed.");
document.body.style.filter = "none";
},
// Clipboard behavior customization
overrideClipboard: {
copy: {
enabled: true,
text: (selectionText) =>
`© Protected Content\n\n${selectionText}`
},
cut: {
enabled: true,
text: "Cut operation blocked by policy."
},
paste: {
enabled: true,
text: "Paste disabled for security reasons."
},
onlyWhenSelectionIsFromPage: true
},
// Block mouse shortcut combinations (middle/right + modifiers)
blockMouseShortcuts: true
});
// Optional: expose controls
window.guard = guard;
// Example: dynamically update config later
// guard.updateConfig({ detectDevTools: false });
</script>