JS code blocks the right mouse button Ctrl + N, shift + F10, F11, F5 refresh, backspace key and other keys

April 14, 2022 225 point heat 1 liked it 0 comments


 <script> //Shield right mouse button Ctrl + N, shift + F10, F11, F5 refresh, backspace key function document. oncontextmenu(){event.returnValue=false;} //Shield right mouse button function window. onhelp(){return false} //Block F1 help function document. onkeydown(){ if((window.event.altKey)&& ((window.event.keyCode==37)|| //Block Alt + direction key ← (window.event.keyCode==39))){ //Block Alt + arrow key → Alert ("you are not allowed to use Alt + arrow keys to move forward or backward from the web page!"); event. returnValue=false; }  if((event.keyCode==8)|| //Screen backspace delete key (event.keyCode==116)|| //Block F5 refresh key (event.ctrlKey && event.keyCode==82)){ //Ctrl+R event. keyCode=0; event. returnValue=false;} if(event.keyCode==122){event.keyCode=0;event.returnValue=false;} //Shielding F11 if(event.ctrlKey && event.keyCode==78)event. returnValue=false; //Mask Ctrl + n if(event.shiftKey && event.keyCode==121)event. returnValue=false; //Shield Shift + F10 if(window.event.srcElement.tagName=="A" && window.event.shiftKey) window. event. returnValue=false; //Shield shift and left mouse button to open a new webpage if((window.event.altKey)&&(window.event.keyCode==115))} //Block Alt + F4 window. showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");  return false; }} </script>

Reprinted from @ https://ycb.hk/archives/1770.html


If life is just like the first sight, what is the sad autumn wind painting fan

Article review