As per my requirement i have a PDF file to show to the users. But user should not be able to Save it. So, i need to disable the right click option of the browsers. It is working perfectly in Chrome but not working in Mozilla FF or in IE.
here is my code, which is working good in Chrome but not in FF or in IE.
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = function () { return false; };
} else {
document.onmouseup = function (e) {
if (e != null && e.type == "mouseup") { //Check the Mouse Button which is clicked.
if (e.which == 2 || e.which == 3) { //If the Button is middle or right then disable.
return false;
}
}
};
}
document.oncontextmenu = function () { return false; };