window.addEventListener('contextmenu', function (e) { // do something here... e.preventDefault(); }, false);