Advanced Context Menu Block

Protect your assets. This script disables the browser's context menu, making it more difficult for casual users to "Save Image As" or "View Source" via the standard mouse and keyboard shortcuts.

Try to Right-Click Here

The context menu should not appear inside this box.

Copy the Script

<script>
// Disable Context Menu (Right Click & Keyboard)
document.addEventListener('contextmenu', event => {
  event.preventDefault();
});
</script>

Frequently Asked Questions

It makes it harder for average users, but a knowledgeable user can always view your source code or disable JavaScript to bypass this.

Yes. This script listens for the 'contextmenu' event which covers both the mouse right-click and the dedicated context menu key on keyboards.

It can be. Users often use right-click to open links in new tabs or print pages. Use this script sparingly, perhaps only on specific image galleries.