<script type="text/javascript">
function click (e) {
if (!e)
e = window.event;
if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) {
if (window.opera)
window.alert("");
return false;
}
}
if (document.layers)
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = click;
document.oncontextmenu = click;
</script>
I found this script on selfhtml.org .
This function was originally intended to disable the context menu on the client side and to insert its own context menu. But it can also be used for this.
But keep in mind . Using browser add-ons such as NoScript, or by opening a URL, the user could get around this.
source
share