Stop mouse click in browsers

There have been multiple ways to stop your user/s from right clicking on your site, but many of them now fail due to the way firefox’s contextual menu loads.

Below is an example of how to do it:

function _c(e) {if (document.all) {if (event.button==2||event.button==3) {return false;}} else {if (e.button==2||e.button==3) {e.preventDefault();e.stopPropagation();return false;}}if (e.which) {}}if (document.all){document.onmousedown=_c;}else{document.onclick=_c;document.ondblclick=_c;}

..and here is the full working example in a webpage:

<script><br />
function _c(e) {if (document.all) {if (event.button==2||event.button==3) {return false;}} else {if (e.button==2||e.button==3) {e.preventDefault();e.stopPropagation();return false;}}if (e.which) {}}if (document.all){document.onmousedown=_c;}else{document.onclick=_c;document.ondblclick=_c;}<br />
</script>

tester
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments