Want to hit f12 using jquery
I am working on one project where I disabled f12 and right clicked using jquery and its working. Code for this:
$(document).keydown(function(event){
if(event.keyCode==123){
return false;
}
else if(event.ctrlKey && event.shiftKey && event.keyCode==73){
return false; //Prevent from ctrl+shift+i
}
});
$(document).on("contextmenu",function(e){
e.preventDefault();
});
Is there a way so that I can press the f12 key using jquery. I want this because I am facing one problem. eg. If google.com is already open with an insect element and then I load my page then it shows me a validation element. So I want to hide the validation window on page load.
Is there a way ???
+3
source to share
2 answers
No, this is not possible, because f12 is connected to the browser, not the page. JavaScript can only communicate with the page.
Source: Handling Key Press Events (F1-F12) Using JavaScript and jQuery, Cross Browser
0
source to share