Answers for "right click of mouse and block F12 key"

0

right click of mouse and block F12 key

Source: https://www.programmingquest.com/2018/08/prevent-right-click-of-mouse-and-block.html

For preventing Right click Context menu:
 
$(document).on("contextmenu", function (e) {        
    e.preventDefault();
});

For preventing 'F12' and 'Ctrl+Shift+I' button click:
 
$(document).keydown(function (event) {
    if (event.keyCode == 123) // Prevent F12
    { 
        return false;
    } 
    else if(event.ctrlKey && event.shiftKey && event.keyCode == 73)
    // Prevent Ctrl+Shift+I
    {         
        return false;
    }
});
Posted by: Guest on April-13-2020

Code answers related to "right click of mouse and block F12 key"

Code answers related to "Javascript"

Browse Popular Code Answers by Language